FrontISTR  5.2.0
Large-scale structural analysis program with finit element method
hecmw_solver_SR_33i.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
5 
6 !C
7 !C***
8 !C*** module hecmw_solver_SR_33i
9 !C***
10 !C
12 contains
13  !C
14  !C*** SOLVER_SEND_RECV
15  !C
17  & ( n, neibpetot, neibpe, stack_import, nod_import, &
18  & stack_export, nod_export, &
19  & ws, wr, x, solver_comm,my_rank)
20 
21  use hecmw_util
22  implicit real*8 (a-h,o-z)
23  ! include 'mpif.h'
24  ! include 'hecmw_config_f.h'
25 
26  integer(kind=kint ) , intent(in) :: N
27  integer(kind=kint ) , intent(in) :: NEIBPETOT
28  integer(kind=kint ), pointer :: NEIBPE (:)
29  integer(kind=kint ), pointer :: STACK_IMPORT(:)
30  integer(kind=kint ), pointer :: NOD_IMPORT (:)
31  integer(kind=kint ), pointer :: STACK_EXPORT(:)
32  integer(kind=kint ), pointer :: NOD_EXPORT (:)
33  integer(kind=kint ), dimension(: ), intent(inout):: WS
34  integer(kind=kint ), dimension(: ), intent(inout):: WR
35  integer(kind=kint ), dimension(: ), intent(inout):: X
36  integer(kind=kint ) , intent(in) ::SOLVER_COMM
37  integer(kind=kint ) , intent(in) :: my_rank
38 
39 #ifndef HECMW_SERIAL
40  integer(kind=kint ), dimension(:,:), allocatable :: sta1
41  integer(kind=kint ), dimension(:,:), allocatable :: sta2
42  integer(kind=kint ), dimension(: ), allocatable :: req1
43  integer(kind=kint ), dimension(: ), allocatable :: req2
44 
45  integer(kind=kint ), save :: NFLAG
46  data nflag/0/
47 
48  ! local valiables
49  integer(kind=kint ) :: neib,istart,inum,k,ii,ierr,nreq1,nreq2
50  !C
51  !C-- INIT.
52  allocate (sta1(mpi_status_size,neibpetot))
53  allocate (sta2(mpi_status_size,neibpetot))
54  allocate (req1(neibpetot))
55  allocate (req2(neibpetot))
56 
57  !C
58  !C-- SEND
59  nreq1=0
60  do neib= 1, neibpetot
61  istart= stack_export(neib-1)
62  inum = stack_export(neib ) - istart
63  if (inum==0) cycle
64  nreq1=nreq1+1
65  do k= istart+1, istart+inum
66  ii = 3*nod_export(k)
67  ws(3*k-2)= x(ii-2)
68  ws(3*k-1)= x(ii-1)
69  ws(3*k )= x(ii )
70  enddo
71 
72  call mpi_isend (ws(3*istart+1), 3*inum, mpi_integer, &
73  & neibpe(neib), 0, solver_comm, req1(nreq1), ierr)
74  enddo
75 
76  !C
77  !C-- RECEIVE
78  nreq2=0
79  do neib= 1, neibpetot
80  istart= stack_import(neib-1)
81  inum = stack_import(neib ) - istart
82  if (inum==0) cycle
83  nreq2=nreq2+1
84  call mpi_irecv (wr(3*istart+1), 3*inum, mpi_integer, &
85  & neibpe(neib), 0, solver_comm, req2(nreq2), ierr)
86  enddo
87 
88  call mpi_waitall (nreq2, req2, sta2, ierr)
89 
90  do neib= 1, neibpetot
91  istart= stack_import(neib-1)
92  inum = stack_import(neib ) - istart
93  do k= istart+1, istart+inum
94  ii = 3*nod_import(k)
95  x(ii-2)= wr(3*k-2)
96  x(ii-1)= wr(3*k-1)
97  x(ii )= wr(3*k )
98  enddo
99  enddo
100 
101  call mpi_waitall (nreq1, req1, sta1, ierr)
102  deallocate (sta1, sta2, req1, req2)
103 #endif
104  end subroutine hecmw_solve_send_recv_33i
105 end module hecmw_solver_sr_33i
subroutine hecmw_solve_send_recv_33i(N, NEIBPETOT, NEIBPE, STACK_IMPORT, NOD_IMPORT, STACK_EXPORT, NOD_EXPORT, WS, WR, X, SOLVER_COMM, my_rank)
I/O and Utility.
Definition: hecmw_util_f.F90:7