96 & KCOMM,KROOT,KMP_TYPE,KREQUEST)
99 #ifdef USE_8_BYTE_WORDS 101 mpi_comm_size => mpi_comm_size8
106 INTEGER(KIND=JPIM),
INTENT(OUT) :: IERROR,IPL_NUMPROC,IPL_MYRANK,ICOMM,IROOT,IMP_TYPE
107 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KROOT
108 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KCOMM,KMP_TYPE,KREQUEST
109 INTEGER(KIND=JPIM) :: ITID
110 itid = oml_my_thread()
114 & cdmessage=
'MPL_GATHERV: MPL NOT INITIALISED ',ldabort=
llabort)
116 IF(
PRESENT(kcomm))
THEN 126 CALL mpi_comm_size(icomm,ipl_numproc,ierror)
130 IF(
PRESENT(kroot))
THEN 136 IF(
PRESENT(kmp_type))
THEN 142 IF(.NOT.
PRESENT(krequest))
CALL mpl_message(cdmessage=
'MPL_GATHERV: KREQUEST MISSING',ldabort=
llabort)
149 & KRECVCOUNTS,KIRECVDISPL,KRECVDISPL,CDSTRING)
151 INTEGER(KIND=JPIM),
INTENT(IN) :: IPL_NUMPROC,IPL_MYRANK,IRECVBUFSIZE,ISENDCOUNT
152 INTEGER(KIND=JPIM),
INTENT(IN) :: KRECVCOUNTS(:)
153 INTEGER(KIND=JPIM),
INTENT(OUT) :: KIRECVDISPL(:)
154 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVDISPL(:)
155 CHARACTER*(*),
INTENT(IN),
OPTIONAL :: CDSTRING
156 INTEGER(KIND=JPIM) :: IR
159 IF(
SIZE(krecvcounts) < ipl_numproc)
THEN 160 WRITE(
mpl_errunit,*)
'MPL_GATHERV: ERROR KRECVCOUNTS DIMENSION=',&
163 &
'MPL_GATHERV: ERROR KRECVCOUNTS DIMENSION IS WRONG',ldabort=
llabort)
165 IF(isendcount /= krecvcounts(ipl_myrank))
THEN 166 WRITE(
mpl_errunit,*)
'MPL_GATHERV: ERROR KRECVCOUNTS INCONSISTENCY ',&
167 & isendcount,krecvcounts(ipl_myrank)
169 &
'MPL_GATHERV: ERROR ISENDCOUNT /= KRECVCOUNTS(MPL_RANK) ',ldabort=
llabort)
172 IF(
PRESENT(krecvdispl))
THEN 173 kirecvdispl(1:ipl_numproc) = krecvdispl(1:ipl_numproc)
175 kirecvdispl(1:ipl_numproc) = 0
177 kirecvdispl(ir) = kirecvdispl(ir-1) + krecvcounts(ir-1)
181 IF(kirecvdispl(ir)+krecvcounts(ir) > irecvbufsize)
THEN 182 WRITE(
mpl_errunit,
'(A,4I10)')
'MPL_GATHERV:RECV BUFFER TOO SMALL ', &
183 & ir,kirecvdispl(ir),krecvcounts(ir),irecvbufsize
191 & KMP_TYPE,KCOMM,KERROR,KREQUEST,CDSTRING)
194 #ifdef USE_8_BYTE_WORDS 196 mpi_gatherv => mpi_gatherv8
201 REAL(KIND=JPRM),
INTENT(IN) :: PSENDBUF(:)
202 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KROOT
203 REAL(KIND=JPRM),
INTENT(OUT),
OPTIONAL :: PRECVBUF(:)
204 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVCOUNTS(:)
205 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVDISPL(:),KCOMM,KMP_TYPE
206 INTEGER(KIND=JPIM),
INTENT(OUT),
OPTIONAL :: KERROR,KREQUEST
207 CHARACTER*(*),
INTENT(IN),
OPTIONAL :: CDSTRING
210 INTEGER(KIND=JPIM) :: IERROR,IPL_NUMPROC,IPL_MYRANK,ICOMM,IROOT,IMP_TYPE
211 INTEGER(KIND=JPIM) :: IRECVBUFSIZE,ISENDCOUNT
214 isendcount =
SIZE(psendbuf)
216 IF( (loc(psendbuf(ubound(psendbuf,1))) - loc(psendbuf(lbound(psendbuf,1)))) /= 4_jpib*(isendcount - 1) .AND. &
217 & isendcount > 0 )
THEN 222 CALL mpl_gatherv_preamb1(ierror,ipl_numproc,ipl_myrank,icomm,iroot,imp_type,kcomm,kroot,kmp_type,krequest)
224 IF(ipl_myrank == iroot)
THEN 226 & cdmessage=
'MPL_GATHERV:RECVBUF MISSING',cdstring=cdstring,ldabort=
llabort)
228 irecvbufsize =
SIZE(precvbuf)
230 IF( (loc(precvbuf(ubound(precvbuf,1))) - loc(precvbuf(lbound(precvbuf,1)))) /= 4_jpib*(irecvbufsize - 1) .AND. &
231 & irecvbufsize > 0 )
THEN 237 & krecvcounts,irecvdispl,krecvdispl,cdstring)
239 CALL mpi_gatherv(psendbuf(1),isendcount,int(mpi_real4),precvbuf(1),krecvcounts, &
240 & irecvdispl,int(mpi_real4),iroot-1,icomm,ierror)
242 CALL mpi_igatherv(psendbuf(1),isendcount,int(mpi_real4),precvbuf(1),krecvcounts, &
243 & irecvdispl,int(mpi_real4),iroot-1,icomm,krequest,ierror)
251 CALL mpi_gatherv(psendbuf(1),isendcount,int(mpi_real4),
zdum_jprm,1, &
252 & 1,int(mpi_real4),iroot-1,icomm,ierror)
254 CALL mpi_igatherv(psendbuf(1),isendcount,int(mpi_real4),
zdum_jprm,1, &
255 & 1,int(mpi_real4),iroot-1,icomm,krequest,ierror)
262 IF(
PRESENT(kerror))
THEN 265 IF(ierror /= 0 )
CALL mpl_message(ierror,
'MPL_GATHERV',&
272 & KMP_TYPE,KCOMM,KERROR,KREQUEST,CDSTRING)
275 #ifdef USE_8_BYTE_WORDS 277 mpi_gatherv => mpi_gatherv8
282 REAL(KIND=JPRD) :: PSENDBUF(:)
283 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVCOUNTS(:)
284 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KROOT
285 REAL(KIND=JPRD),
OPTIONAL :: PRECVBUF(:)
286 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVDISPL(:),KCOMM,KMP_TYPE
287 INTEGER(KIND=JPIM),
INTENT(OUT),
OPTIONAL :: KERROR,KREQUEST
288 CHARACTER*(*),
INTENT(IN),
OPTIONAL :: CDSTRING
291 INTEGER(KIND=JPIM) :: IERROR,IPL_NUMPROC,IPL_MYRANK,ICOMM,IROOT,IMP_TYPE
292 INTEGER(KIND=JPIM) :: IRECVBUFSIZE,ISENDCOUNT
293 INTEGER(KIND=JPIM) :: IDUM,IST,IEND,JK
296 isendcount =
SIZE(psendbuf)
298 IF( (loc(psendbuf(ubound(psendbuf,1))) - loc(psendbuf(lbound(psendbuf,1)))) /= 8_jpib*(isendcount - 1) .AND. &
299 & isendcount > 0 )
THEN 304 CALL mpl_gatherv_preamb1(ierror,ipl_numproc,ipl_myrank,icomm,iroot,imp_type,kcomm,kroot,kmp_type,krequest)
306 IF(ipl_myrank == iroot)
THEN 308 & cdmessage=
'MPL_GATHERV:RECVBUF MISSING',cdstring=cdstring,ldabort=
llabort)
309 irecvbufsize =
SIZE(precvbuf)
311 IF( (loc(precvbuf(ubound(precvbuf,1))) - loc(precvbuf(lbound(precvbuf,1)))) /= 8_jpib*(irecvbufsize - 1) .AND. &
312 & irecvbufsize > 0 )
THEN 317 & krecvcounts,irecvdispl,krecvdispl,cdstring)
320 CALL mpi_gatherv(psendbuf(1),isendcount,int(mpi_real8),precvbuf(1),krecvcounts,&
321 & irecvdispl,int(mpi_real8),iroot-1,icomm,ierror)
323 CALL mpi_igatherv(psendbuf(1),isendcount,int(mpi_real8),precvbuf(1),krecvcounts,&
324 & irecvdispl,int(mpi_real8),iroot-1,icomm,krequest,ierror)
332 CALL mpi_gatherv(psendbuf(1),isendcount,int(mpi_real8),
zdum_jprd,1, &
333 & 1,int(mpi_real8),iroot-1,icomm,ierror)
335 CALL mpi_igatherv(psendbuf(1),isendcount,int(mpi_real8),
zdum_jprd,1, &
336 & 1,int(mpi_real8),iroot-1,icomm,krequest,ierror)
343 IF(
PRESENT(kerror))
THEN 346 IF(ierror /= 0 )
CALL mpl_message(ierror,
'MPL_GATHERV',cdstring,&
352 SUBROUTINE mpl_gatherv_int(KSENDBUF,KROOT,KRECVBUF,KRECVCOUNTS,KRECVDISPL, &
353 & KMP_TYPE,KCOMM,KERROR,KREQUEST,CDSTRING)
356 #ifdef USE_8_BYTE_WORDS 358 mpi_gatherv => mpi_gatherv8
363 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KROOT
364 INTEGER(KIND=JPIM),
INTENT(IN) :: KSENDBUF(:)
365 INTEGER(KIND=JPIM),
INTENT(OUT),
OPTIONAL :: KRECVBUF(:)
366 INTEGER(KIND=JPIM),
INTENT(IN) :: KRECVCOUNTS(:)
367 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVDISPL(:),KCOMM,KMP_TYPE
368 INTEGER(KIND=JPIM),
INTENT(OUT),
OPTIONAL :: KERROR,KREQUEST
369 CHARACTER*(*),
INTENT(IN),
OPTIONAL :: CDSTRING
372 INTEGER(KIND=JPIM) :: IERROR,IPL_NUMPROC,IPL_MYRANK,ICOMM,IROOT,IMP_TYPE
373 INTEGER(KIND=JPIM) :: IRECVBUFSIZE,ISENDCOUNT
375 isendcount =
SIZE(ksendbuf)
377 IF( (loc(ksendbuf(ubound(ksendbuf,1))) - loc(ksendbuf(lbound(ksendbuf,1)))) /= 4_jpib*(isendcount - 1) .AND. &
378 & isendcount > 0 )
THEN 383 CALL mpl_gatherv_preamb1(ierror,ipl_numproc,ipl_myrank,icomm,iroot,imp_type,kcomm,kroot,kmp_type,krequest)
385 IF(ipl_myrank == iroot)
THEN 387 & cdmessage=
'MPL_GATHERV:RECVBUF MISSING',cdstring=cdstring,ldabort=
llabort)
389 irecvbufsize =
SIZE(krecvbuf)
391 IF( (loc(krecvbuf(ubound(krecvbuf,1))) - loc(krecvbuf(lbound(krecvbuf,1)))) /= 4_jpib*(irecvbufsize - 1) .AND. &
392 & irecvbufsize > 0 )
THEN 398 & krecvcounts,irecvdispl,krecvdispl,cdstring)
400 CALL mpi_gatherv(ksendbuf(1),isendcount,int(mpi_integer),krecvbuf(1),&
401 & krecvcounts,irecvdispl,int(mpi_integer),iroot-1,icomm,ierror)
403 CALL mpi_igatherv(ksendbuf(1),isendcount,int(mpi_integer),krecvbuf(1),&
404 & krecvcounts,irecvdispl,int(mpi_integer),iroot-1,icomm,krequest,ierror)
412 CALL mpi_gatherv(ksendbuf(1),isendcount,int(mpi_integer),
zdum_int,1, &
413 & 1,int(mpi_integer),iroot-1,icomm,ierror)
415 CALL mpi_igatherv(ksendbuf(1),isendcount,int(mpi_integer),
zdum_int,1, &
416 & 1,int(mpi_integer),iroot-1,icomm,krequest,ierror)
423 IF(
PRESENT(kerror))
THEN 432 & KMP_TYPE,KRECVDISPL,KCOMM,KERROR,KREQUEST,CDSTRING)
435 #ifdef USE_8_BYTE_WORDS 437 mpi_gatherv => mpi_gatherv8, mpi_gather => mpi_gather8
442 INTEGER(KIND=JPIM),
INTENT(IN) :: KSENDBUF
443 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KROOT
444 INTEGER(KIND=JPIM),
INTENT(OUT),
OPTIONAL :: KRECVBUF(:)
445 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVCOUNTS(:)
446 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVDISPL(:),KCOMM,KMP_TYPE
447 INTEGER(KIND=JPIM),
INTENT(OUT),
OPTIONAL :: KERROR,KREQUEST
448 CHARACTER*(*),
INTENT(IN),
OPTIONAL :: CDSTRING
451 INTEGER(KIND=JPIM) :: IERROR,IPL_NUMPROC,IPL_MYRANK,ICOMM,IROOT,IMP_TYPE
452 INTEGER(KIND=JPIM) :: IRECVBUFSIZE,ISENDCOUNT
455 CALL mpl_gatherv_preamb1(ierror,ipl_numproc,ipl_myrank,icomm,iroot,imp_type,kcomm,kroot,kmp_type,krequest)
457 IF(ipl_myrank == iroot)
THEN 459 & cdmessage=
'MPL_GATHERV:RECVBUF MISSING',cdstring=cdstring,ldabort=
llabort)
460 irecvbufsize =
SIZE(krecvbuf)
461 IF(
PRESENT(krecvdispl))
THEN 464 & irecvcounts,irecvdispl,krecvdispl,cdstring)
466 CALL mpi_gatherv(ksendbuf,isendcount,int(mpi_integer),krecvbuf(1),&
467 & irecvcounts,irecvdispl,int(mpi_integer),iroot-1,icomm,ierror)
469 CALL mpi_igatherv(ksendbuf,isendcount,int(mpi_integer),krecvbuf(1),&
470 & irecvcounts,irecvdispl,int(mpi_integer),iroot-1,icomm,krequest,ierror)
477 IF(irecvbufsize < ipl_numproc)
THEN 478 CALL mpl_message(cdmessage=
'MPL_GATHERV:IRECVBUFSIZE < IPL_NUMPROC',&
479 & cdstring=cdstring,ldabort=
llabort)
482 CALL mpi_gather(ksendbuf,isendcount,int(mpi_integer),krecvbuf(1),&
483 & isendcount,int(mpi_integer),iroot-1,icomm,ierror)
485 CALL mpi_igather(ksendbuf,isendcount,int(mpi_integer),krecvbuf(1),&
486 & isendcount,int(mpi_integer),iroot-1,icomm,krequest,ierror)
494 IF(
PRESENT(krecvdispl))
THEN 496 CALL mpi_gatherv(ksendbuf,isendcount,int(mpi_integer),
zdum_int,1, &
497 & 1,int(mpi_integer),iroot-1,icomm,ierror)
499 CALL mpi_igatherv(ksendbuf,isendcount,int(mpi_integer),
zdum_int,1, &
500 & 1,int(mpi_integer),iroot-1,icomm,krequest,ierror)
507 CALL mpi_gather(ksendbuf,isendcount,int(mpi_integer),
zdum_int,&
508 & 1,int(mpi_integer),iroot-1,icomm,ierror)
510 CALL mpi_igather(ksendbuf,isendcount,int(mpi_integer),
zdum_int,&
511 & 1,int(mpi_integer),iroot-1,icomm,krequest,ierror)
519 IF(
PRESENT(kerror))
THEN 528 & KRECVDISPL,KMP_TYPE,KCOMM,KERROR,KREQUEST,CDSTRING)
531 #ifdef USE_8_BYTE_WORDS 533 mpi_gatherv => mpi_gatherv8, mpi_gather => mpi_gather8
538 REAL(KIND=JPRD),
INTENT(IN) :: PSENDBUF
539 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KROOT
540 REAL(KIND=JPRD),
INTENT(OUT),
OPTIONAL :: PRECVBUF(:)
541 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVCOUNTS(:)
542 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KRECVDISPL(:),KCOMM,KMP_TYPE
543 INTEGER(KIND=JPIM),
INTENT(OUT),
OPTIONAL :: KERROR,KREQUEST
544 CHARACTER*(*),
INTENT(IN),
OPTIONAL :: CDSTRING
547 INTEGER(KIND=JPIM) :: IERROR,IPL_NUMPROC,IPL_MYRANK,ICOMM,IROOT,IMP_TYPE
548 INTEGER(KIND=JPIM) :: IRECVBUFSIZE,ISENDCOUNT
551 CALL mpl_gatherv_preamb1(ierror,ipl_numproc,ipl_myrank,icomm,iroot,imp_type,kcomm,kroot,kmp_type,krequest)
553 IF(ipl_myrank == iroot)
THEN 555 & cdmessage=
'MPL_GATHERV:RECVBUF MISSING',cdstring=cdstring,ldabort=
llabort)
556 irecvbufsize =
SIZE(precvbuf)
557 IF(
PRESENT(krecvdispl))
THEN 560 & irecvcounts,irecvdispl,krecvdispl,cdstring)
562 CALL mpi_gatherv(psendbuf,isendcount,int(mpi_real8),precvbuf(1),&
563 & irecvcounts,irecvdispl,int(mpi_real8),iroot-1,icomm,ierror)
565 CALL mpi_igatherv(psendbuf,isendcount,int(mpi_real8),precvbuf(1),&
566 & irecvcounts,irecvdispl,int(mpi_real8),iroot-1,icomm,krequest,ierror)
573 IF(irecvbufsize < ipl_numproc)
THEN 574 CALL mpl_message(cdmessage=
'MPL_GATHERV:IRECVBUFSIZE < IPL_NUMPROC',&
575 & cdstring=cdstring,ldabort=
llabort)
578 CALL mpi_gather(psendbuf,isendcount,int(mpi_real8),precvbuf(1),&
579 & isendcount,int(mpi_real8),iroot-1,icomm,ierror)
581 CALL mpi_igather(psendbuf,isendcount,int(mpi_real8),precvbuf(1),&
582 & isendcount,int(mpi_real8),iroot-1,icomm,krequest,ierror)
590 IF(
PRESENT(krecvdispl))
THEN 592 CALL mpi_gatherv(psendbuf,isendcount,int(mpi_real8),
zdum_jprd,1, &
593 & 1,int(mpi_real8),iroot-1,icomm,ierror)
595 CALL mpi_igatherv(psendbuf,isendcount,int(mpi_real8),
zdum_jprd,1, &
596 & 1,int(mpi_real8),iroot-1,icomm,krequest,ierror)
603 CALL mpi_gather(psendbuf,isendcount,int(mpi_real8),
zdum_jprd,&
604 & 1,int(mpi_real8),iroot-1,icomm,ierror)
606 CALL mpi_igather(psendbuf,isendcount,int(mpi_real8),
zdum_jprd,&
607 & 1,int(mpi_real8),iroot-1,icomm,krequest,ierror)
615 IF(
PRESENT(kerror))
THEN
subroutine, public mpl_message(KERROR, CDMESSAGE, CDSTRING, LDABORT)
integer(kind=jpim), parameter jp_blocking_buffered
integer(kind=jpim) zdum_int
subroutine mpl_gatherv_real8_scalar(PSENDBUF, KROOT, PRECVBUF, KRECVCOUNTS, KRECVDISPL, KMP_TYPE, KCOMM, KERROR, KREQUEST, CDSTRING)
subroutine, public mpl_recvstats(ICOUNT, ITYPE)
integer(kind=jpim) mpl_numproc
subroutine mpl_gatherv_preamb2(IPL_NUMPROC, IPL_MYRANK, IRECVBUFSIZE, ISENDCOUNT, KRECVCOUNTS, KIRECVDISPL, KRECVDISPL, CDSTRING)
subroutine mpl_gatherv_int_scalar(KSENDBUF, KROOT, KRECVBUF, KRECVCOUNTS, KMP_TYPE, KRECVDISPL, KCOMM, KERROR, KREQUEST, CDSTRING)
integer(kind=jpim), parameter jp_non_blocking_standard
integer(kind=jpim), dimension(:), allocatable mpl_comm_oml
integer(kind=jpim), parameter jp_blocking_standard
real(kind=jprd) zdum_jprd
subroutine mpl_gatherv_real8(PSENDBUF, KROOT, PRECVBUF, KRECVCOUNTS, KRECVDISPL, KMP_TYPE, KCOMM, KERROR, KREQUEST, CDSTRING)
subroutine, public mpl_sendstats(ICOUNT, ITYPE)
subroutine mpl_gatherv_preamb1(IERROR, IPL_NUMPROC, IPL_MYRANK, ICOMM, IROOT, IMP_TYPE, KCOMM, KROOT, KMP_TYPE, KREQUEST)
integer(kind=jpim), parameter jp_non_blocking_buffered
real(kind=jprm) zdum_jprm
integer(kind=jpim) mpl_errunit
intent(out) overrides sub arrays one Sort by the least significant key first sum(iindex(1:n))
integer(kind=jpim) function, public mpl_myrank(KCOMM)
integer(kind=jpim) mpl_rank
integer(kind=jpim) mpl_method
subroutine mpl_gatherv_int(KSENDBUF, KROOT, KRECVBUF, KRECVCOUNTS, KRECVDISPL, KMP_TYPE, KCOMM, KERROR, KREQUEST, CDSTRING)
subroutine mpl_gatherv_real4(PSENDBUF, KROOT, PRECVBUF, KRECVCOUNTS, KRECVDISPL, KMP_TYPE, KCOMM, KERROR, KREQUEST, CDSTRING)