2.1.4 Obtaining parallel processes information

Products: Abaqus/Standard  Abaqus/Explicit  

References

Overview

Utility routines GETNUMCPUS and GETRANK can be called from any Abaqus/Standard user subroutine. GETNUMCPUS returns the number of MPI processes, and GETRANK returns the rank of the MPI process from which the function is called. For example, in a hybrid MPI and thread parallel execution scheme, multiple threads may all return the rank of their parent MPI process (see Parallel execution in Abaqus/Standard, Section 3.5.2 of the Abaqus Analysis User's Guide).

Utility routines VGETNUMCPUS and VGETRANK can be called from any Abaqus/Explicit user subroutine in a domain-parallel run. VGETNUMCPUS provides the number of processes used for the parallel run, and VGETRANK provides the individual process rank (see Parallel execution in Abaqus/Explicit, Section 3.5.3 of the Abaqus Analysis User's Guide).

Utility function GETCOMMUNICATOR can be called from any Abaqus user subroutine. GETCOMMUNICATOR returns a communicator that Abaqus defines for its worker processes, similar to MPI_COMM_WORLD. In Fortran its type is an INTEGER; in C++ this function is called get_communicator() and the return value is of the type MPI_Comm. This communicator can be used for all MPI communication routines. In a nonparallel run the MPI subsystem is not initialized, communicators do not exist, and both GET_COMMUNICATOR() and get_communicator() will return 0.


GETNUMCPUS and VGETNUMCPUS (obtain the number of processes)

Interface

         CALL GETNUMCPUS( NUMPROCESSES )
         CALL VGETNUMCPUS( NUMPROCESSES )
         ...

Variable returned from the utility routine

NUMPROCESSES

Number of processes specified for the analysis.


GETRANK and VGETRANK (obtain the process number)

Interface

            CALL GETRANK( KPROCESSNUM )
            CALL VGETRANK( KPROCESSNUM )
            ...

Variable returned from the utility routine

KPROCESSNUM

Process number or rank. A process number is either zero or a positive integer.


GET_COMMUNICATOR (FORTRAN)

Interface

         integer ABA_COMM_WORLD, GETCOMMUNICATOR

         ABA_COMM_WORLD = GETCOMMUNICATOR()

         if (ABA_COMM_WORLD.ne.0) then
             ...do some parallel work, using MPI ...
         else
             ...do some work in a single process ...
         end if

Variable returned from the utility routine

INTEGER

Communicator handle of type INTEGER. In a non-MPI run, the value returned will be zero.


get_communicator (C++)

Interface

         MPI_Comm get_communicator();

         MPI_Comm ABA_COMM_WORLD = get_communicator()

         if (ABA_COMM_WORLD) {
            ... do some parallel work, using MPI ... 
         }
         else{
             ...do some work in a single process ...
         }

Variable returned from the utility routine

MPI_Comm

Communicator handle of type MPI_Comm. In a non-MPI run, the value returned will be zero.