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