MPITOOLS: Add maximum rank of the node.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2021-07-15 17:25:32 -03:00
parent b933c444df
commit 19e89c4dd2

View File

@ -70,7 +70,7 @@ module mpitools
! MPI global variables ! MPI global variables
! !
integer(kind=4), save :: nproc, nprocs, nodes, node, lprocs, lproc integer(kind=4), save :: nproc, nprocs, nodes, node, lprocs, lproc
integer(kind=4), save :: npmax, npairs integer(kind=4), save :: npmax, lpmax, npairs
logical , save :: master = .true. logical , save :: master = .true.
! allocatable array for processor pairs ! allocatable array for processor pairs
@ -94,7 +94,7 @@ module mpitools
! declare public variables ! declare public variables
! !
public :: master, nproc, nprocs, nodes, node, lprocs, lproc public :: master, nproc, nprocs, nodes, node, lprocs, lproc
public :: npmax, npairs, pairs public :: npmax, lpmax, npairs, pairs
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! !
@ -173,6 +173,8 @@ module mpitools
nodes = 1 nodes = 1
node = 0 node = 0
lproc = 0 lproc = 0
lprocs = 1
lpmax = 0
#ifdef MPI #ifdef MPI
! initialize the MPI parallelization ! initialize the MPI parallelization
@ -241,6 +243,7 @@ module mpitools
"Could not get the number of node processes!" "Could not get the number of node processes!"
status = 1 status = 1
end if end if
lpmax = lprocs - 1
nodes = nprocs / lprocs nodes = nprocs / lprocs
node = nproc / lprocs node = nproc / lprocs
call MPI_Comm_rank(comm, lproc, ierror) call MPI_Comm_rank(comm, lproc, ierror)