Exemplo n.º 1
0
 def to_nodes_ppn(self, spec, rank_simplifier=None, can_merge_ranks=None):
     """!Given a JobResourceSpec that represents an MPI program, express 
     it in (nodes,ranks_per_node) pairs where each is an integer.
     This is intended to be used to generate PBS-style
     "nodes=1:ppn=3+8:ppn=12" specifications.        """
     spec = self.with_similar_ranks_merged(spec, rank_simplifier,
                                           can_merge_ranks)
     # Get the (nodes,ppn) pairs for all ranks:
     nodes_ranks = list()
     for block in spec:
         max_per_node = self.max_ranks_per_node(block)
         ranks = block['mpi_ranks']
         kj = ranks_to_nodes_ppn(max_per_node, ranks)
         nodes_ranks.extend(kj)
     return nodes_ranks
Exemplo n.º 2
0
 def test_10_109(self):
     self.assertEqual([(10, 10),(1, 9)], ranks_to_nodes_ppn(10, 109))
Exemplo n.º 3
0
 def test_24_62(self):
     self.assertEqual([(2, 21),(1, 20)], ranks_to_nodes_ppn(24, 62))
Exemplo n.º 4
0
 def test_24_31(self):
     self.assertEqual([(1, 16),(1, 15)], ranks_to_nodes_ppn(24, 31))
Exemplo n.º 5
0
 def test_10_3(self):
     self.assertEqual([(1, 3)], ranks_to_nodes_ppn(10, 3))
Exemplo n.º 6
0
 def test_3_10(self):
     self.assertEqual([(2, 3),(2, 2)], ranks_to_nodes_ppn(3, 10))