Skip to content

Commit

Permalink
maybe like this?
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomangano committed Dec 17, 2024
1 parent 92777af commit 0395130
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_hs015_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
HAS_MPI = True
# External modules
from mpi4py import MPI

comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
except ImportError:
HAS_MPI = False

Expand All @@ -19,13 +23,6 @@
# Local modules
from testing_utils import OptTest

if not HAS_MPI:
raise unittest.SkipTest("MPI not available")

comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()


class TestHS15(OptTest):
## Solve test problem HS15 from the Hock & Schittkowski collection.
Expand All @@ -41,6 +38,9 @@ class TestHS15(OptTest):
# at (-0.79212, -1.26243), with final objective = 360.4.
##

if not HAS_MPI:
raise unittest.SkipTest("MPI not available")

N_PROCS = 2 # Run case on two procs

name = "HS015"
Expand Down

0 comments on commit 0395130

Please sign in to comment.