cc_staff
153
edits
m (More Python (mpi4py) examples) |
m (More Python (mpi4py)) |
||
Line 141: | Line 141: | ||
MPI_Init(ierr) | MPI_Init(ierr) | ||
INTEGER, OPTIONAL, INTENT(OUT) :: ierr | INTEGER, OPTIONAL, INTENT(OUT) :: ierr | ||
</source> | |||
</tab> | |||
<tab name="Python (mpi4py)"> | |||
<source lang="Python"> | |||
# importing automatically initializes MPI with mpi4py | |||
MPI.Init() | |||
</source> | </source> | ||
</tab> | </tab> | ||
Line 171: | Line 177: | ||
INTEGER, OPTIONAL, INTENT(OUT) :: ierr | INTEGER, OPTIONAL, INTENT(OUT) :: ierr | ||
</source> | </source> | ||
</tab> | |||
<tab name="Python (mpi4py)"> | |||
<source lang="Python"> | |||
# mpi4py installs a termination hook so there is no need to explicitly call MPI.Finalize. | |||
MPI.Finalize() | |||
</source> | |||
</tab> | </tab> | ||
</tabs> | </tabs> | ||
Line 299: | Line 311: | ||
INTEGER, INTENT(OUT) :: rank | INTEGER, INTENT(OUT) :: rank | ||
INTEGER, OPTIONAL, INTENT(OUT) :: ierr | INTEGER, OPTIONAL, INTENT(OUT) :: ierr | ||
</source> | |||
</tab> | |||
<tab name="Python (mpi4py)"> | |||
<source lang="python"> | |||
MPI.Intracomm.Get_rank(self) | |||
MPI.Intracomm.Get_size(self) | |||
</source> | </source> | ||
</tab> | </tab> |