diff --git a/docs.it4i/anselm/software/mpi/mpi4py-mpi-for-python.md b/docs.it4i/anselm/software/mpi/mpi4py-mpi-for-python.md index ed91eb9e7381fcd440c3f535c35c5cdebfb2e179..36769b8d25a25480576dbd09bab9726db35474fc 100644 --- a/docs.it4i/anselm/software/mpi/mpi4py-mpi-for-python.md +++ b/docs.it4i/anselm/software/mpi/mpi4py-mpi-for-python.md @@ -108,11 +108,10 @@ $ mpiexec -bycore -bind-to-core python hello_world.py In this example, we run MPI4Py enabled code on 4 nodes, 16 cores per node (total of 64 processes), each python process is bound to a different core. More examples and documentation can be found on [MPI for Python webpage](https://pypi.python.org/pypi/mpi4py). -###Adding numbers +### Adding numbers Task: count sum of numbers from 1 to 1 000 000. (There is an easy formula to count the sum of arithmetic sequence, but we are showing the MPI solution with adding numbers one by one). - ```python #!/usr/bin/python @@ -160,6 +159,7 @@ if rank == 0: ``` Execute the code above as: + ```console $ qsub -I -q qexp -l select=4:ncpus=16,walltime=00:30:00 @@ -167,4 +167,5 @@ $ ml Python/3.5.2-intel-2017.00 $ mpirun -n 2 python myprogram.py ``` + You can increase n and watch time lowering.