Skip to content

Fix send_by_ref by modelling it like get_by_ref. #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/ci.yml → .github/workflows/ci-ubuntu-22.04.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: CI
name: Ubuntu 22.04 CI

on: push

jobs:
Build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
mpi: [ 'mpich', 'impi' ]
# mpi: [ 'mpich', 'openmpi', 'impi' ]
# openmpi is borken on ubuntu-22.04 and above see https://github.com/open-mpi/ompi/issues/10726

env:
FC: gfortran
Expand All @@ -18,15 +22,22 @@ jobs:

- 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 }}"
45 changes: 45 additions & 0 deletions .github/workflows/ci-ubuntu-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Ubuntu latest CI

on: push

jobs:
Build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
mpi: [ '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
# openmpi is borken on ubuntu-24.04LTS and 24.10 see https://github.com/open-mpi/ompi/issues/10726
# ubuntu 24.10 is not available as github runner, so we are left with Intel's mpi for now.

env:
FC: gfortran
GCC_V: 13

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

- name: Install Dependencies
run: |
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: 4 additions & 1 deletion 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)
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 Expand Up @@ -950,6 +951,8 @@ if(opencoarrays_aware_compiler)
add_caf_test(issue-700-allow-multiple-scalar-dim-array-gets 2 issue-700-allow-multiple-scalar-dim-array-gets)
add_caf_test(issue-762-mpi-crashing-on-exit 2 issue-762-mpi-crashing-on-exit)

add_caf_test(issue-654-send_by_ref_rank_2 3 issue-654-send_by_ref_rank_2)

# IMAGE FAIL tests
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
if(CAF_ENABLE_FAILED_IMAGES)
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
Loading