Initialization of MPI.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | optional | :: | comm_in |
SUBROUTINE par_Init(comm_in) ! MODULES USE MODgvec_Globals, ONLY : MPIRoot,myRank,nRanks IMPLICIT NONE !-------------------------------------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLE INTEGER, INTENT(IN),OPTIONAL :: comm_in !-------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES INTEGER :: ierr,provided !================================================================================================================================ ! BODY # if MPI IF(PRESENT(comm_in)) THEN worldComm = TRANSFER(comm_in,worldcomm) ELSE !CALL MPI_INIT(ierr) CALL MPI_INIT_THREAD(MPI_THREAD_SINGLE,provided,ierr) !CALL MPI_INIT_THREAD(MPI_THREAD_FUNNELED,provided,ierr) worldComm = MPI_COMM_WORLD END IF CALL MPI_COMM_SIZE(worldComm, nRanks, ierr) CALL MPI_COMM_RANK(worldComm, myRank, ierr) dType=MPI_DOUBLE_PRECISION # endif MPIRoot=(myRank.EQ.0) ALLOCATE(req (0:nRanks-1)) ALLOCATE(req1(0:nRanks-1)) ALLOCATE(req2(0:nRanks-1)) ALLOCATE(req3(0:nRanks-1)) END SUBROUTINE par_Init