Skip to content

Commit ce20c6e

Browse files
committed
Update cis. Fix uninstall.
1 parent e17151c commit ce20c6e

File tree

6 files changed

+37
-10
lines changed

6 files changed

+37
-10
lines changed

.github/workflows/ci.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,40 @@ on: push
44

55
jobs:
66
Build:
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-24.10
88
strategy:
99
fail-fast: true
10+
matrix:
11+
mpi: [ 'openmpi', 'impi' ]
12+
# mpi: [ 'mpich', 'openmpi', 'impi' ]
13+
# mpich is borken on ubuntu-24.04LTS and 24.10 see https://bugs.launchpad.net/ubuntu/+source/mpich/+bug/2072338
1014

1115
env:
1216
FC: gfortran
13-
GCC_V: 11
17+
GCC_V: 13
1418

1519
steps:
1620
- name: Checkout code
1721
uses: actions/checkout@v3
1822

1923
- name: Install Dependencies
2024
run: |
21-
sudo apt install -y gfortran-${GCC_V} cmake mpich
25+
sudo apt install -y gfortran-${GCC_V} cmake
2226
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} 100
2327
28+
- name: Setup MPI ${{ matrix.mpi }}
29+
uses: mpi4py/setup-mpi@v1
30+
with:
31+
mpi: ${{ matrix.mpi }}
32+
2433
- name: Build and Test
2534
run: |
35+
mpirun --version
2636
mkdir build
2737
cmake -S . -B build -Wdev -DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" -DCMAKE_BUILD_TYPE:STRING="Debug" ..
2838
cmake --build build -j $(nproc)
2939
cmake --build build -t install -j $(nproc) || echo "installation failed"
3040
ctest --test-dir build --output-on-failure --schedule-random --repeat-until-fail 1 --timeout 200
3141
cd build
3242
make uninstall
43+
echo "Ran with mpi: ${{ matrix.mpi }}"

.github/workflows/win-ci.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,23 @@ jobs:
4242
ls "${I_MPI_ROOT}/bin"
4343
ls "${I_MPI_ROOT}"
4444
ls "${I_MPI_ROOT}/lib"
45-
mpifc.bat -show
46-
mpicc.bat -show
45+
ls "${I_MPI_ROOT}/env"
46+
# cat "${I_MPI_ROOT}/bin/mpifc.bat"
47+
# mpifc.bat -show
48+
# mpicc.bat -show
4749
mpifc.bat -version || echo "ifort not installed"
4850
mpicc.bat -version || echo "icc not installed"
4951
set +o verbose
52+
# echo The following environment variables are used:
53+
# echo CMPLR_ROOT Intel^(R^) Compiler installation directory path
54+
# echo I_MPI_ROOT Intel^(R^) MPI Library installation directory path
55+
# echo I_MPI_{FC,F77,F90} or MPICH_{FC,F77,F90}
56+
# echo the path/name of the underlying compiler to be used.
57+
# echo I_MPI_{FC,F77,F90}_PROFILE or MPI{FC,F77,F90}_PROFILE
58+
# echo name of profile file ^(without extension^)
59+
# echo I_MPI_COMPILER_CONFIG_DIR
60+
# echo folder which contains configuration files *.conf
61+
# echo VT_ROOT Intel^(R^) Trace Collector installation directory path
5062
5163
- name: Build and Test
5264
run: |

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -734,10 +734,11 @@ function(add_caf_test name num_caf_img test_target)
734734
endif()
735735
# Add a host file for OMPI
736736
get_property(openmpi GLOBAL PROPERTY openmpi)
737+
get_property(N_CPU GLOBAL PROPERTY N_CPU)
737738
if ( openmpi )
738739
set(test_parameters --hostfile ${CMAKE_BINARY_DIR}/hostfile)
739740
endif()
740-
if ( ((N_CPU LESS num_caf_img) OR (N_CPU EQUAL 0)) )
741+
if ( ( N_CPU LESS_EQUAL num_caf_img ) OR ( N_CPU EQUAL 0 ) )
741742
message(STATUS "Test ${name} is oversubscribed: ${num_caf_img} CAF images requested with ${N_CPU} system processor available.")
742743
if ( openmpi )
743744
if (min_test_imgs)

cmake/uninstall.cmake.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ endforeach()
1717
foreach(file ${files})
1818
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
1919
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
20-
exec_program(
21-
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
20+
execute_process(
21+
COMMAND "@CMAKE_COMMAND@" -E remove \"$ENV{DESTDIR}${file}\"
2222
OUTPUT_VARIABLE rm_out
23-
RETURN_VALUE rm_retval
23+
RESULT_VARIABLE rm_retval
2424
)
2525
if(NOT "${rm_retval}" STREQUAL 0)
2626
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")

src/runtime-libraries/mpi/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ install(TARGETS opencoarrays_mod caf_mpi caf_mpi_static EXPORT OpenCoarraysTarge
140140
# Determine if we're using Open MPI
141141
#----------------------------------
142142
cmake_host_system_information(RESULT N_CPU QUERY NUMBER_OF_LOGICAL_CORES)
143-
set(N_CPU ${N_CPU} PARENT_SCOPE)
143+
set_property(GLOBAL PROPERTY N_CPU ${N_CPU})
144144
cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME)
145145
set(HOST_NAME ${HOST_NAME} PARENT_SCOPE)
146146
execute_process(COMMAND ${MPIEXEC_EXECUTABLE} --version

src/runtime-libraries/mpi/mpi_caf.c

+3
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,9 @@ PREFIX(init)(int *argc, char ***argv)
881881
if (unlikely((ierr != MPI_SUCCESS)))
882882
caf_runtime_error("Failure when initializing MPI: %d", ierr);
883883

884+
ierr = MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
885+
chk_err(ierr);
886+
884887
/* Duplicate MPI_COMM_WORLD so that no CAF internal functions use it.
885888
* This is critical for MPI-interoperability. */
886889
rc = MPI_Comm_dup(MPI_COMM_WORLD, &CAF_COMM_WORLD);

0 commit comments

Comments
 (0)