def setUp(self): self.cs = settings.Settings(fName=ARMI_RUN_PATH) settings.setMasterCs(self.cs) self.o = OperatorMPI(self.cs) self.action = DistributeStateAction() self.action.o = self.o self.action.r = self.o.r
def setUp(self): self.cs = settings.Settings(fName=ARMI_RUN_PATH) bp = blueprints.loadFromCs(self.cs) settings.setMasterCs(self.cs) self.o = OperatorMPI(self.cs) self.o.r = reactors.factory(self.cs, bp) self.action = DistributeStateAction() self.action.o = self.o self.action.r = self.o.r
def setUp(self): self.cs = settings.Settings(fName=ARMI_RUN_PATH) settings.setMasterCs(self.cs) self.o = OperatorMPI(cs=self.cs)
class MpiOperatorTests(unittest.TestCase): """Testing the MPI parallelization operation""" def setUp(self): self.cs = settings.Settings(fName=ARMI_RUN_PATH) settings.setMasterCs(self.cs) self.o = OperatorMPI(cs=self.cs) def test_masterException(self): self.o.removeAllInterfaces() failer = FailingInterface1(self.o.r, self.o.cs) self.o.addInterface(failer) if armi.MPI_RANK == 0: self.assertRaises(RuntimeError, self.o.operate) else: self.o.operate() def test_masterCritical(self): self.o.removeAllInterfaces() failer = FailingInterface2(self.o.r, self.o.cs) self.o.addInterface(failer) if armi.MPI_RANK == 0: self.assertRaises(Exception, self.o.operate) else: self.o.operate() def test_workerException(self): self.o.removeAllInterfaces() failer = FailingInterface3(self.o.r, self.o.cs) self.o.addInterface(failer) if armi.MPI_RANK != 0: self.assertRaises(RuntimeError, self.o.operate) else: self.o.operate()
def setUp(self): self.old_op, self.r = test_reactors.loadTestReactor(TEST_ROOT) self.o = OperatorMPI(cs=self.old_op.cs) self.o.r = self.r
class MpiOperatorTests(unittest.TestCase): """Testing the MPI parallelization operator""" def setUp(self): self.old_op, self.r = test_reactors.loadTestReactor(TEST_ROOT) self.o = OperatorMPI(cs=self.old_op.cs) self.o.r = self.r @unittest.skipIf(context.MPI_SIZE <= 1 or MPI_EXE is None, "Parallel test only") def test_basicOperatorMPI(self): self.o.operate() @unittest.skipIf(context.MPI_SIZE <= 1 or MPI_EXE is None, "Parallel test only") def test_masterException(self): self.o.removeAllInterfaces() failer = FailingInterface1(self.o.r, self.o.cs) self.o.addInterface(failer) if context.MPI_RANK == 0: self.assertRaises(RuntimeError, self.o.operate) else: self.o.operate() @unittest.skipIf(context.MPI_SIZE <= 1 or MPI_EXE is None, "Parallel test only") def test_masterCritical(self): self.o.removeAllInterfaces() failer = FailingInterface2(self.o.r, self.o.cs) self.o.addInterface(failer) if context.MPI_RANK == 0: self.assertRaises(Exception, self.o.operate) else: self.o.operate()