diff --git a/eessi/testsuite/hooks.py b/eessi/testsuite/hooks.py index 5956ac61..b9a3dc93 100644 --- a/eessi/testsuite/hooks.py +++ b/eessi/testsuite/hooks.py @@ -232,7 +232,7 @@ def _assign_one_task_per_numa_node(test: rfm.RegressionTest): # neither num_tasks_per_node nor num_cpus_per_task are set if not test.num_tasks_per_node and not test.num_cpus_per_task: check_proc_attribute_defined(test, 'num_cores_per_numa_node') - test.num_tasks_per_node = math.ceil(test.default_num_cpus_per_node / num_cores_per_numa_node) + test.num_tasks_per_node = math.ceil(test.default_num_cpus_per_node / test.current_partition.processor.num_cores_per_numa_node) test.num_cpus_per_task = int(test.default_num_cpus_per_node / test.num_tasks_per_node) # num_tasks_per_node is not set, but num_cpus_per_task is diff --git a/eessi/testsuite/tests/apps/PyTorch/src/python_get_free_socket.py b/eessi/testsuite/tests/apps/PyTorch/src/python_get_free_socket.py new file mode 100644 index 00000000..a2981304 --- /dev/null +++ b/eessi/testsuite/tests/apps/PyTorch/src/python_get_free_socket.py @@ -0,0 +1,8 @@ +# Based on https://unix.stackexchange.com/a/132524 +import socket + +s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +s.bind(('', 0)) +addr = s.getsockname() +print(addr[1]) +s.close()