36 #ifdef __INTEL_COMPILER
40 integer,
intent(in) :: errortype
41 character(len=*),
intent(in),
optional :: errormsg
42 character(len=512) :: text
45 if( .NOT.module_is_initialized )
call abort()
47 select case( errortype )
55 text =
'WARNING: non-existent errortype (must be NOTE|WARNING|FATAL)'
58 if( npes.GT.1 )
write( text,
'(a,i6)' )trim(text)//
' from PE', pe
59 if(
PRESENT(errormsg) )text = trim(text)//
': '//trim(errormsg)
61 select case( errortype )
64 write( out_unit,
'(a)' )trim(text)
65 write( warn_unit,
'(a)' )trim(text)
69 write( errunit,
'(/a/)' )trim(text)
71 write( out_unit,
'(/a/)' )trim(text)
72 write( warn_unit,
'(/a/)' )trim(text)
74 if( errortype.EQ.fatal .OR. warnings_are_fatal )
then
78 #ifdef __INTEL_COMPILER
80 call tracebackqq(user_exit_code=-1)
84 call mpi_abort( mpi_comm_world, 1, error )
88 error_state = errortype
99 function get_peset(pelist)
101 integer,
intent(in),
optional :: pelist(:)
105 if( .NOT.
PRESENT(pelist) )
then
106 get_peset = current_peset_num;
return
110 if (
size(pelist(:)) .GT. 1)
then
111 do n = 2,
size(pelist(:))
112 if(pelist(n) <= pelist(n-1))
call mpp_error(fatal,
"GET_PESET: pelist is not monotonically increasing")
117 if( debug )
write( errunit,* )
'pelist=', pelist
121 if( debug )
write( errunit,
'(a,3i6)' )
'pe, i, peset_num=', pe, i, peset_num
122 if(
size(pelist(:)).EQ.
size(peset(i)%list(:)) )
then
123 if( all(pelist.EQ.peset(i)%list) )
then
124 get_peset = i;
return
129 peset_num = peset_num + 1
133 allocate( peset(i)%list(
size(pelist(:))) )
134 peset(i)%list(:) = pelist(:)
135 peset(i)%count =
size(pelist(:))
137 call mpi_group_incl( peset(current_peset_num)%group,
size(pelist(:)), pelist-mpp_root_pe(), peset(i)%group, error )
138 call mpi_comm_create_group(peset(current_peset_num)%id, peset(i)%group, &
139 default_tag, peset(i)%id, error )
144 end function get_peset
149 integer,
intent(in),
optional :: pelist(:)
150 logical,
intent(in),
optional :: do_self
154 dself=.true.;
if(
PRESENT(do_self))dself=do_self
157 n = get_peset(pelist);
if( peset(n)%count.EQ.1 )
return
159 if( debug .and. (current_clock.NE.0) )
call system_clock(start_tick)
160 call mpi_barrier( peset(n)%id, error )
162 if( debug .and. (current_clock.NE.0) )
call increment_current_clock(event_wait)
172 integer,
intent(in),
optional :: pelist(:)
173 integer,
intent(in),
optional :: check
174 integer,
intent(inout),
optional :: request(:)
175 integer,
intent(in ),
optional :: msg_size(:)
176 integer,
intent(in ),
optional :: msg_type(:)
178 integer :: m, my_check, rsize
180 if( debug .and. (current_clock.NE.0) )
call system_clock(start_tick)
181 my_check = event_send
182 if(
present(check)) my_check = check
183 if( my_check .NE. event_send .AND. my_check .NE. event_recv )
then
184 call mpp_error( fatal,
'mpp_sync_self: The value of optional argument check should be EVENT_SEND or EVENT_RECV')
187 if(
PRESENT(request))
then
188 if( .not.
present(check) )
then
189 call mpp_error(fatal,
'mpp_sync_self: check is not present when request is present')
191 if( my_check == event_recv )
then
192 if( .not.
present(msg_size) )
then
193 call mpp_error(fatal,
'mpp_sync_self: msg_size is not present when request is present and it is EVENT_RECV')
195 if( .not.
present(msg_type) )
then
196 call mpp_error(fatal,
'mpp_sync_self: msg_type is not present when request is present and it is EVENT_RECV')
198 if(
size(msg_size) .NE.
size(request))
then
199 call mpp_error(fatal,
'mpp_sync_self: dimension mismatch between msg_size and request')
201 if(
size(msg_type) .NE.
size(request))
then
202 call mpp_error(fatal,
'mpp_sync_self: dimension mismatch between msg_type and request')
205 do m = 1,
size(request(:))
206 if( request(m) == mpi_request_null ) cycle
207 call mpi_wait(request(m), stat, error )
208 call mpi_get_count(stat, msg_type(m), rsize, error)
209 if(msg_size(m) .NE. rsize)
then
210 call mpp_error(fatal,
"mpp_sync_self: msg_size does not match size of data received")
214 do m = 1,
size(request(:))
215 if(request(m) .NE.mpi_request_null )
call mpi_wait(request(m), stat, error )
219 select case(my_check)
221 do m = 1,cur_send_request
222 if( request_send(m).NE.mpi_request_null )
call mpi_wait( request_send(m), stat, error )
226 do m = 1,cur_recv_request
227 call mpi_wait( request_recv(m), stat, error )
228 call mpi_get_count(stat, type_recv(m), rsize, error)
229 if(size_recv(m) .NE. rsize)
then
230 call mpp_error(fatal,
"mpp_sync_self: size_recv does not match of data received")
237 if( debug .and. (current_clock.NE.0) )
call increment_current_clock(event_wait)
subroutine mpp_sync_self(pelist, check, request, msg_size, msg_type)
This is to check if current PE's outstanding puts are complete but we can't use shmem_fence because w...
subroutine mpp_error_basic(errortype, errormsg)
A very basic error handler uses ABORT and FLUSH calls, may need to use cpp to rename.
integer function stderr()
This function returns the current standard fortran unit numbers for error messages.
subroutine mpp_sync(pelist, do_self)
Synchronize PEs in list.
subroutine expand_peset()
This routine will double the size of peset and copy the original peset data into the expanded one....