File indexing completed on 2018-03-02 18:38:28 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
bb5d043025 Jean*0001
0002 subroutine compsend_i4vec( dataname, length, vecFld )
0003 implicit none
0004
0005 #include "CPLR_SIG.h"
0006
0007 #include "mpif.h"
0008
0009 character*(*) dataname
0010 integer length
0011 integer vecFld(length)
0012
0013 integer generate_tag
0014 external generate_tag
0015
0016 integer count,datatype,dest,tag,comm,ierr
0017 integer i
0018 integer ibuf(MAX_IBUF)
0019
0020
0021 if ( 1+length .gt. MAX_IBUF )
0022 & STOP 'compsend_i4vec: length exceeds MAX_IBUF'
0023
0024
0025 ibuf(1) = length
0026 do i=1,length
0027 ibuf(i+1) = vecFld(i)
0028 enddo
0029
0030
0031 count = 1+length
0032 datatype = MPI_INTEGER
0033 dest = my_coupler_rank
0034 tag = generate_tag( 115, my_rank_in_global, dataname )
0035 comm = MPI_COMM_myglobal
0036
0037 if (VERB) then
0038 write(LogUnit,*)
0039 & 'compsend_i4vec: calling MPI_Send dest=',dest
0040 write(LogUnit,*) 'compsend_i4vec: dataname=',dataname
0041 call flush(LogUnit)
0042 endif
0043 call MPI_Send( ibuf, count, datatype, dest, tag, comm, ierr )
0044 if (VERB) then
0045 write(LogUnit,*) 'compsend_i4vec: returned ierr=',ierr
0046 call flush(LogUnit)
0047 endif
0048
0049 if (ierr.ne.0) then
0050 write(LogUnit,*) 'compsend_i4vec: rank(W,G,L)=',
0051 & my_rank_in_world,my_rank_in_global,my_rank_in_local,
0052 & ' ierr=',ierr
0053 STOP 'compsend_i4vec: MPI_Send failed'
0054 endif
0055
0056
0057 return
0058 end
0059