Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'''
If an exception is raised in a setUpModule then none of
the tests in the module will be run.
This is useful because the slaves run in a while loop on initialization
only responding to the master's commands and will never execute anything else.
On termination of master, the slaves call quit() that raises a SystemExit().
Because of the behaviour of setUpModule, it will not run any unit tests
for the slave and we now only need to write unit-tests from the master's
point of view.
'''
global rank,backend_mpi
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
backend_mpi = BackendMPI()
'''
If an exception is raised in a setUpModule then none of
the tests in the module will be run.
This is useful because the teams run in a while loop on initialization
only responding to the scheduler's commands and will never execute anything else.
On termination of scheduler, the teams call quit() that raises a SystemExit().
Because of the behaviour of setUpModule, it will not run any unit tests
for the team and we now only need to write unit-tests from the scheduler's
point of view.
'''
global rank,backend_mpi
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
backend_mpi = BackendMPI(process_per_model=2)
def setup_backend():
global backend
from abcpy.backends import BackendMPI as Backend
backend = Backend(process_per_model=2)
def setup_backend():
global backend
from abcpy.backends import BackendMPI as Backend
backend = Backend()
# The above line is equivalent to:
def setup_backend():
global backend
from abcpy.backends import BackendMPI as Backend
backend = Backend(process_per_model=2)
#backend = Backend()
def setup_backend(process_per_model):
global backend
from abcpy.backends import BackendMPI as Backend
backend = Backend(process_per_model=process_per_model)
def setup_backend():
global backend
from abcpy.backends import BackendMPI as Backend
backend = Backend(process_per_model=2)