makeSuperMUCRunscript.py 1.74 KB
Newer Older
Frederik Hennig's avatar
Frederik Hennig committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

SUPERMUC_PHYSICAL_CORES_PER_NODE = 48

SCRIPT_TEMPLATE = """#!/bin/bash -l
#
#SBATCH -J waLBerlaRefinementCodegenBenchmark
#
#SBATCH -o ./%x.%j.out
#SBATCH -e ./%x.%j.err
#
#
#SBATCH --mail-type=ALL
#SBATCH --mail-user=frederik.hennig@fau.de
#
#SBATCH --partition={partition}
#SBATCH --time={walltime}
#SBATCH --nodes={num_nodes}
#SBATCH --ntasks={num_procs}
#SBATCH --ntasks-per-node={procs_per_node}
#
#SBATCH --get-user-env
#SBATCH --account=pn29po

export NUM_NODES={num_nodes}
export PHYSICAL_CORES_PER_NODE=48
export PROCESSES_PER_NODE={procs_per_node}

cd ~/pycodegen
source env.sh
cd walberla/build/apps/benchmarks/NonuniformGridGenerated/

export OMP_NUM_THREADS={omp_threads}
mpiexec --bind-to socket ./NonuniformGridCodegenPerformance_{codegen_config} Setups/{scenario_script}

"""

def safe_int(some_float):
    assert int(some_float) == some_float
    return int(some_float)

def get_partition(num_nodes):
    if num_nodes <= 16:
        return "micro"
    elif num_nodes <= 768:
        return "general"
    elif num_nodes <= 3072:
        return "large"
    else:
        raise Exception("Job too large.")

def get_script_d3q19_esotwist_True(num_nodes, num_omp_threads, scenario_script, name="walberlaRefinementBenchmark", walltime="00:20:00"):
    config = 'd3q19_esotwist_True'
    procs_per_node = safe_int(SUPERMUC_PHYSICAL_CORES_PER_NODE / num_omp_threads)
    num_procs = num_nodes * procs_per_node
    partition = get_partition(num_nodes)
    script = SCRIPT_TEMPLATE.format(
        partition=partition,
        walltime=walltime,
        num_nodes=num_nodes,
        num_procs=num_procs,
        procs_per_node=procs_per_node,
        omp_threads=num_omp_threads,
        codegen_config=config,
        scenario_script=scenario_script
    )

    return script