def test_default(self): assert _NP._default == 1 assert _NGPU._default == 0 assert _NRANKS._default == 0 assert _OMP_NUM_THREADS._default == 0 assert _GET_EXECUTABLE()._default == sys.executable assert _WALLTIME._default is None assert _MEMORY._default is None assert _PROCESSOR_FRACTION._default == 1.0
def test_parallel(self): assert _NP._parallel(4, 2) == 6 assert _NRANKS._parallel(4, 2) == 6 assert _NGPU._parallel(4, 2) == 6 assert _OMP_NUM_THREADS._parallel(4, 2) == 6 assert _GET_EXECUTABLE()._parallel("Path1", "Path2") == "Path1" assert _WALLTIME._parallel(4, 2) == 4 assert _MEMORY._parallel(4, 2) == 6 assert _PROCESSOR_FRACTION._parallel(0.4, 0.2) == 0.4
def available_directives_list(): return [ _NP, _NRANKS, _NGPU, _OMP_NUM_THREADS, _GET_EXECUTABLE(), _WALLTIME, _MEMORY, _PROCESSOR_FRACTION, ]