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
  • Loading branch information
giordano committed Dec 4, 2023
1 parent e95d8dd commit 7381269
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions benchmarks/apps/sombrero/sombrero.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@

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 = 32 * 24 * 24 * 24


# 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,7 +120,10 @@ 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,
)


@rfm.simple_test
Expand All @@ -122,4 +137,7 @@ def set_up_from_parameters(self):

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

0 comments on commit 7381269

Please sign in to comment.