10
0
mirror of https://gitlab.com/scemama/eplf synced 2024-06-01 19:05:27 +02:00
eplf/mpi.irp.f

36 lines
603 B
FortranFixed
Raw Normal View History

2009-05-15 01:01:27 +02:00
BEGIN_PROVIDER [ integer, mpi_rank ]
&BEGIN_PROVIDER [ integer, mpi_size ]
&BEGIN_PROVIDER [ logical, mpi_master ]
implicit none
IRP_IF MPI
include 'mpif.h'
IRP_ENDIF
BEGIN_DOC
! mpi_rank : ID of the current processor
!
! mpi_size : Total number of processors
!
! mpi_master : True if the current processor is the master
END_DOC
mpi_size = 1
mpi_rank = 0
IRP_IF MPI
integer :: ierr
call MPI_INIT(ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, mpi_rank, ierr)
call MPI_COMM_SIZE(MPI_COMM_WORLD, mpi_size, ierr)
IRP_ENDIF
mpi_master = (mpi_rank == 0)
END_PROVIDER