Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_RFLO_ClearSendRequests.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: wait until data is received by other processors communicating
26 ! with the current region.
27 !
28 ! Description: none.
29 !
30 ! Input: regions = all regiona
31 ! iReg = current region
32 !
33 ! Output: none.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PLAG_RFLO_ClearSendRequests.F90,v 1.3 2008/12/06 08:44:34 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2004 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE plag_rflo_clearsendrequests( regions,iReg )
46 
47  USE moddatatypes
48  USE modbndpatch, ONLY : t_patch
49  USE moddatastruct, ONLY : t_region
50  USE modglobal, ONLY : t_global
51  USE modpartlag, ONLY : t_plag
52  USE moderror
53  USE modmpi
54  USE modparameters
55  IMPLICIT NONE
56 
57 ! ... parameters
58  TYPE(t_region), POINTER :: regions(:)
59 
60  INTEGER, INTENT(IN) :: ireg
61 
62 ! ... loop variables
63  INTEGER :: ir
64 
65 ! ... local variables
66  INTEGER :: ilev, iregsrc, irequest
67 #ifdef MPI
68  INTEGER :: status(mpi_status_size)
69 #endif
70 
71  LOGICAL dowait
72 
73  TYPE(t_plag), POINTER :: pplag
74  TYPE(t_global), POINTER :: global
75 
76 !******************************************************************************
77 
78  global => regions(1)%global
79 
80  CALL registerfunction( global,'PLAG_RFLO_ClearSendRequests',&
81  'PLAG_RFLO_ClearSendRequests.F90' )
82 
83 #ifdef MPI
84 
85 ! get dimension & set pointer -------------------------------------------------
86 
87  ilev = 1
88  pplag => regions(ireg)%levels(ilev)%plag
89 
90 ! wait for edges & corners being received by other processors -----------------
91 
92  IF ( global%nProcAlloc>1 ) THEN
93  DO ir=1,global%nRegions
94  IF (regions(ireg)%levels(ilev)%sendEcCells(ir)%nCells > 0) THEN
95  irequest = regions(ireg)%levels(ilev)%sendEcCells(ir)%iRequestMetrics
96  CALL mpi_wait( pplag%requestsMetrics(irequest),status,global%mpierr )
97  IF (global%mpierr /= err_none) &
98  CALL errorstop( global,err_mpi_trouble,__line__ )
99  ENDIF
100  ENDDO
101  ENDIF
102 #endif
103 
104 ! finalize --------------------------------------------------------------------
105 
106  CALL deregisterfunction( global )
107 
108 END SUBROUTINE plag_rflo_clearsendrequests
109 
110 !******************************************************************************
111 !
112 ! RCS Revision history:
113 !
114 ! $Log: PLAG_RFLO_ClearSendRequests.F90,v $
115 ! Revision 1.3 2008/12/06 08:44:34 mtcampbe
116 ! Updated license.
117 !
118 ! Revision 1.2 2008/11/19 22:17:47 mtcampbe
119 ! Added Illinois Open Source License/Copyright
120 !
121 ! Revision 1.1 2004/12/01 20:58:09 fnajjar
122 ! Initial revision after changing case
123 !
124 ! Revision 1.1 2004/01/15 21:16:48 fnajjar
125 ! Initial import for corner-edge cell metrics
126 !
127 !******************************************************************************
128 
129 
130 
131 
132 
133 
134 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine plag_rflo_clearsendrequests(regions, iReg)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469