Skip to content

Commit 50a9888

Browse files
committed
Use standard Fortran for coarray_distributed_trans
1 parent 84c575a commit 50a9888

File tree

1 file changed

+17
-29
lines changed

1 file changed

+17
-29
lines changed

src/tests/integration/dist_transpose/coarray_distributed_transpose.F90

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,13 @@
3434
!================== test transposes with integer x,y,z values ===============================
3535
module run_size
3636
use iso_fortran_env
37-
#ifndef HAVE_WALLTIME
38-
# ifdef MPI_WORKING_MODULE
39-
use MPI, only : WALLTIME=>MPI_WTIME
40-
implicit none
41-
# else
42-
implicit none
43-
include 'mpif.h'
44-
# define WALLTIME MPI_WTIME
45-
# endif
46-
#else
47-
implicit none
48-
#endif
49-
integer(int64), codimension[*] :: nx, ny, nz
50-
integer(int64), codimension[*] :: my, mx, first_y, last_y, first_x, last_x
51-
integer(int64) :: my_node, num_nodes
52-
real(real64), codimension[*] :: tran_time
53-
54-
#ifdef HAVE_WALLTIME
55-
interface
56-
function WALLTIME() bind(C, name = "WALLTIME")
57-
use iso_fortran_env
58-
real(real64) :: WALLTIME
59-
end function WALLTIME
60-
end interface
61-
#endif
37+
implicit none
38+
39+
integer(int64), codimension[*] :: nx, ny, nz
40+
integer(int64), codimension[*] :: my, mx, first_y, last_y, first_x, last_x
41+
integer(int64) :: my_node, num_nodes
42+
real(real64), codimension[*] :: tran_time
43+
6244

6345
contains
6446

@@ -226,9 +208,11 @@ subroutine transpose_X_Y
226208
implicit none
227209

228210
integer(int64) :: i,stage
211+
real(real64) :: tmp
229212

230213
sync all !-- wait for other nodes to finish compute
231-
tran_time = tran_time - WALLTIME()
214+
call cpu_time(tmp)
215+
tran_time = tran_time - tmp
232216

233217
call copy3 ( u(1,1,first_x,1+(my_node-1)*my) & !-- intra-node transpose
234218
, ur(1,1,first_y,1+(my_node-1)*mx) & !-- no inter-node transpose needed
@@ -262,7 +246,8 @@ subroutine transpose_X_Y
262246
#endif
263247

264248
sync all !-- wait for other nodes to finish transpose
265-
tran_time = tran_time + WALLTIME()
249+
call cpu_time(tmp)
250+
tran_time = tran_time + tmp
266251

267252
end subroutine transpose_X_Y
268253

@@ -273,9 +258,11 @@ subroutine transpose_Y_X
273258
implicit none
274259

275260
integer(int64) :: i, stage
261+
real(real64) :: tmp
276262

277263
sync all !-- wait for other nodes to finish compute
278-
tran_time = tran_time - WALLTIME()
264+
call cpu_time(tmp)
265+
tran_time = tran_time - tmp
279266

280267
call copy3 ( ur(1,1,first_y,1+(my_node-1)*mx) & !-- intra-node transpose
281268
, u(1,1,first_x,1+(my_node-1)*my) & !-- no inter-node transpose needed
@@ -309,7 +296,8 @@ subroutine transpose_Y_X
309296
#endif
310297

311298
sync all !-- wait for other nodes to finish transpose
312-
tran_time = tran_time + WALLTIME()
299+
call cpu_time(tmp)
300+
tran_time = tran_time + tmp
313301

314302
end subroutine transpose_Y_X
315303

0 commit comments

Comments
 (0)