OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_comm_split.F File Reference
#include "implicit_f.inc"
#include "spmd.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_comm_split (color, key, subcomm, rank, size_l)

Function/Subroutine Documentation

◆ spmd_comm_split()

subroutine spmd_comm_split ( integer color,
integer key,
integer subcomm,
integer rank,
integer size_l )

Definition at line 32 of file spmd_comm_split.F.

33C Wrapper to MPI_COMM_SPLIT: returns RANK = -1 and
34C SUBCOMM = MPI_COMM_NULL if the processor does not belong the the
35C subcommunicator
36C-----------------------------------------------
37C I m p l i c i t T y p e s
38C-----------------------------------------------
39 USE spmd_comm_world_mod, ONLY : spmd_comm_world
40#include "implicit_f.inc"
41C-----------------------------------------------------------------
42C M e s s a g e P a s s i n g
43C-----------------------------------------------
44#include "spmd.inc"
45C-----------------------------------------------
46C D u m m y A r g u m e n t s
47C-----------------------------------------------
48 INTEGER COMM ! communicator IN
49 INTEGER SUBCOMM ! communicator OUT
50 INTEGER RANK ! rank in the new comm.
51 INTEGER SIZE_L ! size of the new comm.
52 INTEGER COLOR,KEY ! color
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
56#ifdef MPI
57 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
58C-----------------------------------------------
59C S o u r c e L i n e s
60C-----------------------------------------------
61 CALL mpi_barrier(spmd_comm_world,ierror)
62 CALL mpi_comm_split(spmd_comm_world,color,key,subcomm,ierror)
63 IF(color > 0) THEN
64 CALL mpi_comm_rank(subcomm, rank, ierror)
65 CALL mpi_comm_size(subcomm, size_l, ierror)
66 ELSE
67 rank = -1
68 subcomm = mpi_comm_null
69 ENDIF
70 CALL mpi_barrier(spmd_comm_world,ierror)
71
72
73#endif
74 RETURN
subroutine mpi_comm_split(comm, color, key, comm2, ierr)
Definition mpi.f:272
subroutine mpi_barrier(comm, ierr)
Definition mpi.f:188
subroutine mpi_comm_size(comm, size, ierr)
Definition mpi.f:263
subroutine mpi_comm_rank(comm, rank, ierr)
Definition mpi.f:254