-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7cd859
commit 0f92dd8
Showing
5 changed files
with
104 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,37 @@ | ||
set(targets | ||
set(tested | ||
test_allgather | ||
test_allgatherv | ||
) | ||
set(targets | ||
test_allreduce | ||
test_bcast | ||
test_comm_split | ||
test_gather | ||
test_gatherv | ||
test_reduce | ||
test_scatter | ||
test_scatterv) | ||
test_scatterv | ||
) | ||
list(APPEND targets ${tested}) | ||
|
||
foreach(target IN LISTS targets) | ||
add_executable(${target} ${target}.f90) | ||
add_executable(${target} ${target}.f90 testhelper.f90) | ||
target_link_libraries(${target} MpiFx) | ||
endforeach() | ||
|
||
foreach(target IN LISTS tested) | ||
add_test(NAME ${target} | ||
COMMAND ${MPIEXEC_EXECUTABLE} | ||
${MPIEXEC_NUMPROC_FLAG} | ||
${MPIEXEC_MAX_NUMPROCS} | ||
${MPIEXEC_PREFLAGS} | ||
${CMAKE_CURRENT_BINARY_DIR}/${target} | ||
${MPIEXEC_POSTFLAGS} | ||
) | ||
set_tests_properties(${target} PROPERTIES | ||
PASS_REGULAR_EXPRESSION "TestPASSED" | ||
) | ||
set_tests_properties(${target} PROPERTIES | ||
FAIL_REGULAR_EXPRESSION "TestFAILED" | ||
) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
!> Helper routines for testers | ||
module testhelper | ||
use libmpifx_module, only : mpifx_comm, mpifx_barrier, mpifx_finalize | ||
implicit none | ||
|
||
private | ||
public :: testReturn | ||
|
||
contains | ||
|
||
!> Return expected labels for ctest | ||
subroutine testReturn(mycomm, tPassed) | ||
|
||
type(mpifx_comm), intent(in) :: mycomm | ||
|
||
logical, intent(in) :: tPassed | ||
|
||
call mpifx_barrier(mycomm) | ||
|
||
if (tPassed) then | ||
if (mycomm%rank == 0) then | ||
! label for ctest regex | ||
write(*,*)'TestPASSED' | ||
end if | ||
else | ||
if (mycomm%rank == 0) then | ||
! label for ctest regex | ||
write(*,*)'TestFAILED' | ||
end if | ||
call mpifx_finalize() | ||
stop | ||
end if | ||
|
||
end subroutine testReturn | ||
|
||
end module testhelper |