def test_system_create(): site_config = config.load_config('unittests/resources/settings.py') site_config.select_subconfig('testsys:gpu') system = System.create(site_config) assert system.name == 'testsys' assert system.descr == 'Fake system for unit tests' assert system.hostnames == ['testsys'] assert system.modules_system.name == 'nomod' assert system.preload_environ.modules == ['foo/1.0'] assert system.preload_environ.variables == {'FOO_CMD': 'foobar'} assert system.prefix == '.rfm_testing' assert system.stagedir == '' assert system.outputdir == '' assert system.resourcesdir == '.rfm_testing/resources' assert len(system.partitions) == 1 partition = system.partitions[0] assert partition.name == 'gpu' assert partition.fullname == 'testsys:gpu' assert partition.descr == 'GPU partition' assert partition.scheduler.registered_name == 'slurm' assert partition.launcher_type.registered_name == 'srun' assert partition.access == [] assert partition.container_environs == {} assert partition.local_env.modules == ['foogpu'] assert partition.local_env.modules_detailed == [{ 'name': 'foogpu', 'collection': False, 'path': '/foo' }] assert partition.local_env.variables == {'FOO_GPU': 'yes'} assert partition.max_jobs == 10 assert len(partition.environs) == 2 assert partition.environment('PrgEnv-gnu').cc == 'cc' assert partition.environment('PrgEnv-gnu').cflags == [] assert partition.environment('PrgEnv-gnu').extras == {'foo': 2, 'bar': 'y'} # Check resource instantiation resource_spec = partition.get_resource('gpu', num_gpus_per_node=16) assert resource_spec == ['--gres=gpu:16'] resources_spec = partition.get_resource('datawarp', capacity='100GB', stagein_src='/foo') assert resources_spec == [ '#DW jobdw capacity=100GB', '#DW stage_in source=/foo' ] # Check processor info assert partition.processor.info is not None assert partition.processor.topology is not None assert partition.processor.arch == 'skylake' assert partition.processor.num_cpus == 8 assert partition.processor.num_cpus_per_core == 2 assert partition.processor.num_cpus_per_socket == 8 assert partition.processor.num_sockets == 1 assert partition.processor.num_cores == 4 assert partition.processor.num_cores_per_socket == 4 assert partition.processor.num_numa_nodes == 1 assert partition.processor.num_cores_per_numa_node == 4
def test_system_create(): site_config = config.load_config('unittests/resources/settings.py') site_config.select_subconfig('testsys:gpu') system = System.create(site_config) assert system.name == 'testsys' assert system.descr == 'Fake system for unit tests' assert system.hostnames == ['testsys'] assert system.modules_system.name == 'nomod' assert system.preload_environ.modules == ['foo/1.0'] assert system.preload_environ.variables == {'FOO_CMD': 'foobar'} assert system.prefix == '.rfm_testing' assert system.stagedir == '' assert system.outputdir == '' assert system.resourcesdir == '.rfm_testing/resources' assert len(system.partitions) == 1 partition = system.partitions[0] assert partition.name == 'gpu' assert partition.fullname == 'testsys:gpu' assert partition.descr == 'GPU partition' assert partition.scheduler.registered_name == 'slurm' assert partition.launcher.registered_name == 'srun' assert partition.access == [] assert partition.container_environs == {} assert partition.local_env.modules == ['foogpu'] assert partition.local_env.variables == {'FOO_GPU': 'yes'} assert partition.max_jobs == 10 assert len(partition.environs) == 2 assert partition.environment('PrgEnv-gnu').cc == 'cc' assert partition.environment('PrgEnv-gnu').cflags == [] # Check resource instantiation resource_spec = partition.get_resource('gpu', num_gpus_per_node=16) assert resource_spec == ['--gres=gpu:16'] resources_spec = partition.get_resource('datawarp', capacity='100GB', stagein_src='/foo') assert resources_spec == [ '#DW jobdw capacity=100GB', '#DW stage_in source=/foo' ]
def __init__(self, site_config): self._site_config = site_config self._system = System.create(site_config) self._current_run = 0 self._timestamp = datetime.now()