-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CONQUEST benchmarks #227
Draft
tkoskela
wants to merge
10
commits into
main
Choose a base branch
from
tk/conquest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f341fc4
Add draft for CONQUEST benchmark
tkoskela eb325f7
Merge branch 'main' into tk/conquest
tkoskela 67da0d3
fix inputs for water benchmark
tkoskela 396cef8
Merge branch 'tk/conquest' of github.com:ukri-excalibur/excalibur-tes…
tkoskela 6c1cfcf
Add bigger benchmarks fron David Bowler
tkoskela 3d3abdd
Merge branch 'main' into tk/conquest
tkoskela 06edb70
Add larger benchmarks, fix init of SiWeakScaling
tkoskela e72a96e
Add run only benchmark
tkoskela 8b83c3b
Add -gpu feature
tkoskela 543bece
Pass sge extra resources
tkoskela File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[CONQUEST](http://www.order-n.org/) | ||
|
||
## Usage | ||
|
||
```bash | ||
reframe -c benchmarks/apps/conquest -r | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# Import modules from reframe and excalibur-tests | ||
import reframe as rfm | ||
import reframe.utility.sanity as sn | ||
from benchmarks.modules.utils import SpackTest | ||
|
||
class ConquestBaseBenchmark(SpackTest): | ||
|
||
# Run configuration | ||
## Mandatory ReFrame setup | ||
valid_systems = ['*'] | ||
valid_prog_environs = ['default'] | ||
|
||
## Executable | ||
executable = 'Conquest' | ||
executable_opts = [''] | ||
|
||
## Scheduler options | ||
time_limit = '30m' | ||
|
||
# Build configuration | ||
spack_spec = 'conquest@develop +openmp' | ||
|
||
@run_after('setup') | ||
def setup_variables(self): | ||
self.env_vars['OMP_NUM_THREADS'] = f'{self.num_cpus_per_task}' | ||
|
||
@sanity_function | ||
def validate_solution(self): | ||
return sn.assert_found(r'This job was run on', self.stdout) | ||
|
||
@performance_function('s', perf_key='Runtime') | ||
def extract_copy_perf(self): | ||
return sn.extractsingle(r'Total run time was:\s+(\S+)\s+seconds', self.stdout, 1, float) | ||
|
||
@rfm.simple_test | ||
class Si64(ConquestBaseBenchmark): | ||
|
||
tags = {"silicon64"} | ||
num_tasks = 8 | ||
num_cpus_per_task = 1 | ||
|
||
input_dir = "$(dirname $(which Conquest))/../benchmarks/K222_G200" | ||
|
||
prerun_cmds.append(f"cp {input_dir}/coords.dat .") | ||
prerun_cmds.append(f"cp {input_dir}/Conquest_input .") | ||
prerun_cmds.append(f"cp {input_dir}/Si.ion .") | ||
|
||
@rfm.simple_test | ||
class Water64(ConquestBaseBenchmark): | ||
|
||
tags = {"water64"} | ||
num_tasks = 8 | ||
num_cpus_per_task = 4 | ||
|
||
input_dir = "$(dirname $(which Conquest))/../benchmarks/water_64mols" | ||
|
||
prerun_cmds.append(f"cp {input_dir}/Conquest_input .") | ||
prerun_cmds.append(f"cp {input_dir}/H20_coord.in .") | ||
prerun_cmds.append(f"cp {input_dir}/H_SZ.ion .") | ||
prerun_cmds.append(f"cp {input_dir}/H_SZP.ion .") | ||
prerun_cmds.append(f"cp {input_dir}/O_SZ.ion .") | ||
prerun_cmds.append(f"cp {input_dir}/O_SZP.ion .") | ||
|
||
@rfm.simple_test | ||
class SiWeakScaling(ConquestBaseBenchmark): | ||
|
||
tags = {"si_weakscaling"} | ||
num_threads = parameter([1,2,4,8]) | ||
num_cores = parameter([8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768]) | ||
#num_cores = parameter([8]) | ||
num_atoms_per_core = parameter([8]) | ||
|
||
@run_after('setup') | ||
def setup_variables(self): | ||
|
||
input_files = { | ||
2**6: "si_222.xtl", | ||
2**7: "si_422.xtl", | ||
2**8: "si_442.xtl", | ||
2**9: "si_444.xtl", | ||
2**10: "si_844.xtl", | ||
2**11: "si_884.xtl", | ||
2**12:"si_888.xtl", | ||
2**13: "si_1688.xtl", | ||
2**14: "si_16168.xtl", | ||
2**15: "si_161616.xtl", | ||
2**16: "si_321616.xtl", | ||
2**17: "si_323216.xtl", | ||
2**18: "si_323232.xtl"} | ||
input_dir = "$(dirname $(which Conquest))/../benchmarks/matrix_multiply" | ||
|
||
self.num_tasks = max(1, self.num_cores // self.num_threads) | ||
self.num_cpus_per_task = self.num_threads | ||
self.num_tasks_per_node = max(1, min(self.num_tasks, self.current_partition.processor.num_cpus // self.num_threads)) | ||
self.env_vars['OMP_NUM_THREADS'] = f'{self.num_cpus_per_task}' | ||
|
||
self.prerun_cmds.append(f"cp {input_dir}/{input_files[self.num_cores*self.num_atoms_per_core]} ./coords.dat") | ||
self.prerun_cmds.append(f"cp {input_dir}/Conquest_input .") | ||
self.prerun_cmds.append(f"cp {input_dir}/Si.ion .") | ||
|
||
self.time_limit = "2h" | ||
|
||
# Performance tuning by passing system specific scheduler options | ||
@run_before('run') | ||
def set_cpu_binding(self): | ||
if self.current_system.name == 'archer2': | ||
self.job.launcher.options = ['--distribution=block:block --hint=nomultithread'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Import modules from reframe and excalibur-tests | ||
import reframe as rfm | ||
import reframe.utility.sanity as sn | ||
from benchmarks.modules.utils import SpackTest | ||
|
||
class ConquestBaseBenchmark(rfm.RunOnlyRegressionTest): | ||
|
||
# Run configuration | ||
## Mandatory ReFrame setup | ||
valid_systems = ['-gpu'] | ||
valid_prog_environs = ['default'] | ||
|
||
## Executable | ||
executable = 'Conquest' | ||
executable_opts = [''] | ||
|
||
## Scheduler options | ||
time_limit = '30m' | ||
|
||
input_dir = variable(str, value='foo') | ||
|
||
# Build configuration | ||
# spack_spec = 'conquest@develop +openmp' | ||
|
||
@run_after('setup') | ||
def setup_variables(self): | ||
self.env_vars['OMP_NUM_THREADS'] = f'{self.num_cpus_per_task}' | ||
|
||
if self.current_partition.scheduler.registered_name == 'sge': | ||
# `self.num_tasks` or `self.num_cpus_per_task` may be `None`, here | ||
# we default to `1` if not set. | ||
num_tasks = self.num_tasks or 1 | ||
num_cpus_per_task = self.num_cpus_per_task or 1 | ||
# Set the total number of CPUs to be requested for the SGE scheduler. | ||
self.extra_resources['mpi'] = {'num_slots': num_tasks * num_cpus_per_task} | ||
|
||
@sanity_function | ||
def validate_solution(self): | ||
return sn.assert_found(r'This job was run on', self.stdout) | ||
|
||
@performance_function('s', perf_key='Runtime') | ||
def extract_copy_perf(self): | ||
return sn.extractsingle(r'Total run time was:\s+(\S+)\s+seconds', self.stdout, 1, float) | ||
|
||
@rfm.simple_test | ||
class Si64(ConquestBaseBenchmark): | ||
|
||
tags = {"silicon64"} | ||
num_tasks = 8 | ||
num_cpus_per_task = 1 | ||
|
||
@run_before('run') | ||
def get_input(self): | ||
self.prerun_cmds.append(f"cp {self.input_dir}/K222_G200/coords.dat .") | ||
self.prerun_cmds.append(f"cp {self.input_dir}/K222_G200/Conquest_input .") | ||
self.prerun_cmds.append(f"cp {self.input_dir}/K222_G200/Si.ion .") | ||
|
||
@rfm.simple_test | ||
class Water64(ConquestBaseBenchmark): | ||
|
||
tags = {"water64"} | ||
num_tasks = 8 | ||
num_cpus_per_task = 4 | ||
|
||
@run_before('run') | ||
def get_input(self): | ||
self.prerun_cmds.append(f"cp {self.input_dir}/water_64mols/Conquest_input .") | ||
self.prerun_cmds.append(f"cp {self.input_dir}/water_64mols/H2O_coord.in .") | ||
self.prerun_cmds.append(f"cp {self.input_dir}/water_64mols/H_SZ.ion .") | ||
self.prerun_cmds.append(f"cp {self.input_dir}/water_64mols/H_SZP.ion .") | ||
self.prerun_cmds.append(f"cp {self.input_dir}/water_64mols/O_SZ.ion .") | ||
self.prerun_cmds.append(f"cp {self.input_dir}/water_64mols/O_SZP.ion .") | ||
|
||
@rfm.simple_test | ||
class SiWeakScaling(ConquestBaseBenchmark): | ||
|
||
tags = {"si_weakscaling"} | ||
num_threads = parameter([1,2,4,8]) | ||
num_cores = parameter([8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768]) | ||
#num_cores = parameter([8]) | ||
num_atoms_per_core = parameter([8]) | ||
|
||
@run_after('setup') | ||
def setup_variables(self): | ||
|
||
input_files = { | ||
2**6: "si_222.xtl", | ||
2**7: "si_422.xtl", | ||
2**8: "si_442.xtl", | ||
2**9: "si_444.xtl", | ||
2**10: "si_844.xtl", | ||
2**11: "si_884.xtl", | ||
2**12:"si_888.xtl", | ||
2**13: "si_1688.xtl", | ||
2**14: "si_16168.xtl", | ||
2**15: "si_161616.xtl", | ||
2**16: "si_321616.xtl", | ||
2**17: "si_323216.xtl", | ||
2**18: "si_323232.xtl"} | ||
|
||
self.num_tasks = max(1, self.num_cores // self.num_threads) | ||
self.num_cpus_per_task = self.num_threads | ||
self.num_tasks_per_node = max(1, min(self.num_tasks, self.current_partition.processor.num_cpus // self.num_threads)) | ||
self.env_vars['OMP_NUM_THREADS'] = f'{self.num_cpus_per_task}' | ||
|
||
self.prerun_cmds.append(f"cp {self.input_dir}/matrix_multiply/{input_files[self.num_cores*self.num_atoms_per_core]} ./coords.dat") | ||
self.prerun_cmds.append(f"cp {self.input_dir}/matrix_multiply/Conquest_input .") | ||
self.prerun_cmds.append(f"cp {self.input_dir}/matrix_multiply/Si.ion .") | ||
|
||
self.time_limit = "2h" | ||
|
||
# Performance tuning by passing system specific scheduler options | ||
@run_before('run') | ||
def set_cpu_binding(self): | ||
if self.current_system.name == 'archer2': | ||
self.job.launcher.options = ['--distribution=block:block --hint=nomultithread'] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to do this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's normally done in the
SpackTest
base class but this is aRfm.RunOnlyRegressionTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I missed you were deriving from
Rfm.RunOnlyRegressionTest
.