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

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_all_dmin (v, len)
subroutine spmd_glob_dsum (v, len, vtmp)
subroutine spmd_glob_dpsum (v, len, vtmp)
subroutine spmd_glob_fsum (v, len, vtmp)
subroutine spmd_part_com (tag, main, icomv)
subroutine spmd_glob_fsum9 (v, len)
subroutine spmd_glob_dsum9 (v, len)
subroutine spmd_glob_dpsum9 (v, len)
subroutine spmd_glob_isum9 (v, len)
subroutine spmd_glob_min (v, len)
subroutine spmd_glob_max (v, len)

Function/Subroutine Documentation

◆ spmd_all_dmin()

subroutine spmd_all_dmin ( v,
integer len )

Definition at line 29 of file spmd_th.F.

30C min table V of size LEN of type my_real
31C result in VTMP of size LEN
32C-----------------------------------------------
33C I m p l i c i t T y p e s
34C-----------------------------------------------
35 USE spmd_comm_world_mod, ONLY : spmd_comm_world
36#include "implicit_f.inc"
37C-----------------------------------------------------------------
38C M e s s a g e P a s s i n g
39C-----------------------------------------------
40#include "spmd.inc"
41C-----------------------------------------------
42C C o m m o n B l o c k s
43C-----------------------------------------------
44#include "task_c.inc"
45C-----------------------------------------------
46C D u m m y A r g u m e n t s
47C-----------------------------------------------
48 INTEGER LEN
50 . v(len)
51C-----------------------------------------------
52C L o c a l V a r i a b l e s
53C-----------------------------------------------
54#ifdef MPI
55 INTEGER I, IERROR
57 . vtmp(len)
58C-----------------------------------------------
59C S o u r c e L i n e s
60C-----------------------------------------------
61 IF (len > 0) THEN
62 CALL mpi_allreduce(v,vtmp,len,real,mpi_min,
63 . spmd_comm_world,ierror)
64 IF(ispmd==0)THEN
65 DO i = 1, len
66 v(i) = vtmp(i)
67 END DO
68 END IF
69 ENDIF
70C
71#endif
72 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine mpi_allreduce(sendbuf, recvbuf, cnt, datatype, operation, comm, ierr)
Definition mpi.f:103

◆ spmd_glob_dpsum()

subroutine spmd_glob_dpsum ( double precision, dimension(len) v,
integer len,
double precision, dimension(*) vtmp )

Definition at line 136 of file spmd_th.F.

137C gather table V of size LEN of type my_dp
138C-----------------------------------------------
139C I m p l i c i t T y p e s
140C-----------------------------------------------
141 USE spmd_comm_world_mod, ONLY : spmd_comm_world
142#include "implicit_f.inc"
143
144C-----------------------------------------------------------------
145C M e s s a g e P a s s i n g
146C-----------------------------------------------
147#include "spmd.inc"
148C-----------------------------------------------
149C C o m m o n B l o c k s
150C-----------------------------------------------
151#include "task_c.inc"
152C-----------------------------------------------
153C D u m m y A r g u m e n t s
154C-----------------------------------------------
155 INTEGER LEN
156 DOUBLE PRECISION V(LEN),VTMP(*)
157C-----------------------------------------------
158C L o c a l V a r i a b l e s
159C-----------------------------------------------
160#ifdef MPI
161 INTEGER I
162 INTEGER IERROR
163C-----------------------------------------------
164C S o u r c e L i n e s
165C-----------------------------------------------
166 IF (len > 0) THEN
167 CALL mpi_reduce(v,vtmp,len,
168 . mpi_double_precision,mpi_sum,it_spmd(1),
169 . spmd_comm_world,ierror)
170 ENDIF
171 IF (ispmd==0) THEN
172 DO i=1,len
173 v(i) = vtmp(i)
174 END DO
175 ENDIF
176C
177#endif
178 RETURN
subroutine mpi_reduce(sendbuf, recvbuf, cnt, datatype, op, root, comm, ierr)
Definition mpi.f:120

◆ spmd_glob_dpsum9()

subroutine spmd_glob_dpsum9 ( double precision, dimension(len) v,
integer len )

Definition at line 434 of file spmd_th.F.

