OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_comm_split.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| spmd_comm_split ../engine/source/mpi/generic/spmd_comm_split.F
25!||--- called by ------------------------------------------------------
26!|| fvrrest ../engine/source/output/restart/rdresb.F
27!|| spmd_i25front_init ../engine/source/mpi/interfaces/spmd_i25front.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
31!||====================================================================
32 SUBROUTINE spmd_comm_split(COLOR,KEY,SUBCOMM,RANK,SIZE_L)
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
75 END
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
subroutine spmd_comm_split(color, key, subcomm, rank, size_l)