1 SUBROUTINE btsetup( MEM, MEMLEN, CMEM, CMEMLEN, OUTNUM,
2 $ TESTSDRV, TESTBSBR, TESTCOMB, TESTAUX,
10 LOGICAL TESTSDRV, TESTBSBR, TESTCOMB, TESTAUX
11 INTEGER MEMLEN, CMEMLEN, OUTNUM, IAM, NNODES
15 CHARACTER*1 CMEM(CMEMLEN)
32 COMMON /btmpi/ btcomm, ierr
38 CALL mpi_initialized(init, ierr)
39 IF (.NOT.init)
CALL mpi_init(ierr)
40 IF (ierr.NE.0)
CALL btmpierr(
"mpi_init", ierr)
41 CALL mpi_comm_dup(mpi_comm_world, btcomm, ierr)
42 IF (ierr.NE.0)
CALL btmpierr(
"MPI_COMM_DUP", ierr)
66 COMMON /btmpi/ btcomm, ierr
71 CALL mpi_comm_rank(btcomm, rank, ierr)
72 IF (ierr.NE.0)
CALL btmpierr(
"MPI_COMM_RANK", ierr)
99 COMMON /btmpi/ btcomm, ierr
104 CALL mpi_comm_size(btcomm, nproc, ierr)
105 IF (ierr.NE.0)
CALL btmpierr(
"MPI_COMM_SIZE", ierr)
114 SUBROUTINE btsend(DTYPE, N, BUFF, DEST, MSGID)
121 INTEGER N, DTYPE, DEST, MSGID
158 INTEGER IBTMYPROC, IBTNPROCS, IBTSIZEOF
159 EXTERNAL IBTMYPROC, IBTNPROCS, IBTSIZEOF
162 INTEGER I, IAM, MPIDTYPE
168 COMMON /btmpi/ btcomm, ierr
171 IF( dtype .EQ. 1 )
THEN
173 ELSE IF( dtype .EQ. 3 )
THEN
174 mpidtype = mpi_integer
175 ELSE IF( dtype .EQ. 4 )
THEN
177 ELSE IF( dtype .EQ. 5 )
THEN
178 mpidtype = mpi_complex
179 ELSE IF( dtype .EQ. 6 )
THEN
180 mpidtype = mpi_double_precision
181 ELSE IF( dtype .EQ. 7 )
THEN
182 mpidtype = mpi_double_complex
187 IF( dest .EQ. -1 )
THEN
189 DO 10 i = 0, ibtnprocs()-1
190 IF( i .NE. iam )
THEN
191 CALL mpi_send(buff, n, mpidtype, i, 0, btcomm, ierr)
192 IF (ierr.NE.0)
CALL btmpierr(
"MPI_SEND", ierr)
196 CALL mpi_send(buff, n, mpidtype, dest, 0, btcomm, ierr)
197 IF (ierr.NE.0)
CALL btmpierr(
"MPI_SEND", ierr)
206 SUBROUTINE btrecv(DTYPE, N, BUFF, SRC, MSGID)
214 INTEGER N, DTYPE, SRC, MSGID
256 INTEGER STAT(MPI_STATUS_SIZE)
259 COMMON /btmpi/ btcomm, ierr
262 IF( dtype .EQ. 1 )
THEN
264 ELSE IF( dtype .EQ. 3 )
THEN
265 mpidtype = mpi_integer
266 ELSE IF( dtype .EQ. 4 )
THEN
268 ELSE IF( dtype .EQ. 5 )
THEN
269 mpidtype = mpi_complex
270 ELSE IF( dtype .EQ. 6 )
THEN
271 mpidtype = mpi_double_precision
272 ELSE IF( dtype .EQ. 7 )
THEN
273 mpidtype = mpi_double_complex
276 CALL mpi_recv( buff, n, mpidtype, src, 0, btcomm, stat, ierr )
277 IF (ierr.NE.0)
CALL btmpierr(
"MPI_RECV", ierr)
321 COMMON /btmpi/ btcomm, ierr
335 CALL mpi_initialized(init, ierr)
336 IF (.NOT.init)
CALL mpi_init(ierr)
337 IF (ierr.NE.0)
CALL btmpierr(
"mpi_init", ierr)
341 IF(
lsame(
TYPE,
'I') ) then
342 call mpi_type_size( mpi_integer, length, ierr )
343 IF (ierr.NE.0)
CALL btmpierr(
"MPI_TYPE_SIZE", ierr)
344 ELSE IF(
lsame(
TYPE,
'S') ) then
345 CALL mpi_type_size( mpi_real, length, ierr )
346 IF (ierr.NE.0)
CALL btmpierr(
"MPI_TYPE_SIZE", ierr)
347 ELSE IF(
lsame(
TYPE,
'D') ) then
348 CALL mpi_type_size( mpi_double_precision, length, ierr )
349 IF (ierr.NE.0)
CALL btmpierr(
"MPI_TYPE_SIZE", ierr)
350 ELSE IF(
lsame(
TYPE,
'C') ) then
351 CALL mpi_type_size( mpi_complex, length, ierr )
352 IF (ierr.NE.0)
CALL btmpierr(
"MPI_TYPE_SIZE", ierr)
353 ELSE IF(
lsame(
TYPE,
'Z') ) then
354 CALL mpi_type_size( mpi_double_complex, length, ierr )
355 IF (ierr.NE.0)
CALL btmpierr(
"MPI_TYPE_SIZE", ierr)
369 COMMON /btmpi/ btcomm, ierr
372 WRITE(*,1000) rout, ierr
373 CALL mpi_abort(btcomm, ierr0, ierr)
375 1000
FORMAT(
'Error #',i20,
' from routine ',a)