OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_sd_gau.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/.
23C
24!||====================================================================
25!|| spmd_sd_gau ../engine/source/mpi/output/spmd_sd_gau.F
26!||--- called by ------------------------------------------------------
27!|| agauge0 ../engine/source/ale/agauge.F
28!|| hist2 ../engine/source/output/th/hist2.F
29!||--- calls -----------------------------------------------------
30!||--- uses -----------------------------------------------------
31!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
32!||====================================================================
33 SUBROUTINE spmd_sd_gau(GAUGE,IGAUP,NGAUP)
34C envoi vers p0 du tableau GAUGE calcule sur chaque proc
35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38 USE spmd_comm_world_mod, ONLY : spmd_comm_world
39#include "implicit_f.inc"
40C-----------------------------------------------------------------
41C M e s s a g e P a s s i n g
42C-----------------------------------------------
43#include "spmd.inc"
44C-----------------------------------------------
45C C o m m o n B l o c k s
46C-----------------------------------------------
47#include "com01_c.inc"
48#include "com04_c.inc"
49#include "task_c.inc"
50#include "param_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER IGAUP(*), NGAUP(*)
56 . gauge(llgauge,*)
57C-----------------------------------------------
58C L o c a l V a r i a b l e s
59C-----------------------------------------------
60#ifdef MPI
61 INTEGER MSGTYP,MSGOFF,IERROR,LOC_PROC,NN,L,I,K,N,II,J,
62 . IDEB,SIZ,A_AR,NBIRECV,INDEX,
63 . IRINDEX(NSPMD),REQ_R(NSPMD),IAD_RECV(NSPMD),
64 . STATUS(MPI_STATUS_SIZE)
66 . buf(llgauge+1,nbgauge)
67 DATA msgoff/202/
68C-----------------------------------------------
69C S o u r c e L i n e s
70C-----------------------------------------------
71 loc_proc = ispmd + 1
72 IF (loc_proc==1) THEN
73 ideb = 1
74 nbirecv = 0
75 DO i = 2, nspmd
76 iad_recv(i) = ideb
77 IF(ngaup(i)>0)THEN
78 nbirecv = nbirecv + 1
79 irindex(nbirecv) = i
80 nn = ngaup(i)
81 siz = (llgauge+1)*nn
82 msgtyp = msgoff
83 CALL mpi_irecv(
84 s buf(1,ideb),siz,real,it_spmd(i),msgtyp,
85 g spmd_comm_world,req_r(nbirecv),ierror)
86 ideb = ideb + nn
87 END IF
88 END DO
89C
90 DO ii = 1, nbirecv
91 CALL mpi_waitany(nbirecv,req_r,index,status,ierror)
92 i = irindex(index)
93 l = iad_recv(i)
94 nn = ngaup(i)
95 DO n = l, l+nn-1
96 k = nint(buf(1,n))
97 DO j = 1, llgauge
98 gauge(j,k) = buf(j+1,n)
99 END DO
100 END DO
101 END DO
102C
103 ELSE
104 k = 0
105 DO n = 1, nbgauge
106 IF(igaup(n)==loc_proc)THEN
107 k = k + 1
108 buf(1,k) = n
109 DO j = 1, llgauge
110 buf(j+1,k) = gauge(j,n)
111 END DO
112 END IF
113 END DO
114 IF(k>0)THEN
115 siz = (llgauge+1)*k
116 msgtyp=msgoff
117 CALL mpi_send(
118 s buf,siz,real,it_spmd(1),msgtyp,
119 g spmd_comm_world,ierror)
120 END IF
121 END IF
122C
123#endif
124 RETURN
125 END
#define my_real
Definition cppsort.cpp:32
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
subroutine mpi_waitany(cnt, array_of_requests, index, status, ierr)
Definition mpi.f:549
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372
subroutine spmd_sd_gau(gauge, igaup, ngaup)
Definition spmd_sd_gau.F:34