30subroutine mpp_init( flags, localcomm, test_level, alt_input_nml_path )
31 integer,
optional,
intent(in) :: flags
32 integer,
optional,
intent(in) :: localcomm
33 integer,
optional,
intent(in) :: test_level
35 character(len=*),
optional,
intent(in) :: alt_input_nml_path
36 integer :: my_pe, num_pes, len, i, logunit
37 logical :: opened, existed
41 if( module_is_initialized )
return
43 module_is_initialized = .true.
44 if(
present(test_level))
then
49 if(t_level == 0)
return
58 allocate( peset(0)%list(1) )
63 current_peset_num = world_peset_num
64 if(t_level == 1)
return
67 call system_clock( count=tick0, count_rate=ticks_per_sec, count_max=max_ticks )
68 tick_rate = 1./ticks_per_sec
69 clock0 = mpp_clock_id(
'Total runtime', flags=mpp_clock_sync )
70 if(t_level == 2)
return
74 datatypes%head => null()
75 datatypes%tail => null()
82 allocate(mpp_byte%sizes(0))
83 allocate(mpp_byte%subsizes(0))
84 allocate(mpp_byte%starts(0))
88 mpp_byte%prev => null()
89 mpp_byte%next => null()
91 if(
PRESENT(flags) )
then
92 debug = flags.EQ.mpp_debug
93 verbose = flags.EQ.mpp_verbose .OR. debug
95 if(t_level == 3)
return
97 call mpp_init_logfile()
98 if (
present(alt_input_nml_path))
then
99 call read_input_nml(alt_input_nml_path=alt_input_nml_path)
103 if(t_level == 4)
return
106 read (input_nml_file, mpp_nml, iostat=io_status)
107 if (io_status > 0)
then
108 call mpp_error(fatal,
'=>mpp_init: Error reading mpp_nml')
110 if(t_level == 5)
return
113 if (trim(etcfile) /=
'/dev/null')
then
114 write( etcfile,
'(a,i6.6)' )trim(etcfile)//
'.', pe
116 inquire(file=etcfile, exist=existed)
118 open( newunit=etc_unit, file=trim(etcfile), status=
'REPLACE' )
120 open( newunit=etc_unit, file=trim(etcfile) )
124 if( verbose )
call mpp_error( note,
'MPP_INIT: initializing MPP module...' )
125 if( pe.EQ.root_pe )
then
127 write( logunit,
'(/a)' )
'MPP module '//trim(version)
128 write( logunit,
'(a,i6)' )
'MPP started with NPES=', npes
129 write( logunit,
'(a)' )
'Using no library for message passing...'
130 write( logunit,
'(a26,es12.4,a6,i10,a11)' ) &
131 'Realtime clock resolution=', tick_rate,
' sec (', ticks_per_sec,
' ticks/sec)'
132 write( logunit,
'(a23,es12.4,a6,i20,a7)' ) &
133 'Clock rolls over after ', max_ticks*tick_rate,
' sec (', max_ticks,
' ticks)'
136 call mpp_clock_begin(clock0)
139end subroutine mpp_init
144 integer :: i, j, k, n, nmax, istat, out_unit
145 real :: t, tmin, tmax, tavg, tstd
146 real :: m, mmin, mmax, mavg, mstd, t_total
149 if( .NOT.module_is_initialized )
return
150 call mpp_set_current_pelist()
151 call mpp_clock_end(clock0)
152 t_total = clocks(clock0)%total_ticks*tick_rate
154 if( clock_num.GT.0 )
then
155 if( any(clocks(1:clock_num)%detailed) )
then
156 call sum_clock_data;
call dump_clock_summary
158 if( pe.EQ.root_pe )
then
159 write( out_unit,
'(/a,i6,a)' )
'Tabulating mpp_clock statistics across ', npes,
' PEs...'
160 if( any(clocks(1:clock_num)%detailed) ) &
161 write( out_unit,
'(a)' )
' ... see mpp_clock.out.#### for details on individual PEs.'
162 write( out_unit,
'(/32x,a)' ) &
163 &
' hits tmin tmax tavg tstd tfrac grain pemin pemax'
165 write( out_unit,
'(/37x,a)' )
'time'
167 call flush( out_unit )
170 if( .NOT.any(peset(clocks(i)%peset_num)%list(:).EQ.pe) )cycle
171 call mpp_set_current_pelist( peset(clocks(i)%peset_num)%list )
173 t = clocks(i)%total_ticks*tick_rate
174 tmin = t;
call mpp_min(tmin)
175 tmax = t;
call mpp_max(tmax)
176 tavg = t;
call mpp_sum(tavg); tavg = tavg/mpp_npes()
177 tstd = (t-tavg)**2;
call mpp_sum(tstd); tstd = sqrt( tstd/mpp_npes() )
178 if( pe.EQ.root_pe )
write( out_unit,
'(a32,i10,4f14.6,f7.3,3i6)' ) &
179 clocks(i)%name, clocks(i)%hits, tmin, tmax, tavg, tstd, tavg/t_total, &
180 clocks(i)%grain, minval(peset(clocks(i)%peset_num)%list), &
181 maxval(peset(clocks(i)%peset_num)%list)
182 if (pe.NE.root_pe)
write(out_unit,
'(a32,f14.6)') clocks(i)%name, clocks(i)%total_ticks*tick_rate
184 if( any(clocks(1:clock_num)%detailed) .AND. pe.EQ.root_pe )
write( out_unit,
'(/32x,a)' ) &
185 ' tmin tmax tavg tstd mmin mmax mavg mstd mavg/tavg'
189 if( .NOT.clocks(i)%detailed )cycle
190 do j = 1,max_event_types
191 n = clocks(i)%events(j)%calls; nmax = n
196 if( n.GT.0 )m = sum(clocks(i)%events(j)%bytes(1:n))
197 mmin = m;
call mpp_min(mmin)
198 mmax = m;
call mpp_max(mmax)
199 mavg = m;
call mpp_sum(mavg); mavg = mavg/mpp_npes()
200 mstd = (m-mavg)**2;
call mpp_sum(mstd); mstd = sqrt( mstd/mpp_npes() )
202 if( n.GT.0 )t = sum(clocks(i)%events(j)%ticks(1:n))*tick_rate
203 tmin = t;
call mpp_min(tmin)
204 tmax = t;
call mpp_max(tmax)
205 tavg = t;
call mpp_sum(tavg); tavg = tavg/mpp_npes()
206 tstd = (t-tavg)**2;
call mpp_sum(tstd); tstd = sqrt( tstd/mpp_npes() )
207 if( pe.EQ.root_pe )
write( out_unit,
'(a32,4f11.3,5es11.3)' ) &
208 trim(clocks(i)%name)//
' '//trim(clocks(i)%events(j)%name), &
209 tmin, tmax, tavg, tstd, mmin, mmax, mavg, mstd, mavg/tavg
215 inquire(unit=etc_unit, opened=opened)
217 call flush (etc_unit)
221 call mpp_set_current_pelist()
223 call mpp_max(mpp_stack_hwm)
224 if( pe.EQ.root_pe )
write( out_unit,* )
'MPP_STACK high water mark=', mpp_stack_hwm
227end subroutine mpp_exit
231 subroutine mpp_set_stack_size(n)
232 integer,
intent(in) :: n
233 character(len=8) :: text
235 if( n.GT.mpp_stack_size .AND.
allocated(mpp_stack) )
deallocate(mpp_stack)
236 if( .NOT.
allocated(mpp_stack) )
then
237 allocate( mpp_stack(n) )
241 write( text,
'(i8)' )n
242 if( pe.EQ.root_pe )
call mpp_error( note,
'MPP_SET_STACK_SIZE: stack size set to '//text//
'.' )
245 end subroutine mpp_set_stack_size
247 subroutine mpp_broadcast_char(char_data, length, from_pe, pelist )
248 character(len=*),
intent(inout) :: char_data(:)
249 integer,
intent(in) :: length, from_pe
250 integer,
intent(in),
optional :: pelist(:)
252 if( .NOT.module_is_initialized )
call mpp_error( fatal,
'mpp_broadcast_text: You must first call mpp_init.' )
254 end subroutine mpp_broadcast_char
264#define MPP_TYPE_INIT_VALUE 0.
267#define MPP_TRANSMIT_ mpp_transmit_real8
268#undef MPP_TRANSMIT_SCALAR_
269#define MPP_TRANSMIT_SCALAR_ mpp_transmit_real8_scalar
270#undef MPP_TRANSMIT_2D_
271#define MPP_TRANSMIT_2D_ mpp_transmit_real8_2d
272#undef MPP_TRANSMIT_3D_
273#define MPP_TRANSMIT_3D_ mpp_transmit_real8_3d
274#undef MPP_TRANSMIT_4D_
275#define MPP_TRANSMIT_4D_ mpp_transmit_real8_4d
276#undef MPP_TRANSMIT_5D_
277#define MPP_TRANSMIT_5D_ mpp_transmit_real8_5d
279#define MPP_RECV_ mpp_recv_real8
280#undef MPP_RECV_SCALAR_
281#define MPP_RECV_SCALAR_ mpp_recv_real8_scalar
283#define MPP_RECV_2D_ mpp_recv_real8_2d
285#define MPP_RECV_3D_ mpp_recv_real8_3d
287#define MPP_RECV_4D_ mpp_recv_real8_4d
289#define MPP_RECV_5D_ mpp_recv_real8_5d
291#define MPP_SEND_ mpp_send_real8
292#undef MPP_SEND_SCALAR_
293#define MPP_SEND_SCALAR_ mpp_send_real8_scalar
295#define MPP_SEND_2D_ mpp_send_real8_2d
297#define MPP_SEND_3D_ mpp_send_real8_3d
299#define MPP_SEND_4D_ mpp_send_real8_4d
301#define MPP_SEND_5D_ mpp_send_real8_5d
303#define MPP_BROADCAST_ mpp_broadcast_real8
304#undef MPP_BROADCAST_SCALAR_
305#define MPP_BROADCAST_SCALAR_ mpp_broadcast_real8_scalar
306#undef MPP_BROADCAST_2D_
307#define MPP_BROADCAST_2D_ mpp_broadcast_real8_2d
308#undef MPP_BROADCAST_3D_
309#define MPP_BROADCAST_3D_ mpp_broadcast_real8_3d
310#undef MPP_BROADCAST_4D_
311#define MPP_BROADCAST_4D_ mpp_broadcast_real8_4d
312#undef MPP_BROADCAST_5D_
313#define MPP_BROADCAST_5D_ mpp_broadcast_real8_5d
315#define MPP_TYPE_ real(r8_kind)
316#undef MPP_TYPE_BYTELEN_
317#define MPP_TYPE_BYTELEN_ 8
319#define MPI_TYPE_ MPI_REAL8
320#include <mpp_transmit_nocomm.fh>
324#define MPP_TRANSMIT_ mpp_transmit_cmplx8
325#undef MPP_TRANSMIT_SCALAR_
326#define MPP_TRANSMIT_SCALAR_ mpp_transmit_cmplx8_scalar
327#undef MPP_TRANSMIT_2D_
328#define MPP_TRANSMIT_2D_ mpp_transmit_cmplx8_2d
329#undef MPP_TRANSMIT_3D_
330#define MPP_TRANSMIT_3D_ mpp_transmit_cmplx8_3d
331#undef MPP_TRANSMIT_4D_
332#define MPP_TRANSMIT_4D_ mpp_transmit_cmplx8_4d
333#undef MPP_TRANSMIT_5D_
334#define MPP_TRANSMIT_5D_ mpp_transmit_cmplx8_5d
336#define MPP_RECV_ mpp_recv_cmplx8
337#undef MPP_RECV_SCALAR_
338#define MPP_RECV_SCALAR_ mpp_recv_cmplx8_scalar
340#define MPP_RECV_2D_ mpp_recv_cmplx8_2d
342#define MPP_RECV_3D_ mpp_recv_cmplx8_3d
344#define MPP_RECV_4D_ mpp_recv_cmplx8_4d
346#define MPP_RECV_5D_ mpp_recv_cmplx8_5d
348#define MPP_SEND_ mpp_send_cmplx8
349#undef MPP_SEND_SCALAR_
350#define MPP_SEND_SCALAR_ mpp_send_cmplx8_scalar
352#define MPP_SEND_2D_ mpp_send_cmplx8_2d
354#define MPP_SEND_3D_ mpp_send_cmplx8_3d
356#define MPP_SEND_4D_ mpp_send_cmplx8_4d
358#define MPP_SEND_5D_ mpp_send_cmplx8_5d
360#define MPP_BROADCAST_ mpp_broadcast_cmplx8
361#undef MPP_BROADCAST_SCALAR_
362#define MPP_BROADCAST_SCALAR_ mpp_broadcast_cmplx8_scalar
363#undef MPP_BROADCAST_2D_
364#define MPP_BROADCAST_2D_ mpp_broadcast_cmplx8_2d
365#undef MPP_BROADCAST_3D_
366#define MPP_BROADCAST_3D_ mpp_broadcast_cmplx8_3d
367#undef MPP_BROADCAST_4D_
368#define MPP_BROADCAST_4D_ mpp_broadcast_cmplx8_4d
369#undef MPP_BROADCAST_5D_
370#define MPP_BROADCAST_5D_ mpp_broadcast_cmplx8_5d
372#define MPP_TYPE_ complex(c8_kind)
373#undef MPP_TYPE_BYTELEN_
374#define MPP_TYPE_BYTELEN_ 16
376#define MPI_TYPE_ MPI_DOUBLE_COMPLEX
377#include <mpp_transmit_nocomm.fh>
381#define MPP_TRANSMIT_ mpp_transmit_real4
382#undef MPP_TRANSMIT_SCALAR_
383#define MPP_TRANSMIT_SCALAR_ mpp_transmit_real4_scalar
384#undef MPP_TRANSMIT_2D_
385#define MPP_TRANSMIT_2D_ mpp_transmit_real4_2d
386#undef MPP_TRANSMIT_3D_
387#define MPP_TRANSMIT_3D_ mpp_transmit_real4_3d
388#undef MPP_TRANSMIT_4D_
389#define MPP_TRANSMIT_4D_ mpp_transmit_real4_4d
390#undef MPP_TRANSMIT_5D_
391#define MPP_TRANSMIT_5D_ mpp_transmit_real4_5d
393#define MPP_RECV_ mpp_recv_real4
394#undef MPP_RECV_SCALAR_
395#define MPP_RECV_SCALAR_ mpp_recv_real4_scalar
397#define MPP_RECV_2D_ mpp_recv_real4_2d
399#define MPP_RECV_3D_ mpp_recv_real4_3d
401#define MPP_RECV_4D_ mpp_recv_real4_4d
403#define MPP_RECV_5D_ mpp_recv_real4_5d
405#define MPP_SEND_ mpp_send_real4
406#undef MPP_SEND_SCALAR_
407#define MPP_SEND_SCALAR_ mpp_send_real4_scalar
409#define MPP_SEND_2D_ mpp_send_real4_2d
411#define MPP_SEND_3D_ mpp_send_real4_3d
413#define MPP_SEND_4D_ mpp_send_real4_4d
415#define MPP_SEND_5D_ mpp_send_real4_5d
417#define MPP_BROADCAST_ mpp_broadcast_real4
418#undef MPP_BROADCAST_SCALAR_
419#define MPP_BROADCAST_SCALAR_ mpp_broadcast_real4_scalar
420#undef MPP_BROADCAST_2D_
421#define MPP_BROADCAST_2D_ mpp_broadcast_real4_2d
422#undef MPP_BROADCAST_3D_
423#define MPP_BROADCAST_3D_ mpp_broadcast_real4_3d
424#undef MPP_BROADCAST_4D_
425#define MPP_BROADCAST_4D_ mpp_broadcast_real4_4d
426#undef MPP_BROADCAST_5D_
427#define MPP_BROADCAST_5D_ mpp_broadcast_real4_5d
429#define MPP_TYPE_ real(r4_kind)
430#undef MPP_TYPE_BYTELEN_
431#define MPP_TYPE_BYTELEN_ 4
433#define MPI_TYPE_ MPI_REAL4
434#include <mpp_transmit_nocomm.fh>
438#define MPP_TRANSMIT_ mpp_transmit_cmplx4
439#undef MPP_TRANSMIT_SCALAR_
440#define MPP_TRANSMIT_SCALAR_ mpp_transmit_cmplx4_scalar
441#undef MPP_TRANSMIT_2D_
442#define MPP_TRANSMIT_2D_ mpp_transmit_cmplx4_2d
443#undef MPP_TRANSMIT_3D_
444#define MPP_TRANSMIT_3D_ mpp_transmit_cmplx4_3d
445#undef MPP_TRANSMIT_4D_
446#define MPP_TRANSMIT_4D_ mpp_transmit_cmplx4_4d
447#undef MPP_TRANSMIT_5D_
448#define MPP_TRANSMIT_5D_ mpp_transmit_cmplx4_5d
450#define MPP_RECV_ mpp_recv_cmplx4
451#undef MPP_RECV_SCALAR_
452#define MPP_RECV_SCALAR_ mpp_recv_cmplx4_scalar
454#define MPP_RECV_2D_ mpp_recv_cmplx4_2d
456#define MPP_RECV_3D_ mpp_recv_cmplx4_3d
458#define MPP_RECV_4D_ mpp_recv_cmplx4_4d
460#define MPP_RECV_5D_ mpp_recv_cmplx4_5d
462#define MPP_SEND_ mpp_send_cmplx4
463#undef MPP_SEND_SCALAR_
464#define MPP_SEND_SCALAR_ mpp_send_cmplx4_scalar
466#define MPP_SEND_2D_ mpp_send_cmplx4_2d
468#define MPP_SEND_3D_ mpp_send_cmplx4_3d
470#define MPP_SEND_4D_ mpp_send_cmplx4_4d
472#define MPP_SEND_5D_ mpp_send_cmplx4_5d
474#define MPP_BROADCAST_ mpp_broadcast_cmplx4
475#undef MPP_BROADCAST_SCALAR_
476#define MPP_BROADCAST_SCALAR_ mpp_broadcast_cmplx4_scalar
477#undef MPP_BROADCAST_2D_
478#define MPP_BROADCAST_2D_ mpp_broadcast_cmplx4_2d
479#undef MPP_BROADCAST_3D_
480#define MPP_BROADCAST_3D_ mpp_broadcast_cmplx4_3d
481#undef MPP_BROADCAST_4D_
482#define MPP_BROADCAST_4D_ mpp_broadcast_cmplx4_4d
483#undef MPP_BROADCAST_5D_
484#define MPP_BROADCAST_5D_ mpp_broadcast_cmplx4_5d
486#define MPP_TYPE_ complex(c4_kind)
487#undef MPP_TYPE_BYTELEN_
488#define MPP_TYPE_BYTELEN_ 8
490#define MPI_TYPE_ MPI_COMPLEX
491#include <mpp_transmit_nocomm.fh>
494#undef MPP_TYPE_INIT_VALUE
495#define MPP_TYPE_INIT_VALUE 0
497#define MPP_TRANSMIT_ mpp_transmit_int8
498#undef MPP_TRANSMIT_SCALAR_
499#define MPP_TRANSMIT_SCALAR_ mpp_transmit_int8_scalar
500#undef MPP_TRANSMIT_2D_
501#define MPP_TRANSMIT_2D_ mpp_transmit_int8_2d
502#undef MPP_TRANSMIT_3D_
503#define MPP_TRANSMIT_3D_ mpp_transmit_int8_3d
504#undef MPP_TRANSMIT_4D_
505#define MPP_TRANSMIT_4D_ mpp_transmit_int8_4d
506#undef MPP_TRANSMIT_5D_
507#define MPP_TRANSMIT_5D_ mpp_transmit_int8_5d
509#define MPP_RECV_ mpp_recv_int8
510#undef MPP_RECV_SCALAR_
511#define MPP_RECV_SCALAR_ mpp_recv_int8_scalar
513#define MPP_RECV_2D_ mpp_recv_int8_2d
515#define MPP_RECV_3D_ mpp_recv_int8_3d
517#define MPP_RECV_4D_ mpp_recv_int8_4d
519#define MPP_RECV_5D_ mpp_recv_int8_5d
521#define MPP_SEND_ mpp_send_int8
522#undef MPP_SEND_SCALAR_
523#define MPP_SEND_SCALAR_ mpp_send_int8_scalar
525#define MPP_SEND_2D_ mpp_send_int8_2d
527#define MPP_SEND_3D_ mpp_send_int8_3d
529#define MPP_SEND_4D_ mpp_send_int8_4d
531#define MPP_SEND_5D_ mpp_send_int8_5d
533#define MPP_BROADCAST_ mpp_broadcast_int8
534#undef MPP_BROADCAST_SCALAR_
535#define MPP_BROADCAST_SCALAR_ mpp_broadcast_int8_scalar
536#undef MPP_BROADCAST_2D_
537#define MPP_BROADCAST_2D_ mpp_broadcast_int8_2d
538#undef MPP_BROADCAST_3D_
539#define MPP_BROADCAST_3D_ mpp_broadcast_int8_3d
540#undef MPP_BROADCAST_4D_
541#define MPP_BROADCAST_4D_ mpp_broadcast_int8_4d
542#undef MPP_BROADCAST_5D_
543#define MPP_BROADCAST_5D_ mpp_broadcast_int8_5d
545#define MPP_TYPE_ integer(i8_kind)
546#undef MPP_TYPE_BYTELEN_
547#define MPP_TYPE_BYTELEN_ 8
549#define MPI_TYPE_ MPI_INTEGER8
550#include <mpp_transmit_nocomm.fh>
553#define MPP_TRANSMIT_ mpp_transmit_int4
554#undef MPP_TRANSMIT_SCALAR_
555#define MPP_TRANSMIT_SCALAR_ mpp_transmit_int4_scalar
556#undef MPP_TRANSMIT_2D_
557#define MPP_TRANSMIT_2D_ mpp_transmit_int4_2d
558#undef MPP_TRANSMIT_3D_
559#define MPP_TRANSMIT_3D_ mpp_transmit_int4_3d
560#undef MPP_TRANSMIT_4D_
561#define MPP_TRANSMIT_4D_ mpp_transmit_int4_4d
562#undef MPP_TRANSMIT_5D_
563#define MPP_TRANSMIT_5D_ mpp_transmit_int4_5d
565#define MPP_RECV_ mpp_recv_int4
566#undef MPP_RECV_SCALAR_
567#define MPP_RECV_SCALAR_ mpp_recv_int4_scalar
569#define MPP_RECV_2D_ mpp_recv_int4_2d
571#define MPP_RECV_3D_ mpp_recv_int4_3d
573#define MPP_RECV_4D_ mpp_recv_int4_4d
575#define MPP_RECV_5D_ mpp_recv_int4_5d
577#define MPP_SEND_ mpp_send_int4
578#undef MPP_SEND_SCALAR_
579#define MPP_SEND_SCALAR_ mpp_send_int4_scalar
581#define MPP_SEND_2D_ mpp_send_int4_2d
583#define MPP_SEND_3D_ mpp_send_int4_3d
585#define MPP_SEND_4D_ mpp_send_int4_4d
587#define MPP_SEND_5D_ mpp_send_int4_5d
589#define MPP_BROADCAST_ mpp_broadcast_int4
590#undef MPP_BROADCAST_SCALAR_
591#define MPP_BROADCAST_SCALAR_ mpp_broadcast_int4_scalar
592#undef MPP_BROADCAST_2D_
593#define MPP_BROADCAST_2D_ mpp_broadcast_int4_2d
594#undef MPP_BROADCAST_3D_
595#define MPP_BROADCAST_3D_ mpp_broadcast_int4_3d
596#undef MPP_BROADCAST_4D_
597#define MPP_BROADCAST_4D_ mpp_broadcast_int4_4d
598#undef MPP_BROADCAST_5D_
599#define MPP_BROADCAST_5D_ mpp_broadcast_int4_5d
601#define MPP_TYPE_ integer(i4_kind)
602#undef MPP_TYPE_BYTELEN_
603#define MPP_TYPE_BYTELEN_ 4
605#define MPI_TYPE_ MPI_INTEGER4
606#include <mpp_transmit_nocomm.fh>
608#undef MPP_TYPE_INIT_VALUE
609#define MPP_TYPE_INIT_VALUE .false.
611#define MPP_TRANSMIT_ mpp_transmit_logical8
612#undef MPP_TRANSMIT_SCALAR_
613#define MPP_TRANSMIT_SCALAR_ mpp_transmit_logical8_scalar
614#undef MPP_TRANSMIT_2D_
615#define MPP_TRANSMIT_2D_ mpp_transmit_logical8_2d
616#undef MPP_TRANSMIT_3D_
617#define MPP_TRANSMIT_3D_ mpp_transmit_logical8_3d
618#undef MPP_TRANSMIT_4D_
619#define MPP_TRANSMIT_4D_ mpp_transmit_logical8_4d
620#undef MPP_TRANSMIT_5D_
621#define MPP_TRANSMIT_5D_ mpp_transmit_logical8_5d
623#define MPP_RECV_ mpp_recv_logical8
624#undef MPP_RECV_SCALAR_
625#define MPP_RECV_SCALAR_ mpp_recv_logical8_scalar
627#define MPP_RECV_2D_ mpp_recv_logical8_2d
629#define MPP_RECV_3D_ mpp_recv_logical8_3d
631#define MPP_RECV_4D_ mpp_recv_logical8_4d
633#define MPP_RECV_5D_ mpp_recv_logical8_5d
635#define MPP_SEND_ mpp_send_logical8
636#undef MPP_SEND_SCALAR_
637#define MPP_SEND_SCALAR_ mpp_send_logical8_scalar
639#define MPP_SEND_2D_ mpp_send_logical8_2d
641#define MPP_SEND_3D_ mpp_send_logical8_3d
643#define MPP_SEND_4D_ mpp_send_logical8_4d
645#define MPP_SEND_5D_ mpp_send_logical8_5d
647#define MPP_BROADCAST_ mpp_broadcast_logical8
648#undef MPP_BROADCAST_SCALAR_
649#define MPP_BROADCAST_SCALAR_ mpp_broadcast_logical8_scalar
650#undef MPP_BROADCAST_2D_
651#define MPP_BROADCAST_2D_ mpp_broadcast_logical8_2d
652#undef MPP_BROADCAST_3D_
653#define MPP_BROADCAST_3D_ mpp_broadcast_logical8_3d
654#undef MPP_BROADCAST_4D_
655#define MPP_BROADCAST_4D_ mpp_broadcast_logical8_4d
656#undef MPP_BROADCAST_5D_
657#define MPP_BROADCAST_5D_ mpp_broadcast_logical8_5d
659#define MPP_TYPE_ logical(l8_kind)
660#undef MPP_TYPE_BYTELEN_
661#define MPP_TYPE_BYTELEN_ 8
663#define MPI_TYPE_ MPI_INTEGER8
664#include <mpp_transmit_nocomm.fh>
667#define MPP_TRANSMIT_ mpp_transmit_logical4
668#undef MPP_TRANSMIT_SCALAR_
669#define MPP_TRANSMIT_SCALAR_ mpp_transmit_logical4_scalar
670#undef MPP_TRANSMIT_2D_
671#define MPP_TRANSMIT_2D_ mpp_transmit_logical4_2d
672#undef MPP_TRANSMIT_3D_
673#define MPP_TRANSMIT_3D_ mpp_transmit_logical4_3d
674#undef MPP_TRANSMIT_4D_
675#define MPP_TRANSMIT_4D_ mpp_transmit_logical4_4d
676#undef MPP_TRANSMIT_5D_
677#define MPP_TRANSMIT_5D_ mpp_transmit_logical4_5d
679#define MPP_RECV_ mpp_recv_logical4
680#undef MPP_RECV_SCALAR_
681#define MPP_RECV_SCALAR_ mpp_recv_logical4_scalar
683#define MPP_RECV_2D_ mpp_recv_logical4_2d
685#define MPP_RECV_3D_ mpp_recv_logical4_3d
687#define MPP_RECV_4D_ mpp_recv_logical4_4d
689#define MPP_RECV_5D_ mpp_recv_logical4_5d
691#define MPP_SEND_ mpp_send_logical4
692#undef MPP_SEND_SCALAR_
693#define MPP_SEND_SCALAR_ mpp_send_logical4_scalar
695#define MPP_SEND_2D_ mpp_send_logical4_2d
697#define MPP_SEND_3D_ mpp_send_logical4_3d
699#define MPP_SEND_4D_ mpp_send_logical4_4d
701#define MPP_SEND_5D_ mpp_send_logical4_5d
703#define MPP_BROADCAST_ mpp_broadcast_logical4
704#undef MPP_BROADCAST_SCALAR_
705#define MPP_BROADCAST_SCALAR_ mpp_broadcast_logical4_scalar
706#undef MPP_BROADCAST_2D_
707#define MPP_BROADCAST_2D_ mpp_broadcast_logical4_2d
708#undef MPP_BROADCAST_3D_
709#define MPP_BROADCAST_3D_ mpp_broadcast_logical4_3d
710#undef MPP_BROADCAST_4D_
711#define MPP_BROADCAST_4D_ mpp_broadcast_logical4_4d
712#undef MPP_BROADCAST_5D_
713#define MPP_BROADCAST_5D_ mpp_broadcast_logical4_5d
715#define MPP_TYPE_ logical(l4_kind)
716#undef MPP_TYPE_BYTELEN_
717#define MPP_TYPE_BYTELEN_ 4
719#define MPI_TYPE_ MPI_INTEGER4
720#include <mpp_transmit_nocomm.fh>
721#undef MPP_TYPE_INIT_VALUE
729#define MPP_REDUCE_0D_ mpp_max_real8_0d
731#define MPP_REDUCE_1D_ mpp_max_real8_1d
733#define MPP_TYPE_ real(r8_kind)
734#undef MPP_TYPE_BYTELEN_
735#define MPP_TYPE_BYTELEN_ 8
737#define MPI_TYPE_ MPI_REAL8
739#define MPI_REDUCE_ MPI_MAX
740#include <mpp_reduce_nocomm.fh>
743#define MPP_REDUCE_0D_ mpp_max_real4_0d
745#define MPP_REDUCE_1D_ mpp_max_real4_1d
747#define MPP_TYPE_ real(r4_kind)
748#undef MPP_TYPE_BYTELEN_
749#define MPP_TYPE_BYTELEN_ 4
751#define MPI_TYPE_ MPI_REAL4
753#define MPI_REDUCE_ MPI_MAX
754#include <mpp_reduce_nocomm.fh>
757#define MPP_REDUCE_0D_ mpp_max_int8_0d
759#define MPP_REDUCE_1D_ mpp_max_int8_1d
761#define MPP_TYPE_ integer(i8_kind)
762#undef MPP_TYPE_BYTELEN_
763#define MPP_TYPE_BYTELEN_ 8
765#define MPI_TYPE_ MPI_INTEGER8
767#define MPI_REDUCE_ MPI_MAX
768#include <mpp_reduce_nocomm.fh>
771#define MPP_REDUCE_0D_ mpp_max_int4_0d
773#define MPP_REDUCE_1D_ mpp_max_int4_1d
775#define MPP_TYPE_ integer(i4_kind)
776#undef MPP_TYPE_BYTELEN_
777#define MPP_TYPE_BYTELEN_ 4
779#define MPI_TYPE_ MPI_INTEGER4
781#define MPI_REDUCE_ MPI_MAX
782#include <mpp_reduce_nocomm.fh>
785#define MPP_REDUCE_0D_ mpp_min_real8_0d
787#define MPP_REDUCE_1D_ mpp_min_real8_1d
789#define MPP_TYPE_ real(r8_kind)
790#undef MPP_TYPE_BYTELEN_
791#define MPP_TYPE_BYTELEN_ 8
793#define MPI_TYPE_ MPI_REAL8
795#define MPI_REDUCE_ MPI_MIN
796#include <mpp_reduce_nocomm.fh>
799#define MPP_REDUCE_0D_ mpp_min_real4_0d
801#define MPP_REDUCE_1D_ mpp_min_real4_1d
803#define MPP_TYPE_ real(r4_kind)
804#undef MPP_TYPE_BYTELEN_
805#define MPP_TYPE_BYTELEN_ 4
807#define MPI_TYPE_ MPI_REAL4
809#define MPI_REDUCE_ MPI_MIN
810#include <mpp_reduce_nocomm.fh>
813#define MPP_REDUCE_0D_ mpp_min_int8_0d
815#define MPP_REDUCE_1D_ mpp_min_int8_1d
817#define MPP_TYPE_ integer(i8_kind)
818#undef MPP_TYPE_BYTELEN_
819#define MPP_TYPE_BYTELEN_ 8
821#define MPI_TYPE_ MPI_INTEGER8
823#define MPI_REDUCE_ MPI_MIN
824#include <mpp_reduce_nocomm.fh>
827#define MPP_REDUCE_0D_ mpp_min_int4_0d
829#define MPP_REDUCE_1D_ mpp_min_int4_1d
831#define MPP_TYPE_ integer(i4_kind)
832#undef MPP_TYPE_BYTELEN_
833#define MPP_TYPE_BYTELEN_ 4
835#define MPI_TYPE_ MPI_INTEGER4
837#define MPI_REDUCE_ MPI_MIN
838#include <mpp_reduce_nocomm.fh>
841#define MPP_SUM_ mpp_sum_real8
842#undef MPP_SUM_SCALAR_
843#define MPP_SUM_SCALAR_ mpp_sum_real8_scalar
845#define MPP_SUM_2D_ mpp_sum_real8_2d
847#define MPP_SUM_3D_ mpp_sum_real8_3d
849#define MPP_SUM_4D_ mpp_sum_real8_4d
851#define MPP_SUM_5D_ mpp_sum_real8_5d
853#define MPP_TYPE_ real(r8_kind)
855#define MPI_TYPE_ MPI_REAL8
856#undef MPP_TYPE_BYTELEN_
857#define MPP_TYPE_BYTELEN_ 8
858#include <mpp_sum_nocomm.fh>
862#define MPP_SUM_ mpp_sum_cmplx8
863#undef MPP_SUM_SCALAR_
864#define MPP_SUM_SCALAR_ mpp_sum_cmplx8_scalar
866#define MPP_SUM_2D_ mpp_sum_cmplx8_2d
868#define MPP_SUM_3D_ mpp_sum_cmplx8_3d
870#define MPP_SUM_4D_ mpp_sum_cmplx8_4d
872#define MPP_SUM_5D_ mpp_sum_cmplx8_5d
874#define MPP_TYPE_ complex(c8_kind)
876#define MPI_TYPE_ MPI_DOUBLE_COMPLEX
877#undef MPP_TYPE_BYTELEN_
878#define MPP_TYPE_BYTELEN_ 16
879#include <mpp_sum_nocomm.fh>
883#define MPP_SUM_ mpp_sum_real4
884#undef MPP_SUM_SCALAR_
885#define MPP_SUM_SCALAR_ mpp_sum_real4_scalar
887#define MPP_SUM_2D_ mpp_sum_real4_2d
889#define MPP_SUM_3D_ mpp_sum_real4_3d
891#define MPP_SUM_4D_ mpp_sum_real4_4d
893#define MPP_SUM_5D_ mpp_sum_real4_5d
895#define MPP_TYPE_ real(r4_kind)
897#define MPI_TYPE_ MPI_REAL4
898#undef MPP_TYPE_BYTELEN_
899#define MPP_TYPE_BYTELEN_ 4
900#include <mpp_sum_nocomm.fh>
904#define MPP_SUM_ mpp_sum_cmplx4
905#undef MPP_SUM_SCALAR_
906#define MPP_SUM_SCALAR_ mpp_sum_cmplx4_scalar
908#define MPP_SUM_2D_ mpp_sum_cmplx4_2d
910#define MPP_SUM_3D_ mpp_sum_cmplx4_3d
912#define MPP_SUM_4D_ mpp_sum_cmplx4_4d
914#define MPP_SUM_5D_ mpp_sum_cmplx4_5d
916#define MPP_TYPE_ complex(c4_kind)
918#define MPI_TYPE_ MPI_COMPLEX
919#undef MPP_TYPE_BYTELEN_
920#define MPP_TYPE_BYTELEN_ 8
921#include <mpp_sum_nocomm.fh>
925#define MPP_SUM_ mpp_sum_int8
926#undef MPP_SUM_SCALAR_
927#define MPP_SUM_SCALAR_ mpp_sum_int8_scalar
929#define MPP_SUM_2D_ mpp_sum_int8_2d
931#define MPP_SUM_3D_ mpp_sum_int8_3d
933#define MPP_SUM_4D_ mpp_sum_int8_4d
935#define MPP_SUM_5D_ mpp_sum_int8_5d
937#define MPP_TYPE_ integer(i8_kind)
939#define MPI_TYPE_ MPI_INTEGER8
940#undef MPP_TYPE_BYTELEN_
941#define MPP_TYPE_BYTELEN_ 8
942#include <mpp_sum_nocomm.fh>
945#define MPP_SUM_ mpp_sum_int4
946#undef MPP_SUM_SCALAR_
947#define MPP_SUM_SCALAR_ mpp_sum_int4_scalar
949#define MPP_SUM_2D_ mpp_sum_int4_2d
951#define MPP_SUM_3D_ mpp_sum_int4_3d
953#define MPP_SUM_4D_ mpp_sum_int4_4d
955#define MPP_SUM_5D_ mpp_sum_int4_5d
957#define MPP_TYPE_ integer(i4_kind)
959#define MPI_TYPE_ MPI_INTEGER4
960#undef MPP_TYPE_BYTELEN_
961#define MPP_TYPE_BYTELEN_ 4
962#include <mpp_sum_nocomm.fh>
965#define MPP_SUM_AD_ mpp_sum_real8_ad
966#undef MPP_SUM_SCALAR_AD_
967#define MPP_SUM_SCALAR_AD_ mpp_sum_real8_scalar_ad
969#define MPP_SUM_2D_AD_ mpp_sum_real8_2d_ad
971#define MPP_SUM_3D_AD_ mpp_sum_real8_3d_ad
973#define MPP_SUM_4D_AD_ mpp_sum_real8_4d_ad
975#define MPP_SUM_5D_AD_ mpp_sum_real8_5d_ad
977#define MPP_TYPE_ real(r8_kind)
979#define MPI_TYPE_ MPI_REAL8
980#undef MPP_TYPE_BYTELEN_
981#define MPP_TYPE_BYTELEN_ 8
982#include <mpp_sum_nocomm_ad.fh>
986#define MPP_SUM_AD_ mpp_sum_cmplx8_ad
987#undef MPP_SUM_SCALAR_AD_
988#define MPP_SUM_SCALAR_AD_ mpp_sum_cmplx8_scalar_ad
990#define MPP_SUM_2D_AD_ mpp_sum_cmplx8_2d_ad
992#define MPP_SUM_3D_AD_ mpp_sum_cmplx8_3d_ad
994#define MPP_SUM_4D_AD_ mpp_sum_cmplx8_4d_ad
996#define MPP_SUM_5D_AD_ mpp_sum_cmplx8_5d_ad
998#define MPP_TYPE_ complex(c8_kind)
1000#define MPI_TYPE_ MPI_DOUBLE_COMPLEX
1001#undef MPP_TYPE_BYTELEN_
1002#define MPP_TYPE_BYTELEN_ 16
1003#include <mpp_sum_nocomm_ad.fh>
1007#define MPP_SUM_AD_ mpp_sum_real4_ad
1008#undef MPP_SUM_SCALAR_AD_
1009#define MPP_SUM_SCALAR_AD_ mpp_sum_real4_scalar_ad
1010#undef MPP_SUM_2D_AD_
1011#define MPP_SUM_2D_AD_ mpp_sum_real4_2d_ad
1012#undef MPP_SUM_3D_AD_
1013#define MPP_SUM_3D_AD_ mpp_sum_real4_3d_ad
1014#undef MPP_SUM_4D_AD_
1015#define MPP_SUM_4D_AD_ mpp_sum_real4_4d_ad
1016#undef MPP_SUM_5D_AD_
1017#define MPP_SUM_5D_AD_ mpp_sum_real4_5d_ad
1019#define MPP_TYPE_ real(r4_kind)
1021#define MPI_TYPE_ MPI_REAL4
1022#undef MPP_TYPE_BYTELEN_
1023#define MPP_TYPE_BYTELEN_ 4
1024#include <mpp_sum_nocomm_ad.fh>
1028#define MPP_SUM_AD_ mpp_sum_cmplx4_ad
1029#undef MPP_SUM_SCALAR_AD_
1030#define MPP_SUM_SCALAR_AD_ mpp_sum_cmplx4_scalar_ad
1031#undef MPP_SUM_2D_AD_
1032#define MPP_SUM_2D_AD_ mpp_sum_cmplx4_2d_ad
1033#undef MPP_SUM_3D_AD_
1034#define MPP_SUM_3D_AD_ mpp_sum_cmplx4_3d_ad
1035#undef MPP_SUM_4D_AD_
1036#define MPP_SUM_4D_AD_ mpp_sum_cmplx4_4d_ad
1037#undef MPP_SUM_5D_AD_
1038#define MPP_SUM_5D_AD_ mpp_sum_cmplx4_5d_ad
1040#define MPP_TYPE_ complex(c4_kind)
1042#define MPI_TYPE_ MPI_COMPLEX
1043#undef MPP_TYPE_BYTELEN_
1044#define MPP_TYPE_BYTELEN_ 8
1045#include <mpp_sum_nocomm_ad.fh>
1049#define MPP_SUM_AD_ mpp_sum_int8_ad
1050#undef MPP_SUM_SCALAR_AD_
1051#define MPP_SUM_SCALAR_AD_ mpp_sum_int8_scalar_ad
1052#undef MPP_SUM_2D_AD_
1053#define MPP_SUM_2D_AD_ mpp_sum_int8_2d_ad
1054#undef MPP_SUM_3D_AD_
1055#define MPP_SUM_3D_AD_ mpp_sum_int8_3d_ad
1056#undef MPP_SUM_4D_AD_
1057#define MPP_SUM_4D_AD_ mpp_sum_int8_4d_ad
1058#undef MPP_SUM_5D_AD_
1059#define MPP_SUM_5D_AD_ mpp_sum_int8_5d_ad
1061#define MPP_TYPE_ integer(i8_kind)
1063#define MPI_TYPE_ MPI_INTEGER8
1064#undef MPP_TYPE_BYTELEN_
1065#define MPP_TYPE_BYTELEN_ 8
1066#include <mpp_sum_nocomm_ad.fh>
1069#define MPP_SUM_AD_ mpp_sum_int4_ad
1070#undef MPP_SUM_SCALAR_AD_
1071#define MPP_SUM_SCALAR_AD_ mpp_sum_int4_scalar_ad
1072#undef MPP_SUM_2D_AD_
1073#define MPP_SUM_2D_AD_ mpp_sum_int4_2d_ad
1074#undef MPP_SUM_3D_AD_
1075#define MPP_SUM_3D_AD_ mpp_sum_int4_3d_ad
1076#undef MPP_SUM_4D_AD_
1077#define MPP_SUM_4D_AD_ mpp_sum_int4_4d_ad
1078#undef MPP_SUM_5D_AD_
1079#define MPP_SUM_5D_AD_ mpp_sum_int4_5d_ad
1081#define MPP_TYPE_ integer(i4_kind)
1083#define MPI_TYPE_ MPI_INTEGER4
1084#undef MPP_TYPE_BYTELEN_
1085#define MPP_TYPE_BYTELEN_ 4
1086#include <mpp_sum_nocomm_ad.fh>
1095#undef MPP_ALLTOALLV_
1096#undef MPP_ALLTOALLW_
1098#undef MPP_TYPE_BYTELEN_
1100#define MPP_ALLTOALL_ mpp_alltoall_int4
1101#define MPP_ALLTOALLV_ mpp_alltoall_int4_v
1102#define MPP_ALLTOALLW_ mpp_alltoall_int4_w
1103#define MPP_TYPE_ integer(i4_kind)
1104#define MPP_TYPE_BYTELEN_ 4
1105#define MPI_TYPE_ MPI_INTEGER4
1106#include <mpp_alltoall_nocomm.fh>
1109#undef MPP_ALLTOALLV_
1110#undef MPP_ALLTOALLW_
1112#undef MPP_TYPE_BYTELEN_
1114#define MPP_ALLTOALL_ mpp_alltoall_int8
1115#define MPP_ALLTOALLV_ mpp_alltoall_int8_v
1116#define MPP_ALLTOALLW_ mpp_alltoall_int8_w
1117#define MPP_TYPE_ integer(i8_kind)
1118#define MPP_TYPE_BYTELEN_ 8
1119#define MPI_TYPE_ MPI_INTEGER8
1120#include <mpp_alltoall_nocomm.fh>
1123#undef MPP_ALLTOALLV_
1124#undef MPP_ALLTOALLW_
1126#undef MPP_TYPE_BYTELEN_
1128#define MPP_ALLTOALL_ mpp_alltoall_real4
1129#define MPP_ALLTOALLV_ mpp_alltoall_real4_v
1130#define MPP_ALLTOALLW_ mpp_alltoall_real4_w
1131#define MPP_TYPE_ real(r4_kind)
1132#define MPP_TYPE_BYTELEN_ 4
1133#define MPI_TYPE_ MPI_REAL4
1134#include <mpp_alltoall_nocomm.fh>
1137#undef MPP_ALLTOALLV_
1138#undef MPP_ALLTOALLW_
1140#undef MPP_TYPE_BYTELEN_
1142#define MPP_ALLTOALL_ mpp_alltoall_real8
1143#define MPP_ALLTOALLV_ mpp_alltoall_real8_v
1144#define MPP_ALLTOALLW_ mpp_alltoall_real8_w
1145#define MPP_TYPE_ real(r8_kind)
1146#define MPP_TYPE_BYTELEN_ 8
1147#define MPI_TYPE_ MPI_REAL8
1148#include <mpp_alltoall_nocomm.fh>
1151#undef MPP_ALLTOALLV_
1152#undef MPP_ALLTOALLW_
1154#undef MPP_TYPE_BYTELEN_
1156#define MPP_ALLTOALL_ mpp_alltoall_logical4
1157#define MPP_ALLTOALLV_ mpp_alltoall_logical4_v
1158#define MPP_ALLTOALLW_ mpp_alltoall_logical4_w
1159#define MPP_TYPE_ logical(l4_kind)
1160#define MPP_TYPE_BYTELEN_ 4
1161#define MPI_TYPE_ MPI_INTEGER4
1162#include <mpp_alltoall_nocomm.fh>
1165#undef MPP_ALLTOALLV_
1166#undef MPP_ALLTOALLW_
1168#undef MPP_TYPE_BYTELEN_
1170#define MPP_ALLTOALL_ mpp_alltoall_logical8
1171#define MPP_ALLTOALLV_ mpp_alltoall_logical8_v
1172#define MPP_ALLTOALLW_ mpp_alltoall_logical8_w
1173#define MPP_TYPE_ logical(l8_kind)
1174#define MPP_TYPE_BYTELEN_ 8
1175#define MPI_TYPE_ MPI_INTEGER8
1176#include <mpp_alltoall_nocomm.fh>
1183#define MPP_TYPE_CREATE_ mpp_type_create_int4
1184#define MPP_TYPE_ integer(i4_kind)
1185#define MPI_TYPE_ MPI_INTEGER4
1186#include <mpp_type_nocomm.fh>
1188#define MPP_TYPE_CREATE_ mpp_type_create_int8
1189#define MPP_TYPE_ integer(i8_kind)
1190#define MPI_TYPE_ MPI_INTEGER8
1191#include <mpp_type_nocomm.fh>
1193#define MPP_TYPE_CREATE_ mpp_type_create_real4
1194#define MPP_TYPE_ real(r4_kind)
1195#define MPI_TYPE_ MPI_REAL4
1196#include <mpp_type_nocomm.fh>
1198#define MPP_TYPE_CREATE_ mpp_type_create_real8
1199#define MPP_TYPE_ real(r8_kind)
1200#define MPI_TYPE_ MPI_REAL8
1201#include <mpp_type_nocomm.fh>
1203#define MPP_TYPE_CREATE_ mpp_type_create_cmplx4
1204#define MPP_TYPE_ complex(c4_kind)
1205#define MPI_TYPE_ MPI_COMPLEX8
1206#include <mpp_type_nocomm.fh>
1208#define MPP_TYPE_CREATE_ mpp_type_create_cmplx8
1209#define MPP_TYPE_ complex(c8_kind)
1210#define MPI_TYPE_ MPI_COMPLEX16
1211#include <mpp_type_nocomm.fh>
1213#define MPP_TYPE_CREATE_ mpp_type_create_logical4
1214#define MPP_TYPE_ logical(l4_kind)
1215#define MPI_TYPE_ MPI_INTEGER4
1216#include <mpp_type_nocomm.fh>
1218#define MPP_TYPE_CREATE_ mpp_type_create_logical8
1219#define MPP_TYPE_ logical(l8_kind)
1220#define MPI_TYPE_ MPI_INTEGER8
1221#include <mpp_type_nocomm.fh>
1226#undef MPP_TYPE_CREATE_
1228subroutine mpp_type_free(dtype)
1229 type(mpp_type),
pointer,
intent(inout) :: dtype
1231 call mpp_error(note,
'MPP_TYPE_FREE: ' &
1232 //
'This function should not be used in serial mode.')
1237end subroutine mpp_type_free
subroutine mpp_sync(pelist, do_self)
Synchronize PEs in list.