2021-04-01 19:01:24 +02:00
|
|
|
#######################################################################
|
2021-03-24 09:08:34 +01:00
|
|
|
# Saiph, granularity experiment:
|
|
|
|
#
|
|
|
|
# App:Heat 3D - garlic/tampi+isend+oss+task+simd branch
|
|
|
|
# App details:
|
|
|
|
# 3D mesh of ~400*400*400 points
|
|
|
|
# nbgx = global blocks in the X dimension
|
|
|
|
# nbgy = global blocks in the Y dimension
|
|
|
|
# nbgz = global blocks in the Z dimension
|
|
|
|
# --> nbgx*nbgy*nbgz = global distributed blocks
|
|
|
|
# nbly = local blocks in the Y dimension
|
|
|
|
# nblz = local blocks in the Z dimension
|
|
|
|
# --> nbly*nblz = local blocks (#tasks)
|
|
|
|
#
|
|
|
|
# Granularity experiment configuration:
|
|
|
|
# Single-core run
|
|
|
|
# MPI binded to sockets: MPI procs = 2
|
2021-04-01 19:01:24 +02:00
|
|
|
# Mesh distributed across third dimension to ensure contiguous
|
|
|
|
# communications
|
2021-03-24 09:08:34 +01:00
|
|
|
# --> nbgx = 1, nbgy = 1
|
|
|
|
# First dimension cannot be locally blocked (simd reasons)
|
|
|
|
# Second and third dimension local blocking limited by local mesh size
|
|
|
|
#
|
2021-04-01 19:01:24 +02:00
|
|
|
#######################################################################
|
2021-03-24 09:08:34 +01:00
|
|
|
|
|
|
|
# Common packages, tools and options
|
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, stdexp
|
|
|
|
, bsc
|
|
|
|
, targetMachine
|
|
|
|
, stages
|
2021-04-01 19:01:24 +02:00
|
|
|
, garlicTools
|
2021-03-24 09:08:34 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2021-04-01 19:01:24 +02:00
|
|
|
with garlicTools;
|
2021-03-24 09:08:34 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2021-04-01 19:01:24 +02:00
|
|
|
# Variable configurations
|
|
|
|
varConf = with targetMachine.config; {
|
2021-03-24 09:08:34 +01:00
|
|
|
# Local blocks per dimension
|
2021-04-01 19:01:24 +02:00
|
|
|
nblx = [ 1 ]; # SIMD
|
|
|
|
nbly = range2 1 (hw.cpusPerNode * 8);
|
|
|
|
nblz = [ 8 ];
|
|
|
|
sizex = [ 3 ];
|
|
|
|
gitBranch = [ "garlic/tampi+isend+oss+task+simd" ];
|
2021-03-24 09:08:34 +01:00
|
|
|
};
|
|
|
|
|
2021-04-01 19:01:24 +02:00
|
|
|
# Generate the complete configuration for each unit
|
|
|
|
genConf = c: targetMachine.config // rec {
|
2021-03-24 09:08:34 +01:00
|
|
|
|
|
|
|
# Experiment, units and job names
|
|
|
|
expName = "saiph-granularity";
|
2021-04-01 19:01:24 +02:00
|
|
|
unitName = "${expName}"
|
|
|
|
+ "-N${toString nodes}"
|
|
|
|
+ "-nbg.x${toString nbgx}.y${toString nbgy}.z${toString nbgz}"
|
|
|
|
+ "-nbl.x${toString nblx}.y${toString nbly}.z${toString nblz}";
|
|
|
|
|
|
|
|
jobName = unitName;
|
2021-03-24 09:08:34 +01:00
|
|
|
|
|
|
|
# saiph options
|
2021-04-01 19:01:24 +02:00
|
|
|
totalTasks = ntasksPerNode * nodes;
|
2021-03-24 09:08:34 +01:00
|
|
|
nodes = 1;
|
|
|
|
enableManualDist = true; # allows to manually set nbg{x-y-z}
|
|
|
|
nbgx = 1;
|
|
|
|
nbgy = 1;
|
2021-04-01 19:01:24 +02:00
|
|
|
nbgz = totalTasks; # forcing distribution by last dim
|
|
|
|
|
|
|
|
inherit (c) nblx nbly nblz gitBranch sizex;
|
|
|
|
|
|
|
|
blocksPerTask = nblx * nbly * nblz * 1.0;
|
|
|
|
blocksPerCpu = blocksPerTask / cpusPerTask;
|
|
|
|
|
|
|
|
# fix a specific commit
|
|
|
|
gitCommit = "8052494d7dc62bef95ebaca9938e82fb029686f6";
|
|
|
|
|
|
|
|
# Repeat the execution of each unit 10 times
|
|
|
|
loops = 10;
|
2021-03-24 09:08:34 +01:00
|
|
|
|
|
|
|
# Resources
|
|
|
|
inherit (targetMachine.config) hw;
|
|
|
|
qos = "debug";
|
2021-04-01 19:01:24 +02:00
|
|
|
ntasksPerNode = hw.socketsPerNode; # MPI binded to sockets
|
|
|
|
cpusPerTask = hw.cpusPerSocket; # Using the 24 CPUs of each socket
|
2021-03-24 09:08:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#*** Compute the final set of configurations ***
|
2021-04-01 19:01:24 +02:00
|
|
|
# Compute the array of configurations: cartesian product of all
|
|
|
|
# factors
|
2021-03-24 09:08:34 +01:00
|
|
|
allConfigs = stdexp.buildConfigs {
|
|
|
|
inherit varConf genConf;
|
|
|
|
};
|
2021-04-01 19:01:24 +02:00
|
|
|
|
2021-03-24 09:08:34 +01:00
|
|
|
# Filter to remove non-desired configurations:
|
|
|
|
# --> tasks/proc < 0.5
|
|
|
|
# --> nblz > 50
|
2021-04-01 19:01:24 +02:00
|
|
|
isGoodConfig = c:
|
|
|
|
let
|
|
|
|
maxNblz = c.cpusPerTask * 2;
|
|
|
|
in
|
|
|
|
! (c.blocksPerCpu < 0.5 || c.nblz > maxNblz);
|
|
|
|
|
|
|
|
configs = filter (isGoodConfig) allConfigs;
|
2021-03-24 09:08:34 +01:00
|
|
|
|
|
|
|
#*** Sets the env/argv of the program ***
|
2021-04-01 19:01:24 +02:00
|
|
|
exec = {nextStage, conf, ...}: stages.exec {
|
2021-03-24 09:08:34 +01:00
|
|
|
inherit nextStage;
|
|
|
|
env = ''
|
2021-04-01 19:01:24 +02:00
|
|
|
export OMP_NUM_THREADS=${toString conf.cpusPerTask}
|
2021-03-24 09:08:34 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
#*** Configure the program according to the app ***
|
2021-04-01 19:01:24 +02:00
|
|
|
program = {nextStage, conf, ...}: bsc.apps.saiph.override {
|
|
|
|
inherit (conf) enableManualDist
|
|
|
|
nbgx nbgy nbgz nblx nbly nblz
|
|
|
|
sizex
|
|
|
|
gitBranch gitCommit;
|
|
|
|
|
|
|
|
L3SizeKB = conf.hw.cacheSizeKB.L3;
|
|
|
|
cachelineBytes = conf.hw.cachelineBytes;
|
|
|
|
};
|
2021-03-24 09:08:34 +01:00
|
|
|
|
|
|
|
#*** Add stages to the pipeline ***
|
|
|
|
pipeline = stdexp.stdPipeline ++ [ exec program ];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2021-04-01 19:01:24 +02:00
|
|
|
stdexp.genExperiment { inherit configs pipeline; }
|