Skip to content

Commit

Permalink
Fix num_cores_per_numa_node, use it from the current_partition info
Browse files Browse the repository at this point in the history
  • Loading branch information
Caspar van Leeuwen committed Mar 29, 2024
1 parent a6e53bc commit 8bb9bbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion eessi/testsuite/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 8bb9bbd

Please sign in to comment.