435C Gather Table V of Double precision type size
436C-----------------------------------------------
437C I m p l i c i t T y p e s
438C-----------------------------------------------
439 USE spmd_comm_world_mod, ONLY : spmd_comm_world
440#include "implicit_f.inc"
441C-----------------------------------------------------------------
442C M e s s a g e P a s s i n g
443C-----------------------------------------------
444#include "spmd.inc"
445C-----------------------------------------------
446C C o m m o n B l o c k s
447C-----------------------------------------------
448#include "task_c.inc"
449C-----------------------------------------------
450C D u m m y A r g u m e n t s
451C-----------------------------------------------
452 INTEGER LEN
453 double precision
454 . v(len)
455C-----------------------------------------------
456C L o c a l V a r i a b l e s
457C-----------------------------------------------
458#ifdef MPI
459 INTEGER I, IERROR
460 double precision
461 . vtmp(len)
462C-----------------------------------------------
463C S o u r c e L i n e s
464C-----------------------------------------------
465 IF (len > 0) THEN
466 CALL mpi_reduce(v,vtmp,len,
467 . mpi_double_precision,mpi_sum,it_spmd(1),
468 . spmd_comm_world,ierror)
469 ENDIF
470 IF (ispmd==0) THEN
471 DO i=1,len
472 v(i) = vtmp(i)
473 END DO
474 ENDIF
475C
476#endif
477 RETURN

◆ spmd_glob_dsum()

subroutine spmd_glob_dsum ( v,
integer len,
vtmp )

Definition at line 86 of file spmd_th.F.

87C gather table V of size LEN of type my_real
88C-----------------------------------------------
89C I m p l i c i t T y p e s
90C-----------------------------------------------
91 USE spmd_comm_world_mod, ONLY : spmd_comm_world
92#include "implicit_f.inc"
93C-----------------------------------------------------------------
94C M e s s a g e P a s s i n g
95C-----------------------------------------------
96#include "spmd.inc"
97C-----------------------------------------------
98C C o m m o n B l o c k s
99C-----------------------------------------------
100#include "task_c.inc"
101C-----------------------------------------------
102C D u m m y A r g u m e n t s
103C-----------------------------------------------
104 INTEGER LEN
105 my_real v(len),vtmp(*)
106C-----------------------------------------------
107C L o c a l V a r i a b l e s
108C-----------------------------------------------
109#ifdef MPI
110 INTEGER I
111 INTEGER IERROR
112C-----------------------------------------------
113C S o u r c e L i n e s
114C-----------------------------------------------
115 IF (len > 0) THEN
116 CALL mpi_reduce(v,vtmp,len,
117 . real,mpi_sum,it_spmd(1),
118 . spmd_comm_world,ierror)
119 ENDIF
120 IF (ispmd==0) THEN
121 DO i=1,len
122 v(i) = vtmp(i)
123 END DO
124 ENDIF
125C
126#endif
127 RETURN

◆ spmd_glob_dsum9()

subroutine spmd_glob_dsum9 ( v,
integer len )

Definition at line 378 of file spmd_th.F.

379C gather table V of size LEN of type my_real
380C-----------------------------------------------
381C I m p l i c i t T y p e s
382C-----------------------------------------------
383 USE spmd_comm_world_mod, ONLY : spmd_comm_world
384#include "implicit_f.inc"
385C-----------------------------------------------------------------
386C M e s s a g e P a s s i n g
387C-----------------------------------------------
388#include "spmd.inc"
389C-----------------------------------------------
390C C o m m o n B l o c k s
391C-----------------------------------------------
392#include "task_c.inc"
393C-----------------------------------------------
394C D u m m y A r g u m e n t s
395C-----------------------------------------------
396 INTEGER LEN
397 my_real
398 . v(len)
399C-----------------------------------------------
400C L o c a l V a r i a b l e s
401C-----------------------------------------------
402#ifdef MPI
403 INTEGER I, IERROR
404 my_real
405 . vtmp(len)
406C-----------------------------------------------
407C S o u r c e L i n e s
408C-----------------------------------------------
409 IF (len > 0) THEN
410 CALL mpi_reduce(v,vtmp,len,
411 . real,mpi_sum,it_spmd(1),
412 . spmd_comm_world,ierror)
413 ENDIF
414 IF (ispmd==0) THEN
415 DO i=1,len
416 v(i) = vtmp(i)
417 END DO
418 ENDIF
419C
420#endif
421 RETURN

◆ spmd_glob_fsum()

subroutine spmd_glob_fsum ( real*4, dimension(len) v,
integer len,
real*4, dimension(*) vtmp )

Definition at line 187 of file spmd_th.F.

