Skip to content

Commit

Permalink
Disable MPI test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy E Kozdon committed Jul 19, 2021
1 parent b81e76d commit b0df437
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
12 changes: 11 additions & 1 deletion test/dmda.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Test
using PETSc, MPI
MPI.Initialized() || MPI.Init()
PETSc.initialize()

@testset "DMDACreate1D" begin
comm = MPI.COMM_WORLD
mpirank = MPI.Comm_rank(comm)
mpisize = MPI.Comm_size(comm)
for petsclib in PETSc.petsclibs
PETSc.initialize(petsclib)
PetscScalar = PETSc.scalartype(petsclib)
PetscInt = PETSc.inttype(petsclib)
# Loop over all boundary types and try to use them
Expand Down Expand Up @@ -108,8 +108,10 @@ PETSc.initialize()
# TODO: Need a better test?
ksp = PETSc.KSP(da)
@test PETSc.gettype(ksp) == "gmres"

end
end
PETSc.finalize(petsclib)
end
end

Expand All @@ -122,6 +124,7 @@ end
for petsclib in PETSc.petsclibs
PetscScalar = PETSc.scalartype(petsclib)
PetscInt = PETSc.inttype(petsclib)
PETSc.initialize(petsclib)
# Loop over all boundary types and stencil types
for stencil_type in instances(PETSc.DMDAStencilType),
boundary_type_y in instances(PETSc.DMBoundaryType),
Expand Down Expand Up @@ -216,6 +219,7 @@ end
@test PETSc.gettype(ksp) == "gmres"
end
end
PETSc.finalize(petsclib)
end
end

Expand All @@ -229,6 +233,7 @@ end
for petsclib in PETSc.petsclibs
PetscScalar = PETSc.scalartype(petsclib)
PetscInt = PETSc.inttype(petsclib)
PETSc.initialize(petsclib)
# Loop over all boundary types and stencil types
for stencil_type in instances(PETSc.DMDAStencilType),
boundary_type_z in instances(PETSc.DMBoundaryType),
Expand Down Expand Up @@ -337,6 +342,7 @@ end
@test PETSc.gettype(ksp) == "gmres"
end
end
PETSc.finalize(petsclib)
end
end

Expand All @@ -345,6 +351,7 @@ end
mpirank = MPI.Comm_rank(comm)
mpisize = MPI.Comm_size(comm)
for petsclib in PETSc.petsclibs
PETSc.initialize(petsclib)
PetscScalar = PETSc.scalartype(petsclib)
PetscInt = PETSc.inttype(petsclib)
boundary_type = PETSc.DM_BOUNDARY_NONE
Expand Down Expand Up @@ -393,6 +400,7 @@ end
@test mat[i, (i - 1):(i + 1)] == [1, -2, 1]
end
end
PETSc.finalize(petsclib)
end
end

Expand All @@ -401,6 +409,7 @@ end
mpirank = MPI.Comm_rank(comm)
mpisize = MPI.Comm_size(comm)
for petsclib in PETSc.petsclibs
PETSc.initialize(petsclib)
PetscScalar = PETSc.scalartype(petsclib)
PetscInt = PETSc.inttype(petsclib)
boundary_type = PETSc.DM_BOUNDARY_NONE
Expand Down Expand Up @@ -472,6 +481,7 @@ end
for (loc, glo) in enumerate(ghost_lower:ghost_upper)
@test coord_vec[loc] (glo - 1) * Δx
end
PETSc.finalize(petsclib)
end
end

Expand Down
11 changes: 7 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ using Test
using MPI

# Do the MPI tests first so we do not have mpi running inside MPI
@testset "mpi tests" begin
@test mpiexec() do mpi_cmd
cmd = `$mpi_cmd -n 4 $(Base.julia_cmd()) --project dmda.jl`
success(pipeline(cmd, stderr = stderr))
# XXX: Currently not working on windows, not sure why
if !Sys.iswindows()
@testset "mpi tests" begin
@test mpiexec() do mpi_cmd
cmd = `$mpi_cmd -n 4 $(Base.julia_cmd()) --project dmda.jl`
success(pipeline(cmd, stderr = stderr))
end
end
end

Expand Down

0 comments on commit b0df437

Please sign in to comment.