Skip to content

Commit 06dc2e2

Browse files
committed
Merge branch 'master' into opencoarrays-teams
2 parents 33cc3ed + d8d38e4 commit 06dc2e2

32 files changed

+3963
-872
lines changed

.travis.yml

Lines changed: 14 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,17 @@ env:
99
- MPICH_VER="3.2"
1010
- MPICH_URL_HEAD="https://www.mpich.org/static/downloads/${MPICH_VER}"
1111
- MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
12-
- MPICH_DIR="${HOME}/.local/usr/mpich"
1312
- MPICH_GCC6_BOT_URL_HEAD="https://github.com/sourceryinstitute/OpenCoarrays/files/979804/"
1413
- MPICH_GCC7_BOT_URL_HEAD="https://github.com/sourceryinstitute/OpenCoarrays/files/976779/"
1514
- MPICH_BOT_URL_TAIL="mpich-3.2_3.yosemite.bottle.1.tar.gz"
1615
- BUILD_TYPES="Release Debug RelWithDebInfo CodeCoverage"
17-
matrix: # shellcheck installed manually below for macOS
18-
- GCC=6 OSX_PACKAGES="gcc@6 cmake"
19-
- GCC=7 OSX_PACKAGES="gcc cmake"
16+
matrix:
17+
- GCC=6 OSX_PACKAGES="gcc@6 shellcheck" BUILD_TYPE="InstallScript"
18+
- GCC="6 7" OSX_PACKAGES="gcc gcc@6 cmake shellcheck" BUILD_TYPE="cmake"
2019

2120
matrix:
2221
fast_finish: true
2322
include:
24-
- os: osx
25-
env:
26-
- BUILD_TYPE="InstallScript"
27-
OSX_PACKAGES="gcc@6"
28-
GCC=6
2923
- &ubuntu
3024
os: linux
3125
sudo: false
@@ -45,8 +39,6 @@ matrix:
4539
- gcc-6
4640
- gfortran-6
4741
- g++-6
48-
- binutils
49-
- cmake-data
5042
- cmake
5143
-
5244
<<: *ubuntu
@@ -59,8 +51,6 @@ matrix:
5951
- gcc-7
6052
- gfortran-7
6153
- g++-7
62-
- binutils
63-
- cmake-data
6454
- cmake
6555
-
6656
<<: *ubuntu
@@ -88,113 +78,20 @@ matrix:
8878
- *linux_allowed_failure
8979

9080
before_install:
91-
- export FC=gfortran-${GCC}
92-
- export CC=gcc-${GCC}
93-
- export CXX=g++-${GCC}
94-
- export MPICH_BOT_URL_HEAD=MPICH_GCC${GCC}_BOT_URL_HEAD
95-
- |
96-
if [[ (-n ${TRAVIS_TAG}) && (${TRAVIS_OS_NAME} == osx) ]] && ${TRAVIS_SECURE_ENV_VARS} ; then
97-
brew update > /dev/null
98-
brew ls --versions gpg2 >/dev/null || brew install gpg2
99-
brew outdated gpg2 || brew upgrade gpg2
100-
type -P openssl || brew install openssl
101-
fi
102-
if ! [[ "${TRAVIS_TAG}" ]] || ! ${TRAVIS_SECURE_ENV_VARS} ; then
103-
unset encrypted_ef4535c39461_key || true
104-
unset encrypted_ef4535c39461_iv || true
105-
rm subkey-328B3A0E-secret.asc{,.enc} || true
106-
107-
fi
108-
if [[ "${TRAVIS_TAG}" ]] ; then
109-
curl https://izaakbeekman.com/izaak.pubkey.txt | gpg --import
110-
git tag -v ${TRAVIS_TAG}
111-
fi
112-
- |
113-
if [[ (-n ${TRAVIS}) && (${TRAVIS_OS_NAME} == osx) ]]; then
114-
export PATH="${PATH}:${HOME}/Library/Python/2.7/bin"
115-
else
116-
[[ -d "${CACHE}/bin" ]] || mkdir -p "${CACHE}/bin"
117-
[[ -d "${MPICH_DIR}" ]] || mkdir -p "${MPICH_DIR}"
118-
export PATH="${CACHE}/bin:${PATH}"
119-
${FC} --version
120-
${CC} --version
121-
${CXX} --version
122-
fi
81+
- source developer-scripts/travis/before_install.all.sh
82+
- developer-scripts/travis/before_install.${TRAVIS_OS_NAME}.sh
12383

