Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. ## A simple mpi program which outputs the rank and size of the MPI pool.
  2.  
  3. Save the following program as say `test.py`.
  4.  
  5. ```
  6. #!/usr/bin/env python
  7. from mpi4py import MPI
  8. from subprocess import call
  9.  
  10. comm = MPI.COMM_WORLD
  11.  
  12. print comm.rank, comm.size
  13.  
  14. #cmd = "processCcd.py DATA --rerun processCcdOutputs --id visit=%d ccd=%d" % (visit, ccd)
  15. cmd = "sleep 120"
  16. call(cmd, shell=1)
  17.  
  18. ```
  19.  
  20. Run the program using:
  21. ```
  22. mpirun python test.py
  23. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement