Skip to content

Commit

Permalink
Reorganize runtests to avoid initializing MPI twice.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpo committed Feb 13, 2015
1 parent 8cf38fa commit 99c23fe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 31 deletions.
15 changes: 0 additions & 15 deletions test/mumps_test.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
using Base.Test
using MUMPS
using MPI

include("get_div_grad.jl");
root = 0;

# Initialize MPI.
MPI.Init()
comm = MPI.COMM_WORLD

icntl = default_icntl[:];
icntl[1] = 0;
icntl[2] = 0;
Expand Down Expand Up @@ -82,7 +71,3 @@ x = solve(A, rhs, sym=mumps_unsymmetric);
MPI.Barrier(comm);
relres = norm(A * x - rhs) / norm(rhs);
@test(relres <= 1.0e-12);

MPI.Barrier(comm)
MPI.Finalize()

17 changes: 1 addition & 16 deletions test/mumps_test_complex.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
using Base.Test
using MUMPS
using MPI

include("get_div_grad.jl");
root = 0;

# Initialize MPI.
MPI.Init()
comm = MPI.COMM_WORLD

icntl = default_icntl[:];
icntl[1] = 0;
icntl[2] = 0;
Expand Down Expand Up @@ -71,7 +60,7 @@ MPI.Barrier(comm)
relres = zeros(nrhs)
for i = 1 : nrhs
relres[i] = norm(A * x[:,i] - rhs[:,i]) / norm(rhs[:,i]);
@test(relres[i] <= 1.0e-12);
@test(relres[i] <= 1.0e-8);
end

# Test a mixed-type example
Expand All @@ -81,7 +70,3 @@ x = solve(A, rhs, sym=mumps_unsymmetric);
MPI.Barrier(comm)
relres = norm(A * x - rhs) / norm(rhs);
@test(relres <= 1.0e-12);

MPI.Barrier(comm)
MPI.Finalize()

15 changes: 15 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
using Base.Test
using MUMPS
using MPI

include("get_div_grad.jl");
root = 0;

# Initialize MPI.
MPI.Init()
comm = MPI.COMM_WORLD

include("mumps_test.jl")
include("mumps_test_complex.jl")

MPI.Barrier(comm)
MPI.Finalize()

0 comments on commit 99c23fe

Please sign in to comment.