Skip to content

Commit

Permalink
Update cis. Fix uninstall.
Browse files Browse the repository at this point in the history
  • Loading branch information
vehre committed Feb 11, 2025
1 parent e17151c commit 0001080
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,37 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
mpi: [ 'openmpi', 'impi' ]
# mpi: [ 'mpich', 'openmpi', 'impi' ]
# mpich is borken on ubuntu-24.04LTS and 24.10 see https://bugs.launchpad.net/ubuntu/+source/mpich/+bug/2072338

env:
FC: gfortran
GCC_V: 11
GCC_V: 13

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Dependencies
run: |
sudo apt install -y gfortran-${GCC_V} cmake mpich
sudo apt install -y gfortran-${GCC_V} cmake
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} 100
- name: Setup MPI ${{ matrix.mpi }}
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}

- name: Build and Test
run: |
mpirun --version
mkdir build
cmake -S . -B build -Wdev -DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" -DCMAKE_BUILD_TYPE:STRING="Debug" ..
cmake --build build -j $(nproc)
cmake --build build -t install -j $(nproc) || echo "installation failed"
ctest --test-dir build --output-on-failure --schedule-random --repeat-until-fail 1 --timeout 200
cd build
make uninstall
echo "Ran with mpi: ${{ matrix.mpi }}"
16 changes: 14 additions & 2 deletions .github/workflows/win-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@ jobs:
ls "${I_MPI_ROOT}/bin"
ls "${I_MPI_ROOT}"
ls "${I_MPI_ROOT}/lib"
mpifc.bat -show
mpicc.bat -show
ls "${I_MPI_ROOT}/env"
# cat "${I_MPI_ROOT}/bin/mpifc.bat"
# mpifc.bat -show
# mpicc.bat -show
mpifc.bat -version || echo "ifort not installed"
mpicc.bat -version || echo "icc not installed"
set +o verbose
# echo The following environment variables are used:
# echo CMPLR_ROOT Intel^(R^) Compiler installation directory path
# echo I_MPI_ROOT Intel^(R^) MPI Library installation directory path
# echo I_MPI_{FC,F77,F90} or MPICH_{FC,F77,F90}
# echo the path/name of the underlying compiler to be used.
# echo I_MPI_{FC,F77,F90}_PROFILE or MPI{FC,F77,F90}_PROFILE
# echo name of profile file ^(without extension^)
# echo I_MPI_COMPILER_CONFIG_DIR
# echo folder which contains configuration files *.conf
# echo VT_ROOT Intel^(R^) Trace Collector installation directory path
- name: Build and Test
run: |
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,11 @@ function(add_caf_test name num_caf_img test_target)
endif()
# Add a host file for OMPI
get_property(openmpi GLOBAL PROPERTY openmpi)
get_property(N_CPU GLOBAL PROPERTY N_CPU)
if ( openmpi )
set(test_parameters --hostfile ${CMAKE_BINARY_DIR}/hostfile)
set(test_parameters --hostfile ${CMAKE_BINARY_DIR}/hostfile --mca osc rdma)
endif()
if ( ((N_CPU LESS num_caf_img) OR (N_CPU EQUAL 0)) )
if ( ( N_CPU LESS_EQUAL num_caf_img ) OR ( N_CPU EQUAL 0 ) )
message(STATUS "Test ${name} is oversubscribed: ${num_caf_img} CAF images requested with ${N_CPU} system processor available.")
if ( openmpi )
if (min_test_imgs)
Expand Down
6 changes: 3 additions & 3 deletions cmake/uninstall.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ endforeach()
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove \"$ENV{DESTDIR}${file}\"
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
RESULT_VARIABLE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
Expand Down
2 changes: 1 addition & 1 deletion src/runtime-libraries/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ install(TARGETS opencoarrays_mod caf_mpi caf_mpi_static EXPORT OpenCoarraysTarge
# Determine if we're using Open MPI
#----------------------------------
cmake_host_system_information(RESULT N_CPU QUERY NUMBER_OF_LOGICAL_CORES)
set(N_CPU ${N_CPU} PARENT_SCOPE)
set_property(GLOBAL PROPERTY N_CPU ${N_CPU})
cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME)
set(HOST_NAME ${HOST_NAME} PARENT_SCOPE)
execute_process(COMMAND ${MPIEXEC_EXECUTABLE} --version
Expand Down
3 changes: 3 additions & 0 deletions src/runtime-libraries/mpi/mpi_caf.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,9 @@ PREFIX(init)(int *argc, char ***argv)
if (unlikely((ierr != MPI_SUCCESS)))
caf_runtime_error("Failure when initializing MPI: %d", ierr);

ierr = MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
chk_err(ierr);

/* Duplicate MPI_COMM_WORLD so that no CAF internal functions use it.
* This is critical for MPI-interoperability. */
rc = MPI_Comm_dup(MPI_COMM_WORLD, &CAF_COMM_WORLD);
Expand Down

0 comments on commit 0001080

Please sign in to comment.