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

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_fl_sum (lsum, len, lsumt)

Function/Subroutine Documentation

◆ spmd_fl_sum()

subroutine spmd_fl_sum ( lsum,
integer len,
lsumt )

Definition at line 36 of file spmd_fl_sum.F.

37C-----------------------------------------------
38C I m p l i c i t T y p e s
39C-----------------------------------------------
40 USE spmd_comm_world_mod, ONLY : spmd_comm_world
41#include "implicit_f.inc"
42C-----------------------------------------------------------------
43C M e s s a g e P a s s i n g
44C-----------------------------------------------
45#include "spmd.inc"
46C-----------------------------------------------
47C C o m m o n B l o c k s
48C-----------------------------------------------
49#include "com01_c.inc"
50#include "task_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER LEN
56 . lsum(*), lsumt(*)
57C-----------------------------------------------
58C L o c a l V a r i a b l e s
59C-----------------------------------------------
60#ifdef MPI
61 INTEGER MSGOFF, MSGOFF2,ITAG, REQ(2), TSTAT(MPI_STATUS_SIZE,2), IERR,
62 . I, II, REQ1(NSPMD-1), J,
63 . STAT1(MPI_STATUS_SIZE,NSPMD-1)
65 . lsumc(len)
66C
67 DATA msgoff/186/
68 DATA msgoff2/187/
69C
70 IF (ispmd/=0) THEN
71 itag=msgoff
72 CALL mpi_isend(lsum, len, real, it_spmd(1), itag,
73 . spmd_comm_world, req(1), ierr)
74C
75 itag=msgoff2
76 CALL mpi_irecv(lsumt, len, real, it_spmd(1), itag,
77 . spmd_comm_world, req(2), ierr)
78C
79 CALL mpi_waitall(2, req, tstat, ierr)
80 ELSE
81 DO i=1,len
82 lsumt(i)=lsum(i)
83 ENDDO
84C
85 DO i=1,nspmd-1
86 ii=i+1
87 itag=msgoff
88 CALL mpi_irecv(lsumc, len, real, it_spmd(ii), itag,
89 . spmd_comm_world, req1(1), ierr)
90 CALL mpi_wait(req1(1), stat1(1,1), ierr)
91C
92 DO j=1,len
93 lsumt(j)=lsumt(j)+lsumc(j)
94 ENDDO
95 ENDDO
96C
97 DO i=1,nspmd-1
98 ii=i+1
99 itag=msgoff2
100 CALL mpi_isend(lsumt, len, real, it_spmd(ii), itag,
101 . spmd_comm_world, req1(i), ierr)
102 ENDDO
103C
104 CALL mpi_waitall(nspmd-1, req1, stat1, ierr)
105 ENDIF
106C
107#endif
108 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine mpi_isend(buf, cnt, datatype, dest, tag, comm, ireq, ierr)
Definition mpi.f:382
subroutine mpi_wait(ireq, status, ierr)
Definition mpi.f:525
subroutine mpi_waitall(cnt, array_of_requests, status, ierr)
Definition mpi.f:536
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372