Ejemplo n.º 1
0
    def test_check_incomplete_input(self):
        required = self.required.copy()

        required['walltime'] = None

        with self.assertRaises(ValueError):
            SuperMucAgent(**required)

        required.pop('walltime')
        with self.assertRaises(ValueError):
            SuperMucAgent(**required)
Ejemplo n.º 2
0
    def test_mpichange(self):
        required = self.required.copy()
        required['job_type'] = 'mpich'
        with self.assertRaises(NotImplementedError):
            SuperMucAgent(**required)

        required['job_type'] = 'MPICH'
        Agent=SuperMucAgent(**required)

        self.assertTrue('mpi.intel' in Agent.params['load_modules'])
        self.assertTrue('mpi.ibm' in Agent.params['unload_modules'])
Ejemplo n.º 3
0
    def test_invalid_mail(self):
        required = self.required.copy()

        # this should work
        Agent = SuperMucAgent(**required)

        # just some examples, feel fre to add more
        invalids = ['a @b.c',
                    'a%b',
                    'ab',
                    'a(at)b.c',
                    ]

        for i in invalids:
            required['email_address'] = i
            with self.assertRaises(RuntimeError):
                Agent = SuperMucAgent(**required)
Ejemplo n.º 4
0
    def test_check_inconsistent_input(self):
        required = self.required.copy()

        required['nnodes'] = 5
        with self.assertRaises(ValueError):
            SuperMucAgent(**required)

        required['job_class'] = 'general'

        with self.assertRaises(ValueError):
            SuperMucAgent(**required)

        required['architecture'] = 'phase2'

        with self.assertRaises(ValueError):
            SuperMucAgent(**required)

        # too many nodes
        required['nnodes'] = 514

        with self.assertRaises(ValueError):
            SuperMucAgent(**required)

        # no island count
        required['architecture'] = 'thin'
        required['job_class'] = 'large'
        with self.assertRaises(ValueError):
            SuperMucAgent(**required)

        # wrong format for island_count
        required['island_count'] = 1
        with self.assertRaises(TypeError):
            SuperMucAgent(**required)

        required['island_count'] = [1]
        with self.assertRaises(TypeError):
            SuperMucAgent(**required)

        required['island_count'] = [2,1]
        with self.assertRaises(ValueError):
            SuperMucAgent(**required)

        required['island_count'] = [1,2]
        SuperMucAgent(**required)
Ejemplo n.º 5
0
 def check_complete_input(self):
     SuperMucAgent(**self.required)
Ejemplo n.º 6
0
 def test_check_arg_works_for_nonexisting_arg(self):
     with self.assertRaises(RuntimeError):
         SuperMucAgent(pbsname='myjob', **self.required)
Ejemplo n.º 7
0
 def test_write(self):
     # this should work
     Agent = SuperMucAgent(**self.required)
     Agent._write_loadleveler()
Ejemplo n.º 8
0
 def test_wrong_cluster(self):
     required = self.required.copy()
     required['architecture'] = 'thiiin'
     with self.assertRaises(NotImplementedError):
         Agent = SuperMucAgent(**required)
Ejemplo n.º 9
0
 def test_ncpu(self):
     Agent = SuperMucAgent(**self.required)
     self.assertEquals(2*40, Agent._tp_ncpu())