Skip to content

Commit 63b4aa3

Browse files
authored
Merge branch 'master' into add-hpclinux-installer
2 parents f225c50 + 5915924 commit 63b4aa3

17 files changed

+1397
-348
lines changed

CMakeLists.txt

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ 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)
1414
endif()
15-
mark_as_advanced(RUN_DEVELOPER_TESTS)
15+
mark_as_advanced(CAF_RUN_DEVELOPER_TESTS)
1616

1717
if( NOT DEFINED ENV{OPENCOARRAYS_DEVELOPER})
1818
set ( ENV{OPENCOARRAYS_DEVELOPER} FALSE )
@@ -387,7 +387,7 @@ include(GNUInstallDirs)
387387
#-------------------------------
388388
# Recurse into the src directory
389389
#-------------------------------
390-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
390+
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src)
391391

392392
add_subdirectory(src)
393393

@@ -465,6 +465,24 @@ function(add_mpi_test name num_mpi_proc path)
465465
set_property(TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed.")
466466
endfunction(add_mpi_test)
467467

468+
function(add_fault_tolerant_mpi_test name num_mpi_proc path)
469+
if ( ((N LESS num_mpi_proc) OR (N EQUAL 0)) )
470+
message(STATUS "Test ${name} is oversubscribed: ${num_mpi_proc} ranks requested with ${N} system processor available.")
471+
if ( openmpi )
472+
if ( N LESS 2 )
473+
set( num_mpi_proc 2 )
474+
set (test_parameters --oversubscribe)
475+
else()
476+
set ( num_mpi_proc ${N} )
477+
endif()
478+
message( STATUS "Open-MPI detected, over-riding oversubscribed test, ${name}, with ${num_mpi_proc} ranks." )
479+
endif()
480+
endif()
481+
set(test_parameters ${test_parameters} ${MPIEXEC_NUMPROC_FLAG} ${num_mpi_proc} -disable-auto-cleanup )
482+
add_test(NAME ${name} COMMAND ${MPIEXEC} ${test_parameters} "${path}")
483+
set_property(TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed.")
484+
endfunction(add_fault_tolerant_mpi_test)
485+
468486
set(tests_root ${CMAKE_CURRENT_BINARY_DIR}/src/tests)
469487

470488

@@ -480,7 +498,7 @@ if(opencoarrays_aware_compiler)
480498
add_mpi_test(register_alloc_comp_1 2 ${tests_root}/unit/init_register/register_alloc_comp_1)
481499
add_mpi_test(register_alloc_comp_2 2 ${tests_root}/unit/init_register/register_alloc_comp_2)
482500
add_mpi_test(register_alloc_comp_3 2 ${tests_root}/unit/init_register/register_alloc_comp_3)
483-
if (RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER})
501+
if (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER})
484502
message ( STATUS "Running Developer tests is enabled." )
485503
add_mpi_test(async_comp_alloc 6 ${tests_root}/unit/init_register/async_comp_alloc)
486504
# Timeout async_comp_alloc test after 3 seconds to progess past the known failure
@@ -523,16 +541,34 @@ if(opencoarrays_aware_compiler)
523541
# GFortran PR 78505 only fixed on trunk/gcc 7
524542
add_mpi_test(source-alloc-no-sync 8 ${tests_root}/regression/reported/source-alloc-sync)
525543
endif()
526-
if (RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER})
544+
if (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER})
527545
add_mpi_test(convert-before-put 3 ${tests_root}/regression/reported/convert-before-put)
528546
endif()
529547
add_mpi_test(event-post 3 ${tests_root}/regression/reported/event-post)
530548
add_mpi_test(co_reduce-factorial 4 ${tests_root}/regression/reported/co_reduce-factorial)
531549
add_mpi_test(co_reduce-factorial-int8 4 ${tests_root}/regression/reported/co_reduce-factorial-int8)
532550
add_mpi_test(co_reduce-factorial-int64 4 ${tests_root}/regression/reported/co_reduce-factorial-int64)
533551
add_mpi_test(co_reduce_string 4 ${tests_root}/unit/collectives/co_reduce_string)
534-
# remove this before merging into master
535-
# set_property(TEST co_reduce-factorial PROPERTY WILL_FAIL TRUE)
552+
553+
# IMAGE FAIL tests
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()
536572
else()
537573
add_test(co_sum_extension ${tests_root}/unit/extensions/test-co_sum-extension.sh)
538574
set_property(TEST co_sum_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed.")

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)