188C gather tableau V de taille LEN de type REAL*4
189C-----------------------------------------------
190C I m p l i c i t T y p e s
191C-----------------------------------------------
192 USE spmd_comm_world_mod, ONLY : spmd_comm_world
193#include "implicit_f.inc"
194C-----------------------------------------------------------------
195C M e s s a g e P a s s i n g
196C-----------------------------------------------
197#include "spmd.inc"
198C-----------------------------------------------
199C C o m m o n B l o c k s
200C-----------------------------------------------
201#include "task_c.inc"
202C-----------------------------------------------
203C D u m m y A r g u m e n t s
204C-----------------------------------------------
205 INTEGER LEN
206 real*4 v(len),vtmp(*)
207C-----------------------------------------------
208C L o c a l V a r i a b l e s
209C-----------------------------------------------
210#ifdef MPI
211 INTEGER I
212 INTEGER IERROR
213C-----------------------------------------------
214C S o u r c e L i n e s
215C-----------------------------------------------
216 IF (len > 0) THEN
217 CALL mpi_reduce(v,vtmp,len,
218 . mpi_real4,mpi_sum,it_spmd(1),
219 . spmd_comm_world,ierror)
220 ENDIF
221 IF (ispmd==0) THEN
222 DO i=1,len
223 v(i) = vtmp(i)
224 END DO
225 ENDIF
226C
227#endif
228 RETURN

◆ spmd_glob_fsum9()

subroutine spmd_glob_fsum9 ( real, dimension(len) v,
integer len )

Definition at line 301 of file spmd_th.F.

302C gather table V of size LEN of type real
303C-----------------------------------------------
304C I m p l i c i t T y p e s
305C-----------------------------------------------
306 USE my_alloc_mod
307 USE spmd_comm_world_mod, ONLY : spmd_comm_world
308#include "implicit_f.inc"
309C-----------------------------------------------------------------
310C M e s s a g e P a s s i n g
311C-----------------------------------------------
312#include "spmd.inc"
313C-----------------------------------------------
314C C o m m o n B l o c k s
315C-----------------------------------------------
316#include "task_c.inc"
317C-----------------------------------------------
318C D u m m y A r g u m e n t s
319C-----------------------------------------------
320 INTEGER LEN
321 real
322 . v(len)
323C-----------------------------------------------
324C L o c a l V a r i a b l e s
325C-----------------------------------------------
326#ifdef MPI
327 INTEGER I, IERROR
328 REAL, DIMENSION(:),ALLOCATABLE :: VTMP
329C-----------------------------------------------
330C S o u r c e L i n e s
331C-----------------------------------------------
332 CALL my_alloc(vtmp,len)
333 IF (len > 0) THEN
334 CALL mpi_reduce(v,vtmp,len,
335 . mpi_real,mpi_sum,it_spmd(1),
336 . spmd_comm_world,ierror)
337 ENDIF
338 IF (ispmd==0) THEN
339 DO i=1,len
340 v(i) = vtmp(i)
341 END DO
342 ENDIF
343C
344 DEALLOCATE(vtmp)
345#endif
346 RETURN

◆ spmd_glob_isum9()

subroutine spmd_glob_isum9 ( integer, dimension(len) v,
integer len )

Definition at line 519 of file spmd_th.F.

520C gather table V of size LEN of type integer
521C-----------------------------------------------
522C I m p l i c i t T y p e s
523C-----------------------------------------------
524 USE spmd_comm_world_mod, ONLY : spmd_comm_world
525#include "implicit_f.inc"
526C-----------------------------------------------------------------
527C M e s s a g e P a s s i n g
528C-----------------------------------------------
529#include "spmd.inc"
530C-----------------------------------------------
531C C o m m o n B l o c k s
532C-----------------------------------------------
533#include "task_c.inc"
534C-----------------------------------------------
535C D u m m y A r g u m e n t s
536C-----------------------------------------------
537 INTEGER LEN, V(LEN)
538C-----------------------------------------------
539C L o c a l V a r i a b l e s
540C-----------------------------------------------
541#ifdef MPI
542 INTEGER I, IERROR,
543 . VTMP(LEN)
544C-----------------------------------------------
545C S o u r c e L i n e s
546C-----------------------------------------------
547 IF (len > 0) THEN
548 CALL mpi_reduce(v,vtmp,len,
549 . mpi_integer,mpi_sum,it_spmd(1),
550 . spmd_comm_world,ierror)
551 ENDIF
552 IF (ispmd==0) THEN
553 DO i=1,len
554 v(i) = vtmp(i)
555 END DO
556 ENDIF
557C
558#endif
559 RETURN

◆ spmd_glob_max()

subroutine spmd_glob_max ( v,
integer len )

Definition at line 617 of file spmd_th.F.

