Skip to content

Commit b8e9f56

Browse files
committed
Merge branch 'vehre/failed-images' of github.com:sourceryinstitute/opencoarrays into vehre/failed-images
2 parents 120210a + 9c6eb82 commit b8e9f56

File tree

9 files changed

+152
-83
lines changed

9 files changed

+152
-83
lines changed

CMakeLists.txt

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYP
88

99
# Add option and check environment to determine if developer tests should be run
1010
if($ENV{OPENCOARRAYS_DEVELOPER})
11-
option(RUN_DEVELOPER_TESTS "Run tests intended only for developers" ON)
11+
option(CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" ON)
1212
else()
13-
option(RUN_DEVELOPER_TESTS "Run tests intended only for developers" OFF)
13+
option(CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" OFF)
14+
endif()
15+
mark_as_advanced(CAF_RUN_DEVELOPER_TESTS)
16+
17+
if( NOT DEFINED ENV{OPENCOARRAYS_DEVELOPER})
18+
set ( ENV{OPENCOARRAYS_DEVELOPER} FALSE )
1419
endif()
15-
mark_as_advanced(RUN_DEVELOPER_TESTS)
1620

1721
# Name project and specify source languages
1822
# Parse version from .VERSION file so that more info can be added and easier to get from scripts
@@ -383,7 +387,7 @@ include(GNUInstallDirs)
383387
#-------------------------------
384388
# Recurse into the src directory
385389
#-------------------------------
386-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
390+
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src)
387391

388392
add_subdirectory(src)
389393

@@ -461,7 +465,7 @@ function(add_mpi_test name num_mpi_proc path)
461465
set_property(TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed.")
462466
endfunction(add_mpi_test)
463467

464-
function(add_mpi_failable_test name num_mpi_proc path)
468+
function(add_fault_tolerant_mpi_test name num_mpi_proc path)
465469
if ( ((N LESS num_mpi_proc) OR (N EQUAL 0)) )
466470
message(STATUS "Test ${name} is oversubscribed: ${num_mpi_proc} ranks requested with ${N} system processor available.")
467471
if ( openmpi )
@@ -477,7 +481,7 @@ function(add_mpi_failable_test name num_mpi_proc path)
477481
set(test_parameters ${test_parameters} ${MPIEXEC_NUMPROC_FLAG} ${num_mpi_proc} -disable-auto-cleanup )
478482
add_test(NAME ${name} COMMAND ${MPIEXEC} ${test_parameters} "${path}")
479483
set_property(TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed.")
480-
endfunction(add_mpi_failable_test)
484+
endfunction(add_fault_tolerant_mpi_test)
481485

482486
set(tests_root ${CMAKE_CURRENT_BINARY_DIR}/src/tests)
483487

@@ -494,7 +498,7 @@ if(opencoarrays_aware_compiler)
494498
add_mpi_test(register_alloc_comp_1 2 ${tests_root}/unit/init_register/register_alloc_comp_1)
495499
add_mpi_test(register_alloc_comp_2 2 ${tests_root}/unit/init_register/register_alloc_comp_2)
496500
add_mpi_test(register_alloc_comp_3 2 ${tests_root}/unit/init_register/register_alloc_comp_3)
497-
if (RUN_DEVELOPER_TESTS)
501+
if (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER})
498502
message ( STATUS "Running Developer tests is enabled." )
499503
add_mpi_test(async_comp_alloc 6 ${tests_root}/unit/init_register/async_comp_alloc)
500504
# Timeout async_comp_alloc test after 3 seconds to progess past the known failure
@@ -537,7 +541,7 @@ if(opencoarrays_aware_compiler)
537541
# GFortran PR 78505 only fixed on trunk/gcc 7
538542
add_mpi_test(source-alloc-no-sync 8 ${tests_root}/regression/reported/source-alloc-sync)
539543
endif()
540-
if (RUN_DEVELOPER_TESTS)
544+
if (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER})
541545
add_mpi_test(convert-before-put 3 ${tests_root}/regression/reported/convert-before-put)
542546
endif()
543547
add_mpi_test(event-post 3 ${tests_root}/regression/reported/event-post)
@@ -547,20 +551,24 @@ if(opencoarrays_aware_compiler)
547551
add_mpi_test(co_reduce_string 4 ${tests_root}/unit/collectives/co_reduce_string)
548552

549553
# IMAGE FAIL tests
550-
add_mpi_test(image_status_test_1 4 ${tests_root}/unit/fail_images/image_status_test_1)
551-
#ifdef WITH_FAIL_IMAGES
552-
# No other way to check that image_fail_test_1 passes.
553-
add_mpi_failable_test(image_fail_test_1 4 ${tests_root}/unit/fail_images/image_fail_test_1)
554-
set_property(TEST image_fail_test_1 PROPERTY FAIL_REGULAR_EXPRESSION "Test failed")
555-
set_property(TEST image_fail_test_1 PROPERTY PASS_REGULAR_EXPRESSION "Test passed")
556-
add_mpi_failable_test(image_fail_and_sync_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_sync_test_1)
557-
add_mpi_failable_test(image_fail_and_sync_test_2 4 ${tests_root}/unit/fail_images/image_fail_and_sync_test_2)
558-
add_mpi_failable_test(image_fail_and_sync_test_3 4 ${tests_root}/unit/fail_images/image_fail_and_sync_test_3)
559-
add_mpi_failable_test(image_fail_and_status_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_status_test_1)
560-
add_mpi_failable_test(image_fail_and_failed_images_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_failed_images_test_1)
561-
add_mpi_failable_test(image_fail_and_stopped_images_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_stopped_images_test_1)
562-
add_mpi_failable_test(image_fail_and_get_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_get_test_1)
563-
#endif
554+
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7)
555+
add_mpi_test(image_status_test_1 4 ${tests_root}/unit/fail_images/image_status_test_1)
556+
if(CAF_ENABLE_FAILED_IMAGES)
557+
# No other way to check that image_fail_test_1 passes.
558+
add_fault_tolerant_mpi_test(image_fail_test_1 4 ${tests_root}/unit/fail_images/image_fail_test_1)
559+
set_property(TEST image_fail_test_1 PROPERTY FAIL_REGULAR_EXPRESSION "Test failed")
560+
set_property(TEST image_fail_test_1 PROPERTY PASS_REGULAR_EXPRESSION "Test passed")
561+
add_fault_tolerant_mpi_test(image_fail_and_sync_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_sync_test_1)
562+
if (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER})
563+
add_fault_tolerant_mpi_test(image_fail_and_sync_test_2 4 ${tests_root}/unit/fail_images/image_fail_and_sync_test_2)
564+
endif()
565+
add_fault_tolerant_mpi_test(image_fail_and_sync_test_3 4 ${tests_root}/unit/fail_images/image_fail_and_sync_test_3)
566+
add_fault_tolerant_mpi_test(image_fail_and_status_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_status_test_1)
567+
add_fault_tolerant_mpi_test(image_fail_and_failed_images_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_failed_images_test_1)
568+
add_fault_tolerant_mpi_test(image_fail_and_stopped_images_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_stopped_images_test_1)
569+
add_fault_tolerant_mpi_test(image_fail_and_get_test_1 4 ${tests_root}/unit/fail_images/image_fail_and_get_test_1)
570+
endif()
571+
endif()
564572
else()
565573
add_test(co_sum_extension ${tests_root}/unit/extensions/test-co_sum-extension.sh)
566574
set_property(TEST co_sum_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed.")

INSTALL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ export gcc_install_path=/desired/installation/destination
391391

392392
[URLs]: #
393393

394+
[linuxbrew]: http://linuxbrew.sh
394395
[APT package]: https://qa.debian.org/popcon.php?package=open-coarrays
395396
[HPCLinux]: http://www.paratools.com/hpclinux/
396397
[Brewfile]: https://github.com/sourceryinstitute/OpenCoarrays/blob/master/Brewfile

cmake/AddInstallationScriptTest.cmake

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
macro(add_installation_script_test name path)
22

33
# Copy the source to the binary tree
4-
configure_file(
5-
${CMAKE_CURRENT_SOURCE_DIR}/${path}/${name}
6-
${CMAKE_CURRENT_BINARY_DIR}/${path}/${name}
7-
COPYONLY
4+
file( COPY "${CMAKE_CURRENT_SOURCE_DIR}/${path}/${name}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${path}"
5+
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
6+
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
87
)
9-
configure_file(
10-
${CMAKE_CURRENT_SOURCE_DIR}/${path}/${name}-usage
11-
${CMAKE_CURRENT_BINARY_DIR}/${path}/${name}-usage
12-
COPYONLY
8+
file( COPY "${CMAKE_CURRENT_SOURCE_DIR}/${path}/${name}-usage" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${path}"
9+
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
1310
)
1411
add_test(NAME test-${name} COMMAND "${CMAKE_BINARY_DIR}/${path}/${name}")
1512
set_property(TEST test-${name} PROPERTY WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${path}")

prerequisites/install-functions/report_results.sh

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
# shellcheck shell=bash disable=SC2154,SC2129,SC2148
22
report_results()
33
{
4-
type_FC=`type ${FC}`
5-
fully_qualified_FC="/${type_FC#*/}"
4+
fully_qualified_FC="$(type -P "${FC}")"
65
if [[ ${fully_qualified_FC} != *gfortran* ]]; then
76
emergency "report_results.sh: non-gfortran compiler: \${fully_qualified_FC}=${fully_qualified_FC}"
8-
fi
7+
fi
98
# Set path_to_FC fully-qualified gfortran location
10-
compiler_install_root="${fully_qualified_FC%%bin/gfortran*}"
9+
compiler_install_root="${fully_qualified_FC%bin/gfortran*}"
1110

12-
type_MPIFC=`type ${MPIFC}`
13-
fully_qualified_MPIFC="/${type_MPIFC#*/}"
14-
mpi_install_root="${fully_qualified_MPIFC%%bin/mpif90*}"
11+
fully_qualified_MPIFC="$(type -P "${MPIFC}")"
12+
mpi_install_root="${fully_qualified_MPIFC%bin/mpif90*}"
1513

16-
type_CMAKE=`type ${CMAKE}`
17-
fully_qualified_CMAKE="/${type_CMAKE#*/}"
18-
cmake_install_path="${fully_qualified_CMAKE%%/cmake*}"
14+
fully_qualified_CMAKE="$(type -P "${CMAKE}")"
15+
cmake_install_path="${fully_qualified_CMAKE%/cmake*}"
1916

2017
# Report installation success or failure and record locations for software stack:
2118
if [[ -x "${install_path%/}/bin/caf" && -x "${install_path%/}/bin/cafrun" ]]; then
@@ -35,51 +32,51 @@ report_results()
3532
${SUDO:-} rm setup.csh
3633
fi
3734
# Prepend the OpenCoarrays license to the setup.sh script:
38-
while IFS='' read -r line || [[ -n "$line" ]]; do
39-
echo "# $line" >> setup.sh
35+
while IFS='' read -r line || [[ -n "${line}" ]]; do
36+
echo "# ${line}" >> setup.sh
4037
done < "${opencoarrays_src_dir}/LICENSE"
41-
while IFS='' read -r line || [[ -n "$line" ]]; do
42-
echo "# $line" >> setup.csh
38+
while IFS='' read -r line || [[ -n "${line}" ]]; do
39+
echo "# ${line}" >> setup.csh
4340
done < "${opencoarrays_src_dir}/LICENSE"
4441
echo "# " | tee -a setup.csh setup.sh
4542
echo "# Execute this script via the following command: " | tee -a setup.csh setup.sh
4643
echo "# source ${install_path%/}/setup.sh " | tee -a setup.csh setup.sh
4744
echo " " | tee -a setup.csh setup.sh
48-
if [[ -x "$cmake_install_path/cmake" ]]; then
45+
if [[ -x "${cmake_install_path}/cmake" ]]; then
4946
echo "# Prepend the CMake path to the PATH environment variable:" | tee -a setup.sh setup.csh
50-
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
47+
echo "if [[ -z \"\${PATH}\" ]]; then " >> setup.sh
5148
echo " export PATH=\"${cmake_install_path%/}/\" " >> setup.sh
5249
echo "else " >> setup.sh
53-
echo " export PATH=\"${cmake_install_path%/}/\":\$PATH " >> setup.sh
50+
echo " export PATH=\"${cmake_install_path%/}/\":\${PATH} " >> setup.sh
5451
echo "fi " >> setup.sh
5552
echo "set path = (\"${cmake_install_path%/}\"/\"\$path\") " >> setup.csh
5653
fi
57-
if [[ -x "$fully_qualified_FC" ]]; then
54+
if [[ -x "${fully_qualified_FC}" ]]; then
5855
echo "# Prepend the compiler path to the PATH environment variable:" | tee -a setup.sh setup.csh
59-
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
56+
echo "if [[ -z \"\${PATH}\" ]]; then " >> setup.sh
6057
echo " export PATH=\"${compiler_install_root%/}/bin\" " >> setup.sh
6158
echo "else " >> setup.sh
62-
echo " export PATH=\"${compiler_install_root%/}/bin:\$PATH\" " >> setup.sh
59+
echo " export PATH=\"${compiler_install_root%/}/bin:\${PATH}\" " >> setup.sh
6360
echo "fi " >> setup.sh
6461
echo "set path = (\"${compiler_install_root%/}\"/bin \"\$path\") " >> setup.csh
6562
fi
6663
if [[ -d "${compiler_install_root%/}/lib" || -d "${compiler_install_root%/}/lib64" ]]; then
6764
echo "# Prepend the compiler library paths to the LD_LIBRARY_PATH environment variable:" | tee -a setup.sh setup.csh
6865
compiler_lib_paths="${compiler_install_root%/}/lib64/:${compiler_install_root%/}/lib"
69-
echo "if [[ -z \"\$LD_LIBRARY_PATH\" ]]; then " >> setup.sh
66+
echo "if [[ -z \"\${LD_LIBRARY_PATH}\" ]]; then " >> setup.sh
7067
echo " export LD_LIBRARY_PATH=\"${compiler_lib_paths%/}\" " >> setup.sh
7168
echo "else " >> setup.sh
72-
echo " export LD_LIBRARY_PATH=\"${compiler_lib_paths%/}:\$LD_LIBRARY_PATH\" " >> setup.sh
69+
echo " export LD_LIBRARY_PATH=\"${compiler_lib_paths%/}:\${LD_LIBRARY_PATH}\" " >> setup.sh
7370
echo "fi " >> setup.sh
7471
echo "set LD_LIBRARY_PATH = (\"${compiler_lib_paths%/}\"/bin \"\$LD_LIBRARY_PATH\") " >> setup.csh
7572
fi
7673
echo " " >> setup.sh
77-
if [[ -x "$mpi_install_root/bin/mpif90" ]]; then
74+
if [[ -x "${mpi_install_root}/bin/mpif90" ]]; then
7875
echo "# Prepend the MPI path to the PATH environment variable:" | tee -a setup.sh setup.csh
79-
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
76+
echo "if [[ -z \"\${PATH}\" ]]; then " >> setup.sh
8077
echo " export PATH=\"${mpi_install_root%/}/bin\" " >> setup.sh
8178
echo "else " >> setup.sh
82-
echo " export PATH=\"${mpi_install_root%/}/bin\":\$PATH " >> setup.sh
79+
echo " export PATH=\"${mpi_install_root%/}/bin\":\${PATH} " >> setup.sh
8380
echo "fi " >> setup.sh
8481
echo "set path = (\"${mpi_install_root%/}\"/bin \"\$path\") " >> setup.csh
8582
fi
@@ -91,52 +88,52 @@ report_results()
9188
# the system versions of these packages are present and in the user's path or that the
9289
# user doesn't need them at all (e.g. there was no need to build gfortran from source).
9390
flex_install_path=$("${build_script}" -P flex)
94-
if [[ -x "$flex_install_path/bin/flex" ]]; then
91+
if [[ -x "${flex_install_path}/bin/flex" ]]; then
9592
echo "# Prepend the flex path to the PATH environment variable:" | tee -a setup.sh setup.csh
96-
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
97-
echo " export PATH=\"$flex_install_path/bin\" " >> setup.sh
93+
echo "if [[ -z \"\${PATH}\" ]]; then " >> setup.sh
94+
echo " export PATH=\"${flex_install_path}/bin\" " >> setup.sh
9895
echo "else " >> setup.sh
99-
echo " export PATH=\"$flex_install_path/bin\":\$PATH " >> setup.sh
96+
echo " export PATH=\"${flex_install_path}/bin\":\${PATH} " >> setup.sh
10097
echo "set path = (\"$flex_install_path\"/bin \"\$path\") " >> setup.csh
10198
echo "fi " >> setup.sh
10299
fi
103100
bison_install_path=$("${build_script}" -P bison)
104-
if [[ -x "$bison_install_path/bin/yacc" ]]; then
101+
if [[ -x "${bison_install_path}/bin/yacc" ]]; then
105102
echo "# Prepend the bison path to the PATH environment variable:" | tee -a setup.sh setup.csh
106-
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
107-
echo " export PATH=\"$bison_install_path/bin\" " >> setup.sh
103+
echo "if [[ -z \"\${PATH}\" ]]; then " >> setup.sh
104+
echo " export PATH=\"${bison_install_path}/bin\" " >> setup.sh
108105
echo "else " >> setup.sh
109-
echo " export PATH=\"$bison_install_path/bin\":\$PATH " >> setup.sh
106+
echo " export PATH=\"${bison_install_path}/bin\":\${PATH} " >> setup.sh
110107
echo "fi " >> setup.sh
111108
echo "set path = (\"$bison_install_path\"/bin \"\$path\") " >> setup.csh
112109
fi
113110
m4_install_path=$("${build_script}" -P m4)
114-
if [[ -x "$m4_install_path/bin/m4" ]]; then
111+
if [[ -x "${m4_install_path}/bin/m4" ]]; then
115112
echo "# Prepend the m4 path to the PATH environment variable:" | tee -a setup.sh setup.csh
116-
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
117-
echo " export PATH=\"$m4_install_path/bin\" " >> setup.sh
113+
echo "if [[ -z \"\${PATH}\" ]]; then " >> setup.sh
114+
echo " export PATH=\"${m4_install_path}/bin\" " >> setup.sh
118115
echo "else " >> setup.sh
119-
echo " export PATH=\"$m4_install_path/bin\":\$PATH " >> setup.sh
116+
echo " export PATH=\"${m4_install_path}/bin\":\${PATH} " >> setup.sh
120117
echo "fi " >> setup.sh
121118
echo "set path = (\"$m4_install_path\"/bin \"\$path\") " >> setup.csh
122119
fi
123120
opencoarrays_install_path="${install_path}"
124-
if [[ -x "$opencoarrays_install_path/bin/caf" ]]; then
121+
if [[ -x "${opencoarrays_install_path}/bin/caf" ]]; then
125122
echo "# Prepend the OpenCoarrays path to the PATH environment variable:" | tee -a setup.sh setup.csh
126-
echo "if [[ -z \"\$PATH\" ]]; then " >> setup.sh
123+
echo "if [[ -z \"\${PATH}\" ]]; then " >> setup.sh
127124
echo " export PATH=\"${opencoarrays_install_path%/}/bin\" " >> setup.sh
128125
echo "else " >> setup.sh
129-
echo " export PATH=\"${opencoarrays_install_path%/}/bin\":\$PATH " >> setup.sh
126+
echo " export PATH=\"${opencoarrays_install_path%/}/bin\":\${PATH} " >> setup.sh
130127
echo "fi " >> setup.sh
131128
echo "set path = (\"${opencoarrays_install_path%/}\"/bin \"\$path\") " >> setup.csh
132129
fi
133-
if ${SUDO:-} mv setup.sh "$opencoarrays_install_path"; then
134-
setup_sh_location=$opencoarrays_install_path
130+
if ${SUDO:-} mv setup.sh "${opencoarrays_install_path}"; then
131+
setup_sh_location=${opencoarrays_install_path}
135132
else
136133
setup_sh_location=${PWD}
137134
fi
138-
if ${SUDO:-} mv setup.csh "$opencoarrays_install_path"; then
139-
setup_csh_location=$opencoarrays_install_path
135+
if ${SUDO:-} mv setup.csh "${opencoarrays_install_path}"; then
136+
setup_csh_location=${opencoarrays_install_path}
140137
else
141138
setup_csh_location=${PWD}
142139
fi
@@ -156,10 +153,10 @@ report_results()
156153
echo "OpenCoarrays compiler wrapper (caf), program launcher (cafrun), or prerequisite"
157154
echo "package installer (build), or these programs are not in the following, expected"
158155
echo "location:"
159-
echo "$install_path/bin."
156+
echo "${install_path}/bin."
160157
echo "Please review the following file for more information:"
161-
echo "$install_path/$installation_record"
162-
echo "and submit an bug report at https://github.com/sourceryinstitute/opencoarrays/issues"
158+
echo "${install_path}/${installation_record}"
159+
echo "and submit an bug report at https://github.com/sourceryinstitute/opencoarrays/issues/new"
163160
echo "[exit 100]"
164161
exit 100
165162

0 commit comments

Comments
 (0)