12484
install:
125-
- |
126-
if [[ (-n ${TRAVIS}) && (${TRAVIS_OS_NAME} == osx) ]]; then
127-
brew update > /dev/null
128-
129-
brew ls --versions shellcheck >/dev/null || brew install --force-bottle shellcheck
130-
brew outdated shellcheck || brew upgrade --force-bottle shellcheck
131-
for pkg in ${OSX_PACKAGES}; do
132-
brew ls --versions ${pkg} >/dev/null || brew install ${pkg} || brew link --overwrite ${pkg}
133-
brew outdated ${pkg} || brew upgrade ${pkg}
134-
done
135-
if [[ ${BUILD_TYPE} == InstallScript ]]; then # uninstall some stuff if present
136-
brew uninstall --force --ignore-dependencies cmake || true
137-
brew uninstall --force --ignore-dependencies mpich || true
138-
brew uninstall --force --ignore-dependencies openmpi || true
139-
else
140-
wget "${!MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}"
141-
brew install --force-bottle ${MPICH_BOT_URL_TAIL}
142-
brew ls --versions mpich >/dev/null || brew install --force-bottle mpich
143-
fi
144-
mpif90 --version || mpif90 -show || true
145-
mpicc --version || mpicc -show || true
146-
cmake --version || true
147-
148-
elif [[ ${BUILD_TYPE} != InstallScript ]]; then # Ubuntu on Travis-CI, NOT testing install.sh
149-
if ! [[ -x "${HOME}/.local/bin/mpif90" && -x "${HOME}/.local/bin/mpicc" ]]; then
150-
# mpich install not cached
151-
# could use prerequisites/build instead...
152-
wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
153-
mv "${MPICH_URL_TAIL}" "${MPICH_DIR}/.."
154-
pushd "${MPICH_DIR}/.."
155-
tar -xzvf "${MPICH_URL_TAIL}"
156-
cd "${MPICH_URL_TAIL%.tar.gz}"
157-
./configure --prefix="${MPICH_DIR}"
158-
make -j 4
159-
make install
160-
popd
161-
for f in "${MPICH_DIR}/bin/"*; do
162-
if [[ -x "${f}" ]]; then
163-
ln -fs "${f}" "${HOME}/.local/bin/${f##*/}"
164-
fi
165-
done
166-
fi
167-
mpif90 --version
168-
mpicc --version
169-
cmake --version
170-
fi
85+
- pwd
86+
- developer-scripts/travis/install.${TRAVIS_OS_NAME}.sh
17187