618C gather table V of size LEN of type reel
619C-----------------------------------------------
620C I m p l i c i t T y p e s
621C-----------------------------------------------
622 USE spmd_comm_world_mod, ONLY : spmd_comm_world
623#include "implicit_f.inc"
624C-----------------------------------------------------------------
625C M e s s a g e P a s s i n g
626C-----------------------------------------------
627#include "spmd.inc"
628C-----------------------------------------------
629C C o m m o n B l o c k s
630C-----------------------------------------------
631#include "task_c.inc"
632C-----------------------------------------------
633C D u m m y A r g u m e n t s
634C-----------------------------------------------
635 INTEGER LEN
636 my_real
637 . v(len),vtmp(len)
638C-----------------------------------------------
639C L o c a l V a r i a b l e s
640C-----------------------------------------------
641#ifdef MPI
642
643 INTEGER I, IERROR
644C-----------------------------------------------
645C S o u r c e L i n e s
646C-----------------------------------------------
647 IF (len > 0) THEN
648 CALL mpi_reduce(v,vtmp,len,
649 . real,mpi_max,it_spmd(1),
650 . spmd_comm_world,ierror)
651 ENDIF
652 IF (ispmd==0) THEN
653 DO i=1,len
654 v(i) = vtmp(i)
655 END DO
656 ENDIF
657C
658#endif
659 RETURN

◆ spmd_glob_min()

subroutine spmd_glob_min ( v,
integer len )

Definition at line 568 of file spmd_th.F.

569C gather table V of size LEN of type reel
570C-----------------------------------------------
571C I m p l i c i t T y p e s
572C-----------------------------------------------
573 USE spmd_comm_world_mod, ONLY : spmd_comm_world
574#include "implicit_f.inc"
575C-----------------------------------------------------------------
576C M e s s a g e P a s s i n g
577C-----------------------------------------------
578#include "spmd.inc"
579C-----------------------------------------------
580C C o m m o n B l o c k s
581C-----------------------------------------------
582#include "task_c.inc"
583C-----------------------------------------------
584C D u m m y A r g u m e n t s
585C-----------------------------------------------
586 INTEGER LEN
587 my_real
588 . v(len),vtmp(len)
589C-----------------------------------------------
590C L o c a l V a r i a b l e s
591C-----------------------------------------------
592#ifdef MPI
593 INTEGER I, IERROR
594C-----------------------------------------------
595C S o u r c e L i n e s
596C-----------------------------------------------
597 IF (len > 0) THEN
598 CALL mpi_reduce(v,vtmp,len,
599 . real,mpi_min,it_spmd(1),
600 . spmd_comm_world,ierror)
601 ENDIF
602 IF (ispmd==0) THEN
603 DO i=1,len
604 v(i) = vtmp(i)
605 END DO
606 ENDIF
607C
608#endif
609 RETURN

◆ spmd_part_com()

subroutine spmd_part_com ( integer tag,
integer main,
integer, dimension(*) icomv )

Definition at line 239 of file spmd_th.F.

240C fills on pmain the table ICOMV according to the value of local TAG
241C ie on main : ICOMV(P) = "TAG on p"
242C-----------------------------------------------
243C I m p l i c i t T y p e s
244C-----------------------------------------------
245 USE spmd_comm_world_mod, ONLY : spmd_comm_world
246#include "implicit_f.inc"
247C-----------------------------------------------------------------
248C M e s s a g e P a s s i n g
249C-----------------------------------------------
250#include "spmd.inc"
251C-----------------------------------------------
252C C o m m o n B l o c k s
253C-----------------------------------------------
254#include "com01_c.inc"
255#include "task_c.inc"
256C-----------------------------------------------
257C D u m m y A r g u m e n t s
258C-----------------------------------------------
259 INTEGER TAG, MAIN, ICOMV(*)
260C-----------------------------------------------
261C L o c a l V a r i a b l e s
262C-----------------------------------------------
263#ifdef MPI
264 INTEGER MSGOFF,MSGTYP,K,LOC_PROC
265 DATA msgoff/8001/
266 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
267C-----------------------------------------------
268C S o u r c e L i n e s
269C-----------------------------------------------
270 loc_proc = ispmd+1
271 IF (loc_proc/=main) THEN
272 msgtyp=msgoff
273 CALL mpi_send(tag,1,mpi_integer,it_spmd(main),
274 . msgtyp,spmd_comm_world,ierror)
275 ELSE
276 icomv(main) = tag
277 DO k=1,nspmd
278 IF(k/=main) THEN
279 msgtyp=msgoff
280 CALL mpi_recv(tag,1,mpi_integer,it_spmd(k),
281 . msgtyp,spmd_comm_world,status,ierror)
282 icomv(k) = tag
283 END IF
284 END DO
285 ENDIF
286C
287#endif
288 RETURN
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
Definition mpi.f:461
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
int main(int argc, char *argv[])