-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from gridap/mpi_tests
Adding mpi tests
- Loading branch information
Showing
5 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
module MPITests | ||
|
||
using MPI | ||
using Test | ||
|
||
mpidir = @__DIR__ | ||
testdir = joinpath(mpidir,"..") | ||
repodir = joinpath(testdir,"..") | ||
|
||
function run_driver(procs,file) | ||
mpiexec() do cmd | ||
run(`$cmd -n $procs $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`) | ||
@test true | ||
end | ||
end | ||
|
||
run_driver(4,"runtests_np4.jl") | ||
run_driver(1,"runtests_np4.jl") # Check that the degenerated case works | ||
|
||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
module NP4 | ||
# All test running on 4 procs here | ||
|
||
using PartitionedArrays | ||
const PArrays = PartitionedArrays | ||
using MPI | ||
|
||
if ! MPI.Initialized() | ||
MPI.Init() | ||
end | ||
|
||
include("../GeometryTests.jl") | ||
include("../CellDataTests.jl") | ||
include("../FESpacesTests.jl") | ||
include("../MultiFieldTests.jl") | ||
include("../PoissonTests.jl") | ||
include("../PLaplacianTests.jl") | ||
|
||
if MPI.Comm_size(MPI.COMM_WORLD) == 4 | ||
parts = get_part_ids(mpi,(2,2)) | ||
elseif MPI.Comm_size(MPI.COMM_WORLD) == 1 | ||
parts = get_part_ids(mpi,(1,1)) | ||
else | ||
error() | ||
end | ||
|
||
display(parts) | ||
|
||
t = PArrays.PTimer(parts,verbose=true) | ||
PArrays.tic!(t) | ||
|
||
GeometryTests.main(parts) | ||
PArrays.toc!(t,"Geometry") | ||
|
||
CellDataTests.main(parts) | ||
PArrays.toc!(t,"CellData") | ||
|
||
FESpacesTests.main(parts) | ||
PArrays.toc!(t,"FESpaces") | ||
|
||
MultiFieldTests.main(parts) | ||
PArrays.toc!(t,"MultiField") | ||
|
||
PoissonTests.main(parts) | ||
PArrays.toc!(t,"Poisson") | ||
|
||
PLaplacianTests.main(parts) | ||
PArrays.toc!(t,"PLaplacian") | ||
|
||
display(t) | ||
|
||
end #module |