From 7c3ab4ddfcb34b0e3952ff7b3a2fcd8ff141fe9a Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Sun, 23 Jan 2022 17:26:26 +0100 Subject: [PATCH 01/11] Make mump-related bindings optional. --- src/PETSC.jl | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/PETSC.jl b/src/PETSC.jl index 22cf185..d41a349 100644 --- a/src/PETSC.jl +++ b/src/PETSC.jl @@ -65,6 +65,33 @@ macro wrapper(fn,rt,argts,args,url) esc(expr) end +macro wrapper_no_preload(fn,rt,argts,args,url) + hn = Symbol("$(fn.value)_handle") + sargs = "$(args)" + if length(args.args) == 1 + sargs = sargs[1:end-2]*")" + end + if isempty(rstrip(url)) + str = """ + $(fn.value)$(sargs) + """ + else + str = """ + $(fn.value)$(sargs) + + See [PETSc manual]($url). + """ + end + expr = quote + @doc $str + @inline function $(fn.value)($(args.args...)) + $(hn) = Libdl.dlsym(libpetsc_handle[],$(fn)) + ccall($(hn),$rt,$argts,$(args.args...)) + end + end + esc(expr) +end + #Petsc init related functions @wrapper(:PetscInitializeNoArguments,PetscErrorCode,(),(),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInitializeNoArguments.html") @@ -466,8 +493,8 @@ Base.convert(::Type{Mat},p::Ptr{Cvoid}) = Mat(p) @wrapper(:MatZeroEntries,PetscErrorCode,(Mat,),(mat,),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatZeroEntries.html") @wrapper(:MatCopy,PetscErrorCode,(Mat,Mat,MatStructure),(A,B,str),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCopy.html") @wrapper(:MatSetBlockSize,PetscErrorCode,(Mat,PetscInt),(mat,bs),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetBlockSize.html") -@wrapper(:MatMumpsSetIcntl,PetscErrorCode,(Mat,PetscInt,PetscInt),(mat,icntl,val),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMumpsSetIcntl.html") -@wrapper(:MatMumpsSetCntl,PetscErrorCode,(Mat,PetscInt,PetscReal),(mat,icntl,val),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMumpsSetCntl.html") +@wrapper_no_preload(:MatMumpsSetIcntl,PetscErrorCode,(Mat,PetscInt,PetscInt),(mat,icntl,val),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMumpsSetIcntl.html") +@wrapper_no_preload(:MatMumpsSetCntl,PetscErrorCode,(Mat,PetscInt,PetscReal),(mat,icntl,val),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMumpsSetCntl.html") # Null space related From 82a3e0b90ae37015d3819534fb74df1b2b37ed5d Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Sun, 23 Jan 2022 17:35:26 +0100 Subject: [PATCH 02/11] Revert "Make mump-related bindings optional." This reverts commit 7c3ab4ddfcb34b0e3952ff7b3a2fcd8ff141fe9a. --- src/PETSC.jl | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/PETSC.jl b/src/PETSC.jl index d41a349..22cf185 100644 --- a/src/PETSC.jl +++ b/src/PETSC.jl @@ -65,33 +65,6 @@ macro wrapper(fn,rt,argts,args,url) esc(expr) end -macro wrapper_no_preload(fn,rt,argts,args,url) - hn = Symbol("$(fn.value)_handle") - sargs = "$(args)" - if length(args.args) == 1 - sargs = sargs[1:end-2]*")" - end - if isempty(rstrip(url)) - str = """ - $(fn.value)$(sargs) - """ - else - str = """ - $(fn.value)$(sargs) - - See [PETSc manual]($url). - """ - end - expr = quote - @doc $str - @inline function $(fn.value)($(args.args...)) - $(hn) = Libdl.dlsym(libpetsc_handle[],$(fn)) - ccall($(hn),$rt,$argts,$(args.args...)) - end - end - esc(expr) -end - #Petsc init related functions @wrapper(:PetscInitializeNoArguments,PetscErrorCode,(),(),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInitializeNoArguments.html") @@ -493,8 +466,8 @@ Base.convert(::Type{Mat},p::Ptr{Cvoid}) = Mat(p) @wrapper(:MatZeroEntries,PetscErrorCode,(Mat,),(mat,),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatZeroEntries.html") @wrapper(:MatCopy,PetscErrorCode,(Mat,Mat,MatStructure),(A,B,str),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCopy.html") @wrapper(:MatSetBlockSize,PetscErrorCode,(Mat,PetscInt),(mat,bs),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetBlockSize.html") -@wrapper_no_preload(:MatMumpsSetIcntl,PetscErrorCode,(Mat,PetscInt,PetscInt),(mat,icntl,val),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMumpsSetIcntl.html") -@wrapper_no_preload(:MatMumpsSetCntl,PetscErrorCode,(Mat,PetscInt,PetscReal),(mat,icntl,val),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMumpsSetCntl.html") +@wrapper(:MatMumpsSetIcntl,PetscErrorCode,(Mat,PetscInt,PetscInt),(mat,icntl,val),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMumpsSetIcntl.html") +@wrapper(:MatMumpsSetCntl,PetscErrorCode,(Mat,PetscInt,PetscReal),(mat,icntl,val),"https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMumpsSetCntl.html") # Null space related From 948b8005bedbf96a1da67e12f562eea5d7a87b61 Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Sun, 23 Jan 2022 17:57:32 +0100 Subject: [PATCH 03/11] Allow for missing symbols --- src/GridapPETSc.jl | 5 ++++- src/PETSC.jl | 2 ++ test/PLaplacianTests.jl | 32 ++++++++++++++++++++++++-------- test/PoissonTests.jl | 22 ++++++++++++++++++++-- 4 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/GridapPETSc.jl b/src/GridapPETSc.jl index dbdd563..defef13 100644 --- a/src/GridapPETSc.jl +++ b/src/GridapPETSc.jl @@ -59,7 +59,10 @@ function __init__() libpetsc_handle[] = PETSc_jll.libpetsc_handle end for (handle,sym) in _PRELOADS - handle[] = Libdl.dlsym(libpetsc_handle[],sym) + _handle = Libdl.dlsym(libpetsc_handle[],sym;throw_error=false) + if _handle !== nothing + handle[] = _handle + end end end diff --git a/src/PETSC.jl b/src/PETSC.jl index 22cf185..bafe44c 100644 --- a/src/PETSC.jl +++ b/src/PETSC.jl @@ -18,6 +18,7 @@ module PETSC using Libdl using GridapPETSc: libpetsc_handle using GridapPETSc: _PRELOADS +using Gridap.Helpers: @check using MPI include("Config.jl") @@ -59,6 +60,7 @@ macro wrapper(fn,rt,argts,args,url) push!(_PRELOADS,($hn,$fn)) @doc $str @inline function $(fn.value)($(args.args...)) + @check $(hn)[] != C_NULL "Missing symbol. Re-configure and compile PETSc." ccall($(hn)[],$rt,$argts,$(args.args...)) end end diff --git a/test/PLaplacianTests.jl b/test/PLaplacianTests.jl index fa306b6..057873c 100644 --- a/test/PLaplacianTests.jl +++ b/test/PLaplacianTests.jl @@ -3,6 +3,7 @@ using Gridap.Algebra using GridapDistributed using PartitionedArrays using GridapPETSc +using GridapPETSc: PETSC using Test @@ -26,17 +27,28 @@ function mysnessetup(snes) @check_error_code GridapPETSc.PETSC.MatMumpsSetCntl(mumpsmat[], 3, 1.0e-6) end - function main(parts) - options = "-snes_type newtonls -snes_linesearch_type basic -snes_linesearch_damping 1.0 -snes_rtol 1.0e-14 -snes_atol 0.0 -snes_monitor -snes_converged_reason" + main(parts,:gmres) + if PETSC.MatMumpsSetIcntl_handle[] != C_NULL + main(parts,:mumps) + end +end +function main(parts,solver) + if solver == :mumps + options = "-snes_type newtonls -snes_linesearch_type basic -snes_linesearch_damping 1.0 -snes_rtol 1.0e-14 -snes_atol 0.0 -snes_monitor -snes_converged_reason" + elseif solver == :gmres + options = "-snes_type newtonls -snes_linesearch_type basic -snes_linesearch_damping 1.0 -snes_rtol 1.0e-14 -snes_atol 0.0 -snes_monitor -pc_type jacobi -ksp_type gmres -ksp_monitor -snes_converged_reason" + else + error() + end GridapPETSc.with(args=split(options)) do - main(parts,FullyAssembledRows()) - main(parts,SubAssembledRows()) + main(parts,solver,FullyAssembledRows()) + main(parts,solver,SubAssembledRows()) end end -function main(parts,strategy) +function main(parts,solver,strategy) domain = (0,4,0,4) cells = (100,100) @@ -69,9 +81,13 @@ function main(parts,strategy) # fill!(x,1) # @test (norm(A*x-_A*x)+1) ≈ 1 - nls = PETScNonlinearSolver(mysnessetup) - solver = FESolver(nls) - uh = solve(solver,op) + if solver == :mumps + nls = PETScNonlinearSolver(mysnessetup) + else + nls = PETScNonlinearSolver() + end + fesolver = FESolver(nls) + uh = solve(fesolver,op) Ωo = Triangulation(model) dΩo = Measure(Ωo,2*k) diff --git a/test/PoissonTests.jl b/test/PoissonTests.jl index 761ac77..4100a7a 100644 --- a/test/PoissonTests.jl +++ b/test/PoissonTests.jl @@ -4,6 +4,7 @@ using Gridap.Algebra using Gridap.FESpaces using GridapDistributed using GridapPETSc +using GridapPETSc: PETSC using PartitionedArrays using Test @@ -25,7 +26,20 @@ function mykspsetup(ksp) end function main(parts) - options = "-info -ksp_error_if_not_converged true" + main(parts,:cg) + if PETSC.MatMumpsSetIcntl_handle[] != C_NULL + main(parts,:mumps) + end +end + +function main(parts,solver) + if solver == :mumps + options = "-info -ksp_error_if_not_converged true" + elseif solver == :cg + options = "-info -pc_type jacobi -ksp_type cg -ksp_monitor -ksp_rtol 1.0e-12" + else + error() + end GridapPETSc.with(args=split(options)) do domain = (0,4,0,4) cells = (4,4) @@ -56,7 +70,11 @@ function main(parts) assem=SparseMatrixAssembler(SparseMatrixCSR{0,PetscScalar,PetscInt},Vector{Float64},U,V) op = AffineFEOperator(a,l,U,V,assem) - ls = PETScLinearSolver(mykspsetup) + if solver == :mumps + ls = PETScLinearSolver(mykspsetup) + else + ls = PETScLinearSolver() + end fels = LinearFESolver(ls) uh = solve(fels,op) eh = u - uh From 89e2a4dd4833dbcf3a289de8cbeefed0d14b8148 Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Sun, 23 Jan 2022 18:07:58 +0100 Subject: [PATCH 04/11] Create additional ci workflow for custom build of petsc (with mumps) --- .github/workflows/ci.yml | 64 +++++++-------------------- .github/workflows/ci_custom_build.yml | 64 +++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/ci_custom_build.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9524b8..f2ad258 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,74 +1,40 @@ name: CI on: [push, pull_request] jobs: - Tests: + test: name: Tests ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} - env: - JULIA_MPI_BINARY: "system" - JULIA_PETSC_LIBRARY: "/opt/petsc/3.15.4/lib/libpetsc" strategy: fail-fast: false matrix: version: - '1.6' os: - - ubuntu-latest + - ubuntu-18.04 arch: - x64 steps: - uses: actions/checkout@v2 - - name: Cache petsc - id: cache-petsc - uses: actions/cache@v2 - with: - path: ${{env.JULIA_PETSC_LIBRARY}} - key: ${{ runner.os }}-build-${{ env.JULIA_PETSC_LIBRARY }}- - restore-keys: | - ${{ runner.os }}-build-${{ env.JULIA_PETSC_LIBRARY }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - name: Install petsc dependencies - run: | - sudo apt-get update - sudo apt-get install -y wget gfortran g++ openmpi-bin libopenmpi-dev - - name: Install petsc - if: steps.cache-petsc.outputs.cache-hit != 'true' - run: | - # Install p4est 2.2 from sources - CURR_DIR=$(pwd) - PACKAGE=petsc - VERSION=3.15.4 - INSTALL_ROOT=/opt - PETSC_INSTALL=$INSTALL_ROOT/$PACKAGE/$VERSION - TAR_FILE=$PACKAGE-$VERSION.tar.gz - URL="https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/" - ROOT_DIR=/tmp - SOURCES_DIR=$ROOT_DIR/$PACKAGE-$VERSION - BUILD_DIR=$SOURCES_DIR/build - wget -q $URL/$TAR_FILE -O $ROOT_DIR/$TAR_FILE - mkdir -p $SOURCES_DIR - tar xzf $ROOT_DIR/$TAR_FILE -C $SOURCES_DIR --strip-components=1 - cd $SOURCES_DIR - ./configure --prefix=$PETSC_INSTALL --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 \ - --download-mumps --download-scalapack --download-parmetis --download-metis \ - --download-ptscotch --with-debugging --with-x=0 --with-shared=1 \ - --with-mpi=1 --with-64-bit-indices - make - make install - - run: julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.precompile()' - - run: julia --project=. --color=yes --check-bounds=yes test/sequential/runtests.jl - - run: julia --project=. --color=yes --check-bounds=yes test/mpi/runtests.jl + - uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: - file: lcov.info + file: lcov.info docs: name: Documentation runs-on: ubuntu-latest diff --git a/.github/workflows/ci_custom_build.yml b/.github/workflows/ci_custom_build.yml new file mode 100644 index 0000000..462dcfe --- /dev/null +++ b/.github/workflows/ci_custom_build.yml @@ -0,0 +1,64 @@ +name: CI_CUSTOM_BUILD +on: [push, pull_request] +jobs: + Tests_custom_build: + name: Tests ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + env: + JULIA_MPI_BINARY: "system" + JULIA_PETSC_LIBRARY: "/opt/petsc/3.15.4/lib/libpetsc" + strategy: + fail-fast: false + matrix: + version: + - '1.6' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - name: Cache petsc + id: cache-petsc + uses: actions/cache@v2 + with: + path: ${{env.JULIA_PETSC_LIBRARY}} + key: ${{ runner.os }}-build-${{ env.JULIA_PETSC_LIBRARY }}- + restore-keys: | + ${{ runner.os }}-build-${{ env.JULIA_PETSC_LIBRARY }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - name: Install petsc dependencies + run: | + sudo apt-get update + sudo apt-get install -y wget gfortran g++ openmpi-bin libopenmpi-dev + - name: Install petsc + if: steps.cache-petsc.outputs.cache-hit != 'true' + run: | + CURR_DIR=$(pwd) + PACKAGE=petsc + VERSION=3.15.4 + INSTALL_ROOT=/opt + PETSC_INSTALL=$INSTALL_ROOT/$PACKAGE/$VERSION + TAR_FILE=$PACKAGE-$VERSION.tar.gz + URL="https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/" + ROOT_DIR=/tmp + SOURCES_DIR=$ROOT_DIR/$PACKAGE-$VERSION + BUILD_DIR=$SOURCES_DIR/build + wget -q $URL/$TAR_FILE -O $ROOT_DIR/$TAR_FILE + mkdir -p $SOURCES_DIR + tar xzf $ROOT_DIR/$TAR_FILE -C $SOURCES_DIR --strip-components=1 + cd $SOURCES_DIR + ./configure --prefix=$PETSC_INSTALL --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 \ + --download-mumps --download-scalapack --download-parmetis --download-metis \ + --download-ptscotch --with-debugging --with-x=0 --with-shared=1 \ + --with-mpi=1 --with-64-bit-indices + make + make install + - run: julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.precompile()' + - run: julia --project=. --color=yes --check-bounds=yes test/sequential/runtests.jl + - run: julia --project=. --color=yes --check-bounds=yes test/mpi/runtests.jl From 2f90edafb88492351ec5dc781b38a4995fa57311 Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Mon, 24 Jan 2022 07:59:29 +0100 Subject: [PATCH 05/11] Minor --- .github/workflows/ci_custom_build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_custom_build.yml b/.github/workflows/ci_custom_build.yml index 462dcfe..1bb4ff6 100644 --- a/.github/workflows/ci_custom_build.yml +++ b/.github/workflows/ci_custom_build.yml @@ -1,7 +1,7 @@ -name: CI_CUSTOM_BUILD +name: CI_EXTRA on: [push, pull_request] jobs: - Tests_custom_build: + test: name: Tests ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} env: @@ -27,7 +27,7 @@ jobs: restore-keys: | ${{ runner.os }}-build-${{ env.JULIA_PETSC_LIBRARY }}- ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ runner.os }}- - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} @@ -58,7 +58,7 @@ jobs: --download-ptscotch --with-debugging --with-x=0 --with-shared=1 \ --with-mpi=1 --with-64-bit-indices make - make install + make install - run: julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.precompile()' - run: julia --project=. --color=yes --check-bounds=yes test/sequential/runtests.jl - run: julia --project=. --color=yes --check-bounds=yes test/mpi/runtests.jl From 7d2091a44e04d0e64439f2e1cd630a3700bc0edd Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Mon, 24 Jan 2022 07:59:51 +0100 Subject: [PATCH 06/11] Renaming --- .github/workflows/{ci_custom_build.yml => ci_extra.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ci_custom_build.yml => ci_extra.yml} (100%) diff --git a/.github/workflows/ci_custom_build.yml b/.github/workflows/ci_extra.yml similarity index 100% rename from .github/workflows/ci_custom_build.yml rename to .github/workflows/ci_extra.yml From 6f951ff2786f68ecfe5a852eb2e2bbf9d6e4bfd1 Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Mon, 24 Jan 2022 08:01:31 +0100 Subject: [PATCH 07/11] Removing extra flags to mpi --- test/mpi/mpiexec.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mpi/mpiexec.jl b/test/mpi/mpiexec.jl index b3d322b..86301e7 100644 --- a/test/mpi/mpiexec.jl +++ b/test/mpi/mpiexec.jl @@ -5,7 +5,7 @@ function run_mpi_driver(;procs,file) testdir = joinpath(mpidir,"..") repodir = joinpath(testdir,"..") mpiexec() do cmd - run(`$cmd -n $procs --allow-run-as-root --oversubscribe $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`) + run(`$cmd -n $procs $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`) @test true end end From ceb30c57f59a6e91720febd077304633431b24ae Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Mon, 24 Jan 2022 08:17:55 +0100 Subject: [PATCH 08/11] Minor --- .github/workflows/ci_extra.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_extra.yml b/.github/workflows/ci_extra.yml index 1bb4ff6..f02dae1 100644 --- a/.github/workflows/ci_extra.yml +++ b/.github/workflows/ci_extra.yml @@ -27,7 +27,7 @@ jobs: restore-keys: | ${{ runner.os }}-build-${{ env.JULIA_PETSC_LIBRARY }}- ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ runner.os }}- - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} @@ -58,7 +58,7 @@ jobs: --download-ptscotch --with-debugging --with-x=0 --with-shared=1 \ --with-mpi=1 --with-64-bit-indices make - make install + make install - run: julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.precompile()' - run: julia --project=. --color=yes --check-bounds=yes test/sequential/runtests.jl - run: julia --project=. --color=yes --check-bounds=yes test/mpi/runtests.jl From fa56277731370d0cfad8bee491e6362ec15fec27 Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Mon, 24 Jan 2022 08:23:22 +0100 Subject: [PATCH 09/11] Trying to fix tests by forcing petsc installation --- .github/workflows/ci_extra.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_extra.yml b/.github/workflows/ci_extra.yml index f02dae1..1f814f5 100644 --- a/.github/workflows/ci_extra.yml +++ b/.github/workflows/ci_extra.yml @@ -37,7 +37,7 @@ jobs: sudo apt-get update sudo apt-get install -y wget gfortran g++ openmpi-bin libopenmpi-dev - name: Install petsc - if: steps.cache-petsc.outputs.cache-hit != 'true' + ##if: steps.cache-petsc.outputs.cache-hit != 'true' run: | CURR_DIR=$(pwd) PACKAGE=petsc @@ -58,7 +58,7 @@ jobs: --download-ptscotch --with-debugging --with-x=0 --with-shared=1 \ --with-mpi=1 --with-64-bit-indices make - make install + make install - run: julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.precompile()' - run: julia --project=. --color=yes --check-bounds=yes test/sequential/runtests.jl - run: julia --project=. --color=yes --check-bounds=yes test/mpi/runtests.jl From 07189510f7a59c2f8b5c56baf1bd6b3cedb5fc20 Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Mon, 24 Jan 2022 08:37:36 +0100 Subject: [PATCH 10/11] trying to add --oversubscribe --- test/mpi/mpiexec.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mpi/mpiexec.jl b/test/mpi/mpiexec.jl index 86301e7..2486337 100644 --- a/test/mpi/mpiexec.jl +++ b/test/mpi/mpiexec.jl @@ -5,7 +5,7 @@ function run_mpi_driver(;procs,file) testdir = joinpath(mpidir,"..") repodir = joinpath(testdir,"..") mpiexec() do cmd - run(`$cmd -n $procs $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`) + run(`$cmd -n $procs --oversubscribe $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`) @test true end end From 26fd2f890850e9dcf0cc07e2bd7ad191601504fc Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Mon, 24 Jan 2022 08:47:26 +0100 Subject: [PATCH 11/11] Specific args for OpenMPI --- test/mpi/mpiexec.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/mpi/mpiexec.jl b/test/mpi/mpiexec.jl index 2486337..0eb518c 100644 --- a/test/mpi/mpiexec.jl +++ b/test/mpi/mpiexec.jl @@ -5,7 +5,11 @@ function run_mpi_driver(;procs,file) testdir = joinpath(mpidir,"..") repodir = joinpath(testdir,"..") mpiexec() do cmd - run(`$cmd -n $procs --oversubscribe $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`) + if MPI.MPI_LIBRARY == MPI.OpenMPI + run(`$cmd -n $procs --allow-run-as-root --oversubscribe $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`) + else + run(`$cmd -n $procs $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`) + end @test true end end