Exemplo n.º 1
0
 def test_inspect_resource(self):
     """Test :func:`~exa.compute.resources.inspect_resource`."""
     name = "name"
     resource = inspect_resource(name)
     self.assertIsInstance(resource, Resource)
     self.assertEqual(resource.name, name)
     self.assertEqual(resource.cpus, psutil.cpu_count())
     self.assertTrue(np.isclose(resource.memory, psutil.virtual_memory().total))
     self.assertEqual(resource.gpus, get_ngpus())
Exemplo n.º 2
0
 def test_get_ngpus(self):
     """Test :func:`~exa.compute.resources.get_ngpus`."""
     self.assertIsInstance(get_ngpus(), int)