Beispiel #1
0
 def test_MPfromBoth(self):
     # Env should have priority
     os.environ["ATHENA_PROC_NUMBER"] = "4"
     argdict = {
         'movealong': argList('nothing to see here'),
         'athenaopts': argSubstepList(['--nprocs=2', 'random', 'values'])
     }
     self.assertEqual(detectAthenaMPProcs(argdict), 4)
Beispiel #2
0
 def testEnvUp(self):
     from PyJobTransforms.trfArgClasses import argSubstepList, argSubstepBool
     envUp = environmentUpdate()
     argDict = {'env': argSubstepList(["KEY1=VALUE1","KEY2=VALUE2","KEY3=VALUE3"]),
                'imf': argSubstepBool('True')}
     envUp.setStandardEnvironment(argDict)
     print(envUp.values)
     print(envUp._envdict)
     self.assertTrue("KEY1" in envUp._envdict)
     self.assertTrue("LD_PRELOAD" in envUp._envdict)
Beispiel #3
0
 def test_MPfromArgdictBad(self):
     argdict = {
         'movealong': argList('nothing to see here'),
         'athenaopts': argSubstepList(['--nprocs=-4', 'random', 'values'])
     }
     self.assertRaises(trfExceptions.TransformExecutionException,
                       detectAthenaMPProcs, argdict)
     argdict = {
         'movealong': argList('nothing to see here'),
         'athenaopts':
         argSubstepList(['--nprocs=notAnInt', 'random', 'values'])
     }
     self.assertRaises(trfExceptions.TransformExecutionException,
                       detectAthenaMPProcs, argdict)
     argdict = {
         'movealong': argList('nothing to see here'),
         'athenaopts':
         argSubstepList(['--nprocs=4', '--nprocs=8', 'values'])
     }
     self.assertRaises(trfExceptions.TransformExecutionException,
                       detectAthenaMPProcs, argdict)
Beispiel #4
0
 def test_MPfromArgdictEmpty(self):
     argdict = {
         'movealong': argList('nothing to see here'),
         'athenaopts': argSubstepList(['--nprocs=0', 'random', 'values'])
     }
     self.assertEqual(detectAthenaMPProcs(argdict), 0)
Beispiel #5
0
 def test_noMPwithArgdict(self):
     argdict = {
         'movealong': argList('nothing to see here'),
         'athenaopts': argSubstepList(['some', 'random', 'values'])
     }
     self.assertEqual(detectAthenaMPProcs(argdict), 0)