1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#if defined(__CUDA)
PROGRAM test_mp_min_iv_buffer_gpu
!
! Simple program to check the functionalities of test_mp_min_iv
! with buffer implementation.
!
USE parallel_include
USE cudafor
USE mp, ONLY : mp_min
USE mp_world, ONLY : mp_world_start, mp_world_end, mpime, &
root, nproc, world_comm
USE tester
IMPLICIT NONE
!
TYPE(tester_t) :: test
INTEGER :: world_group = 0
! test variable
INTEGER, DEVICE :: iv_d(200001)
INTEGER :: iv_h(200001)
!
CALL test%init()
#if defined(__MPI)
world_group = MPI_COMM_WORLD
#endif
CALL mp_world_start(world_group)
iv_h(:) = mpime + 1
iv_d = iv_h
CALL mp_min(iv_d, world_comm)
iv_h = iv_d
!
CALL test%assert_equal( ALL(iv_h == 1) , .true. )
!
CALL collect_results(test)
!
CALL mp_world_end()
!
IF (mpime .eq. 0) CALL test%print()
!
END PROGRAM test_mp_min_iv_buffer_gpu
#else
PROGRAM test_mp_min_iv_buffer_gpu
CALL no_test()
END PROGRAM test_mp_min_iv_buffer_gpu
#endif
|