OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_split_comm_joint.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_split_comm_joint ../engine/source/mpi/init/spmd_split_comm_joint.F
25!||--- called by ------------------------------------------------------
26!|| mpp_init ../engine/source/mpi/interfaces/spmd_i7tool.F
27!||--- calls -----------------------------------------------------
28!||--- uses -----------------------------------------------------
29!|| joint_mod ../engine/share/modules/joint_mod.F
30!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
31!||====================================================================
33!$COMMENT
34! SPMD_SPLIT_COMM_JOINT :
35! SPMD_SPLIT_COMM_JOINT creates new communicators
36! for /CYL_JOINT
37! SPMD_SPLIT_COMM_JOINT organization :
38! - loop over the joints in order to
39! tag all the processors
40! - then create a communicator for a given
41! joint
42!$ENDCOMMENT
43C-----------------------------------------------
44C M o d u l e s
45C-----------------------------------------------
46 USE joint_mod
47C-----------------------------------------------
48C I m p l i c i t T y p e s
49C-----------------------------------------------
50 USE spmd_comm_world_mod, ONLY : spmd_comm_world
51#include "implicit_f.inc"
52C-----------------------------------------------
53C M e s s a g e P a s s i n g
54C-----------------------------------------------
55#include "spmd.inc"
56C-----------------------------------------------
57C C o m m o n B l o c k s
58C-----------------------------------------------
59#include "com04_c.inc"
60#include "task_c.inc"
61C-----------------------------------------------
62C D u m m y A r g u m e n t s
63C-----------------------------------------------
64
65C-----------------------------------------------
66C L o c a l V a r i a b l e s
67C-----------------------------------------------
68#ifdef MPI
69
70 integer :: KEY,CODE,I,P
71 INTEGER :: KK
72
73C-----------------------------------------------
74C S o u r c e L i n e s
75C-----------------------------------------------
76 p = ispmd + 1
77! -----------------------------
78! loop over the interface
79 DO kk=1,njoint
80! -----------------------------
81 ! color the processor
82 IF(cyl_join(kk)%NUMBER_NODE>0.OR.cyl_join(kk)%NUMBER_MAIN_NODE>0) THEN
83 cyl_join(kk)%COMM_MPI%COLOR=1
84 key = 1
85 ELSE
86 cyl_join(kk)%COMM_MPI%COLOR=0
87 key = 0
88 ENDIF
89 ! create the communicator
90 CALL mpi_comm_split(spmd_comm_world,cyl_join(kk)%COMM_MPI%COLOR,p,cyl_join(kk)%COMM_MPI%COMM,code)
91 IF(cyl_join(kk)%COMM_MPI%COLOR==1) THEN
92 CALL mpi_comm_rank(cyl_join(kk)%COMM_MPI%COMM,cyl_join(kk)%COMM_MPI%RANK,code)
93 ENDIF
94 ENDDO
95! -----------------------------
96#endif
97 RETURN
98 END SUBROUTINE spmd_split_comm_joint
subroutine mpi_comm_split(comm, color, key, comm2, ierr)
Definition mpi.f:272
subroutine mpi_comm_rank(comm, rank, ierr)
Definition mpi.f:254
type(joint_type), dimension(:), allocatable cyl_join
Definition joint_mod.F:61
subroutine spmd_split_comm_joint()