Skip to content
Snippets Groups Projects
sodshock_3d.py 1.86 KiB
import reframe as rfm
import reframe.core.launchers.mpi

import common


@rfm.parameterized_test(*([tasks, threads, iteration, launcher]
    for tasks in [2]
    for threads in list(reversed([32])) 
    for iteration in [1]
    for launcher in ['mpirun', 'perf-report', 'scalasca']))
class SodShock3dTest(rfm.RegressionTest):
    def __init__(self, num_tasks, num_threads, iteration, launcher):
        ic_dir = common.setup(self, launcher, num_tasks, num_tasks_per_node=num_tasks)
    
        test_dir = 'swiftsim/examples/HydroTests/SodShock_3D'
        self.cpus_per_task = 32 # added
        print(f'Running with threads : <{num_threads}>')

        self.keep_files = [test_dir]
        self.build_system.config_opts = [
            '--enable-ipo',
            '--with-tbbmalloc',
            '--with-parmetis'
        ]
        self.prerun_cmds = [f'pushd {test_dir}']
        num_iterations = 10000

        if launcher == 'mpirun':
            self.executable = 'aps' 
            self.executable_opts = ['--collection-mode=mpi,omp', '../../swift_mpi',
                                    '-P', 'Snapshots:time_first:999999999'] 
        elif launcher == 'perf-report':
            self.executable = 'perf-report'
            self.executable_opts = ['--mpi=intel-mpi', '../../swift_mpi']
            self.time_limit = '2h40m'
        elif launcher == 'scalasca':
            self.build_system.make_opts = ['CC="scorep --user --thread=pthread icc"']
            self.executable = '../../swift'
            self.executable_opts = ['-P', 'Snapshots:time_first:999999999'] 

        self.executable_opts += [
            '--hydro',
            '-v', '1',
            f'--threads={num_threads}',
            '-n', f'{num_iterations}',
            '-P', 'Restarts:enable:0',
            '-P', f'InitialConditions:file_name:{ic_dir}/sodshock/glassCube_64.hdf5',
            'sodShock.yml'
        ]