FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_adapt_stack_sr.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 !-------------------------------------------------------------------------------
6 
8 contains
9  !C
10  !C***
11  !C*** hecmw_adapt_STACK_SEND_RECV
12  !C***
13  !C
14  !C exchange IMPORT/EXPORT item NUMBER information
15  !C
16  subroutine hecmw_adapt_stack_send_recv &
17  & ( neibpetot, neibpe, stack_import, stack_export, &
18  & solver_comm,my_rank)
19 
20  use hecmw_util
21  implicit real*8 (a-h,o-z)
22 
23  integer(kind=kint ), intent(in) :: NEIBPETOT
24  integer(kind=kint ), pointer :: NEIBPE (:)
25  integer(kind=kint ), pointer :: STACK_IMPORT(:)
26  integer(kind=kint ), pointer :: STACK_EXPORT(:)
27  integer(kind=kint ) :: SOLVER_COMM, my_rank
28 
29  integer(kind=kint ), dimension(:,:), save, allocatable :: sta1
30  integer(kind=kint ), dimension(:,:), save, allocatable :: sta2
31  integer(kind=kint ), dimension(: ), save, allocatable :: req1
32  integer(kind=kint ), dimension(: ), save, allocatable :: req2
33 
34  integer(kind=kint ), save :: NFLAG
35  data nflag/0/
36 
37  !C
38  !C-- INIT.
39  if (nflag.eq.0) then
40  allocate (sta1(mpi_status_size,neibpetot))
41  allocate (sta2(mpi_status_size,neibpetot))
42  allocate (req1(neibpetot))
43  allocate (req2(neibpetot))
44  nflag= 1
45  endif
46 
47  !C
48  !C-- SEND
49  do neib= 1, neibpetot
50  num= stack_import(neib)
51  call mpi_isend (num, 1, mpi_integer, neibpe(neib), 0, &
52  & solver_comm, req1(neib), ierr)
53  enddo
54 
55  !C
56  !C-- RECEIVE
57  do neib= 1, neibpetot
58  call mpi_irecv (stack_export(neib), 1, mpi_integer, &
59  & neibpe(neib), 0, solver_comm, req2(neib), ierr)
60  enddo
61 
62  call mpi_waitall (neibpetot, req2, sta2, ierr)
63  call mpi_waitall (neibpetot, req1, sta1, ierr)
64 
65  end subroutine hecmw_adapt_stack_send_recv
66 end module hecmw_adapt_stack_sr
67 
68 
69 
hecmw_util
I/O and Utility.
Definition: hecmw_util_f.F90:7
hecmw_adapt_stack_sr::hecmw_adapt_stack_send_recv
subroutine hecmw_adapt_stack_send_recv(NEIBPETOT, NEIBPE, STACK_IMPORT, STACK_EXPORT, SOLVER_COMM, my_rank)
Definition: hecmw_adapt_stack_sr.f90:19
hecmw_adapt_stack_sr
Adaptive Mesh Refinement.
Definition: hecmw_adapt_stack_sr.f90:7