17288
script:
173-
- echo "In Travis-CI 'script' section."
174-
- |
175-
if [[ ${BUILD_TYPE} == InstallScript ]]; then
176-
./install.sh --yes-to-all -i "${HOME}/opencoarrays" -j 4 -f "$(type -P "${FC}")" -c "$(type -P "${CC}")" -C "$(type -P "${CXX}")"
177-
cd prerequisites/builds/opencoarrays/*
178-
../../../installations/cmake/*/bin/ctest --output-on-failure --schedule-random --repeat-until-fail ${NREPEAT:-5}
179-
cd -
180-
else
181-
mkdir cmake-build || echo "Cannot mkdir cmake-build"
182-
for BUILD_TYPE in ${BUILD_TYPES}; do
183-
rm -rf cmake-build/* || true
184-
cd cmake-build || echo 'cannot cd to cmake-build/'
185-
cmake -DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .. || echo "running cmake failed"
186-
make -j 4 || echo "running make failed"
187-
ctest --output-on-failure --schedule-random --repeat-until-fail ${NREPEAT:-5} --timeout ${TEST_TIMEOUT:-200}
188-
make install
189-
make uninstall
190-
cd ..
191-
done
192-
fi
89+
- pwd
90+
- developer-scripts/travis/test-script.${BUILD_TYPE:-cmake}.sh
19391

19492
after_script:
19593
- find . -name '*.gcno' -print
196-
- gcov-${GCC} --version
197-
- bash <(curl -s https://codecov.io/bash) -x $(type -P gcov-${GCC})
94+
- for version in ${GCC}; do bash <(curl -s https://codecov.io/bash) -x $(type -P gcov-${GCC}) ; done
19895
- |
19996
if [[ "${TRAVIS_TAG}" ]]; then
20097
if [[ "v${TRAVIS_TAG}" != "v$(sed -n '/[0-9]\{1,\}\(\.[0-9]\{1,\}\)\{1,\}/{s/^\([^.]*\)\([0-9]\{1,\}\(\.[0-9]\{1,\}\)\{1,\}\)\(.*\)/\2/p;q;}' .VERSION)" ]]; then
@@ -254,3 +151,7 @@ notifications:
254151
on_success: change # options: [always|never|change]
255152
on_failure: always
256153
on_start: always
154+
email:
155+
on_success: change
156+
on_failure: always
157+
on_start: never

CMakeLists.txt

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,16 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
586586
#---------------------------------------------------------------------------------------
587587

588588
# Determine if we're using Open MPI
589+
cmake_host_system_information(RESULT N_CPU QUERY NUMBER_OF_LOGICAL_CORES)
590+
cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME)
589591
execute_process(COMMAND ${MPIEXEC} --version
590592
OUTPUT_VARIABLE mpi_version_out)
591593
if (mpi_version_out MATCHES "[Oo]pen[ -][Mm][Pp][Ii]")
592594
message( STATUS "OpenMPI detected")
593595
set ( openmpi true )
596+
# Write out a host file because OMPI's mpiexec is dumb
597+
file(APPEND ${CMAKE_BINARY_DIR}/hostfile "${HOST_NAME} slots=${N_CPU}\n")
594598
endif ()
595-
596-
include( ProcessorCount )
597-
ProcessorCount(N_CPU)
598599
function(add_caf_test name num_caf_img test_target)
599600
# Function to add MPI tests.
600601
if(TARGET ${test_target})
@@ -607,6 +608,10 @@ function(add_caf_test name num_caf_img test_target)
607608
message( FATAL_ERROR "Test ${name} requires ${min_test_imgs} but was only given ${num_caf_images}" )
608609
endif()
609610
endif()
611+
# Add a host file for OMPI
612+
if ( openmpi )
613+
set(test_parameters --hostfile ${CMAKE_BINARY_DIR}/hostfile)
614+
endif()
610615
if ( ((N_CPU LESS num_caf_img) OR (N_CPU EQUAL 0)) )
611616
message(STATUS "Test ${name} is oversubscribed: ${num_caf_img} CAF images requested with ${N_CPU} system processor available.")
612617
if ( openmpi )
@@ -615,7 +620,7 @@ function(add_caf_test name num_caf_img test_target)
615620
elseif ( N_CPU LESS 2 )
616621
set( num_caf_img 2 )
617622
endif()
618-
set (test_parameters --oversubscribe)
623+
set (test_parameters ${test_parameters} --oversubscribe)
619624
message( STATUS "Open-MPI back end detected, passing --oversubscribe for oversubscribed test, ${name}, with ${num_caf_img} ranks/images." )
620625
endif()
621626
endif()
@@ -652,6 +657,7 @@ if(opencoarrays_aware_compiler)
652657
add_caf_test(async_comp_alloc_2 2 async_comp_alloc_2)
653658
add_caf_test(comp_allocated_1 2 comp_allocated_1)
654659
add_caf_test(comp_allocated_2 2 comp_allocated_2)
660+
add_caf_test(alloc_comp_get_convert_nums 2 alloc_comp_get_convert_nums)
655661
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8)
656662
add_caf_test(team_number 2 ${tests_root}/unit/teams/team_number)
657663
add_caf_test(get_communicator 3 ${tests_root}/unit/teams/get_communicator)
@@ -672,9 +678,18 @@ if(opencoarrays_aware_compiler)
672678
endif()
673679
if((NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.3.0) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
674680
add_caf_test(send_convert_char_array 2 send_convert_char_array)
675-
else()#if((CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
681+
add_caf_test(alloc_comp_send_convert_nums 2 alloc_comp_send_convert_nums)
682+
elseif((NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.4.0) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
683+
add_caf_test(send-strided-self 2 send-strided-self)
684+
endif()
685+
if((CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.3.0) AND (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
676686
message( AUTHOR_WARNING "Skipping the following tests to GFortran < 7.3.0 lack of compatibility:
677-
send_convert_char_array.f90")
687+
send_convert_char_array.f90
688+
alloc_comp_send_convert_nums.f90")
689+
endif()
690+
if((CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.4.0) AND (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
691+
message( AUTHOR_WARNING "Skipping the following test to GFortran < 7.4.0 lack of compatibility:
692+
send-strided-self.f90")
678693
endif()
679694
endif()
680695

@@ -759,8 +774,8 @@ if(opencoarrays_aware_compiler)
759774

760775
# IMAGE FAIL tests
761776
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
762-
add_caf_test(image_status_test_1 4 image_status_test_1)
763777
if(CAF_ENABLE_FAILED_IMAGES)
778+
add_caf_test(image_status_test_1 4 image_status_test_1)
764779
if ((NOT DEFINED ENV{TRAVIS}) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
765780
add_caf_test(image_fail_test_1 4 image_fail_test_1)
766781
set_property(TEST image_fail_test_1 PROPERTY FAIL_REGULAR_EXPRESSION "Test failed.")
@@ -795,3 +810,13 @@ endif()
795810

796811
include(cmake/AddInstallationScriptTest.cmake )
797812
add_installation_script_test(installation-scripts.sh src/tests/installation/)
813+
814+
# Lint the Travis-CI scripts
815+
set(TRAVIS_SCRIPTS
816+
install.linux.sh
817+
install.osx.sh
818+
test-script.InstallScript.sh
819+
test-script.cmake.sh)
820+
foreach(SCRIPT ${TRAVIS_SCRIPTS})
821+
lint_script("${CMAKE_SOURCE_DIR}/developer-scripts/travis" ${SCRIPT})
822+
endforeach()

0 commit comments

Comments
 (0)