Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_CECellsClearRequestsData.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
26 ! communicating with the current region adjacent to regions with
27 ! corner or edge cells.
28 !
29 ! Description: none.
30 !
31 ! Input:
32 ! regions = data of all regions
33 ! iReg = index of current region.
34 !
35 ! Output: None.
36 !
37 ! Notes: None.
38 !
39 !******************************************************************************
40 !
41 ! $Id: PLAG_CECellsClearRequestsData.F90,v 1.3 2008/12/06 08:44:32 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2004 by the University of Illinois
44 !
45 !******************************************************************************
46 
47 SUBROUTINE plag_cecellsclearrequestsdata( regions, iReg )
48 
49  USE moddatatypes
50  USE moderror
51  USE modmpi
52  USE modparameters
53  USE modglobal, ONLY : t_global
54  USE moddatastruct, ONLY : t_region, t_level, t_dcelltransf
55 
56  USE modpartlag, ONLY : t_plag
57 
58  IMPLICIT NONE
59 
60 ! ******************************************************************************
61 ! Definitions and declarations
62 ! ******************************************************************************
63 
64 ! ==============================================================================
65 ! Arguments
66 ! ==============================================================================
67 
68  TYPE(t_region), POINTER :: regions(:)
69 
70  INTEGER, INTENT(IN) :: ireg
71 
72 ! ==============================================================================
73 ! Locals
74 ! ==============================================================================
75 
76  CHARACTER(CHRLEN) :: rcsidentstring
77 
78 #ifdef MPI
79  INTEGER :: statusplag(mpi_status_size)
80 #endif
81  INTEGER :: ilev,ir,irequestplag,nbuffsizeplag
82 
83  LOGICAL :: dowait
84 
85  TYPE(t_global), POINTER :: global
86  TYPE(t_level), POINTER :: plevel
87  TYPE(t_plag), POINTER :: pplag
88  TYPE(t_region), POINTER :: pregion
89 
90 ! ******************************************************************************
91 ! Start
92 ! ******************************************************************************
93 
94  rcsidentstring = '$RCSfile: PLAG_CECellsClearRequestsData.F90,v $ $Revision: 1.3 $'
95 
96  global => regions(1)%global
97 
98  CALL registerfunction( global,'PLAG_CECellsClearRequestsData',&
99  'PLAG_CECellsClearRequestsData.F90' )
100 
101 #ifdef MPI
102 
103 ! ******************************************************************************
104 ! Get dimensions
105 ! ******************************************************************************
106 
107  ilev = regions(ireg)%currLevel
108 
109 ! ******************************************************************************
110 ! Set pointers
111 ! ******************************************************************************
112 
113  pregion => regions(ireg)
114  plevel => regions(ireg)%levels(ilev)
115  pplag => plevel%plag
116 
117 ! ******************************************************************************
118 ! Wait for edges & corners being received by other processors
119 ! ******************************************************************************
120 
121  DO ir=1,global%nRegions
122  IF (regions(ireg)%levels(ilev)%sendEcCells(ir)%nCells > 0) THEN
123  irequestplag = plevel%sendEcCells(ir)%iRequestPlag
124  nbuffsizeplag = plevel%sendEcCells(ir)%nBuffSizePlag
125 
126  IF ( (regions(ir)%procid /= global%myProcid) .AND. &
127  (nbuffsizeplag /= 0) ) THEN
128  CALL mpi_wait( pplag%requestsCECellsI(irequestplag), statusplag, global%mpierr )
129  IF (global%mpierr /= err_none) &
130  CALL errorstop( global,err_mpi_trouble,__line__ )
131 
132  CALL mpi_wait( pplag%requestsCECellsR(irequestplag), statusplag, global%mpierr )
133  IF (global%mpierr /= err_none) &
134  CALL errorstop( global,err_mpi_trouble,__line__ )
135 
136  ENDIF ! nBuffSizePlag
137  ENDIF ! nCells
138  ENDDO ! ir
139 #endif
140 
141 ! ******************************************************************************
142 ! Finalize
143 ! ******************************************************************************
144 
145  CALL deregisterfunction( global )
146 
147 END SUBROUTINE plag_cecellsclearrequestsdata
148 
149 !******************************************************************************
150 !
151 ! RCS Revision history:
152 !
153 ! $Log: PLAG_CECellsClearRequestsData.F90,v $
154 ! Revision 1.3 2008/12/06 08:44:32 mtcampbe
155 ! Updated license.
156 !
157 ! Revision 1.2 2008/11/19 22:17:45 mtcampbe
158 ! Added Illinois Open Source License/Copyright
159 !
160 ! Revision 1.1 2004/12/01 20:57:06 fnajjar
161 ! Initial revision after changing case
162 !
163 ! Revision 1.1 2004/03/18 21:43:27 fnajjar
164 ! Initial import for MPI-based data buffer communication
165 !
166 ! Revision 1.1 2004/03/10 23:16:09 fnajjar
167 ! Initial import of routines to MPI-communicate buffer sizes
168 !
169 !******************************************************************************
170 
171 
172 
173 
174 
175 
176 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine plag_cecellsclearrequestsdata(regions, iReg)
subroutine deregisterfunction(global)
Definition: ModError.F90:469