Skip to content

Commit

Permalink
Removing support/test on windows for MPI functionalities
Browse files Browse the repository at this point in the history
see #34
  • Loading branch information
alexandrebouchard committed Mar 13, 2023
1 parent c513ee0 commit 4eb663c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 94 deletions.
92 changes: 0 additions & 92 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,46 +90,6 @@ jobs:
- uses: julia-actions/julia-runtest@latest


# test MicrosoftMPI by requesting it with MPIPreferences
# adapted from MPI.jl
test-MicrosoftMPI-jll:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - MicrosoftMPI_jll - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
version:
- '1.8'
os:
- windows-latest
arch:
- x64

fail-fast: false
env:
JULIA_MPI_TEST_BINARY: MicrosoftMPI_jll
JULIA_MPI_TEST_ABI: MicrosoftMPI
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1

- name: use MicrosoftMPI_jll
shell: julia --color=yes --project=test {0}
run: |
using Pkg
Pkg.instantiate()
using MPIPreferences
MPIPreferences.use_jll_binary("MicrosoftMPI_jll")
rm("test/Manifest.toml")
- uses: julia-actions/julia-runtest@latest


# test system MPI using Brew in macOS
# adapted from MPI.jl
test-system-MPI-brew:
Expand Down Expand Up @@ -181,58 +141,6 @@ jobs:
- uses: julia-actions/julia-runtest@v1


# # test system MPI using apt in ubuntu
# # adapted from MPI.jl
# # TODO: commented out because apt has older versions of MPICH and OMPI that
# # segfault with multithreading. Re-introduce them when apt pkgs are upgraded
# test-system-MPI-apt:
# name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.mpi }} - ${{ github.event_name }}
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# version:
# - '1.8'
# os:
# - ubuntu-latest
# mpi:
# - libmpich-dev
# env:
# JULIA_MPI_TEST_BINARY: system
# steps:
# - uses: actions/checkout@v3

# - name: Install MPI via apt
# run: |
# sudo apt-get update
# sudo apt-get install $MPI
# env:
# MPI: ${{ matrix.mpi }}

# - uses: actions/setup-java@v3
# with:
# distribution: 'temurin'
# java-version: '11'

# - uses: julia-actions/setup-julia@v1
# with:
# version: ${{ matrix.version }}
# arch: x64

# - uses: julia-actions/cache@v1

# - name: use system MPI
# shell: julia --color=yes --project=test {0}
# run: |
# using Pkg
# Pkg.instantiate()
# using MPIPreferences
# MPIPreferences.use_system_binary()
# rm("test/Manifest.toml")

# - uses: julia-actions/julia-runtest@v1


docs:
name: Documentation
runs-on: ubuntu-latest
Expand Down
10 changes: 10 additions & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function mpi_test(n_processes::Int, test_file::String; options = [])
n_processes = set_n_mpis_to_one_on_windows(n_processes)
jl_cmd = Base.julia_cmd()
project_folder = dirname(Base.current_project())
run(`$jl_cmd --project=$(project_folder) -e "using Pkg; Pkg.instantiate(); Pkg.precompile()"`)
Expand All @@ -15,6 +16,15 @@ function mpi_test(n_processes::Int, test_file::String; options = [])
end
end

function set_n_mpis_to_one_on_windows(default_n_mpis::Int)
if Sys.iswindows()
@info "MPI functionalities are not currently supported/tested on windows, see https://github.com/Julia-Tempering/Pigeons.jl/issues/34" maxlog=1
return 1
else
return default_n_mpis
end
end

function extra_mpi_args()
MPIPreferences.abi == "OpenMPI" ? `--oversubscribe` : ``
end
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ end
end
end



@testset "Parallelism Invariance" begin
n_mpis = 4
n_mpis = set_n_mpis_to_one_on_windows(4)
recorder_builders = [swap_acceptance_pr, index_process, log_sum_ratio, round_trip, energy_ac1]

# test swapper
Expand Down Expand Up @@ -130,7 +132,7 @@ end
end

@testset "Longer MPI" begin
n_mpis = Sys.iswindows() ? 1 : 4 # MPI on child process crashes on windows; see c016f59c84645346692f720854b7531743c728bf
n_mpis = set_n_mpis_to_one_on_windows(4)
recorder_builders = []
pigeons(
target = Pigeons.TestSwapper(0.5),
Expand Down

0 comments on commit 4eb663c

Please sign in to comment.