Skip to content

Commit

Permalink
[sombrero] Handle systems where number of cores doesn't divide lattic…
Browse files Browse the repository at this point in the history
…e volume (#250)

* [sombrero] Handle systems where number of cores doesn't divide lattice volume

* [sombrero] Distinguish lattice volume; set `num_tasks_per_node` where needed

* [sombrero] Allow changing number of nodes for `ITT-64n` benchmark
  • Loading branch information
giordano authored Dec 14, 2023
1 parent 6496422 commit 364fdb8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
2 changes: 2 additions & 0 deletions benchmarks/apps/sombrero/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ using the `--tag=<TAG>` command line option of `reframe`:
(as described [here](https://github.com/sa2c/sombrero/wiki/Dirac-ITT-2020-Benchmarks)).
- `ITT-64n`: A run on 64 nodes, using all the cores in each node
(as described [here](https://github.com/sa2c/sombrero/wiki/Dirac-ITT-2020-Benchmarks)).
The number of nodes used can be changed by setting the variable `num_nodes`,
for example `reframe ... -S num_nodes=48`.
- `scaling`: A large benchmarking campaign, where of the benchmarks is launched
on a range of number of processes
(depending on the setup of the machine)
Expand Down
28 changes: 24 additions & 4 deletions benchmarks/apps/sombrero/sombrero.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,25 @@

import reframe as rfm
import reframe.utility.sanity as sn
import reframe.utility.udeps as udeps

from benchmarks.apps.sombrero import case_filter
from benchmarks.modules.reframe_extras import scaling_config
from benchmarks.modules.utils import SpackTest

# Fixed lattice volume in ITT benchmarks
LATTICE_VOLUME_SMALL = 32 * 24 ** 3
LATTICE_VOLUME_MEDIUM = 48 ** 3 * 64


# Helper function to find maximum number of tasks we can use for benchmarks
# which assume the number of cores divide a fixed lattice volume.
def max_num_tasks(n, volume):
num_tasks = 1
for i in range(2, n + 1):
if volume % i == 0:
num_tasks = i
return num_tasks


@rfm.simple_test
class SombreroBenchmarkBase(SpackTest):
Expand Down Expand Up @@ -108,18 +121,25 @@ def set_up_from_parameters(self):

@run_after('setup')
def setup_num_tasks(self):
self.num_tasks = self.current_partition.processor.num_cores

self.num_tasks = max_num_tasks(
self.current_partition.processor.num_cores,
LATTICE_VOLUME_SMALL,
)

@rfm.simple_test
class SombreroITT64n(SombreroBenchmarkBase):
valid_systems = ['-gpu']
tags = {"ITT-64n"}
num_nodes = variable(int, value=64, loggable=False)

@run_after('init')
def set_up_from_parameters(self):
self.executable_opts = ['-s', 'medium']

@run_after('setup')
def setup_num_tasks(self):
self.num_tasks = self.current_partition.processor.num_cores * 64
self.num_tasks_per_node = max_num_tasks(
self.current_partition.processor.num_cores,
LATTICE_VOLUME_MEDIUM // self.num_nodes,
)
self.num_tasks = self.num_tasks_per_node * self.num_nodes

0 comments on commit 364fdb8

Please sign in to comment.