Update hpcg experiments

This commit is contained in:
Rodrigo Arias 2020-10-13 17:05:36 +02:00 committed by Raúl Peñacoba
parent 7bf3e81233
commit 01b2584688
5 changed files with 85 additions and 462 deletions

View File

@ -41,4 +41,6 @@ stdenv.mkDerivation rec {
cp bin/* $out/bin/ cp bin/* $out/bin/
''; '';
programPath = "/bin/xhpcg";
} }

View File

@ -1,169 +1,65 @@
{ {
stdenv stdenv
, nixpkgs , stdexp
, pkgs , bsc
, genApp , targetMachine
, genConfigs , stages
, runWrappers
}: }:
with stdenv.lib; with stdenv.lib;
let let
bsc = pkgs.bsc; # Initial variable configuration
varConf = with bsc; {
# Set variable configuration for the experiment
varConfig = {
cc = [ bsc.icc ];
mpi = [ bsc.impi ];
gitBranch = [ "garlic/mpi" ];
makefileName = [ "MPI" ];
n = [ 104 64 ]; n = [ 104 64 ];
}; };
# Common configuration # Generate the complete configuration for each unit
common = { genConf = with bsc; c: targetMachine.config // rec {
# hpcg options
n = c.n;
cc = icc;
mpi = impi;
gitBranch = "garlic/mpi";
# FIXME: fix this option in the garlic/mpi git branch
makefileName = "MPI";
# Repeat the execution of each unit 30 times
loops = 30;
# Resources # Resources
ntasksPerNode = "48"; qos = "debug";
nodes = "1"; ntasksPerNode = 48;
nodes = 1;
# Stage configuration time = "02:00:00";
enableSbatch = true; cpuBind = "sockets,verbose";
enableControl = true; jobName = "hpcg-${toString n}-${gitBranch}";
enableExtrae = false;
enablePerf = false;
enableCtf = false;
# MN4 path
nixPrefix = "/gpfs/projects/bsc15/nix";
}; };
# Compute the cartesian product of all configurations # Compute the array of configurations
configs = map (conf: conf // common) (genConfigs varConfig); configs = stdexp.buildConfigs {
inherit varConf genConf;
stageProgram = stage:
if stage ? programPath
then "${stage}${stage.programPath}" else "${stage}";
w = runWrappers;
sbatch = {stage, conf, ...}: with conf; w.sbatch (
# Allow a user to define a custom reservation for the job in MareNostrum4,
# by setting the garlic.sbatch.reservation attribute in the
# ~/.config/nixpkgs/config.nix file. If the attribute is not set, no
# reservation is used. The user reservation may be overwritten by the
# experiment, if the reservation is set like with nodes or ntasksPerNode.
optionalAttrs (pkgs.config ? garlic.sbatch.reservation) {
inherit (pkgs.config.garlic.sbatch) reservation;
} // {
program = stageProgram stage;
exclusive = true;
time = "02:00:00";
qos = "debug";
jobName = "hpcg";
inherit nixPrefix nodes ntasksPerNode;
}
);
control = {stage, conf, ...}: with conf; w.control {
program = stageProgram stage;
}; };
srun = {stage, conf, ...}: with conf; w.srun { exec = {nextStage, conf, ...}: with conf; stages.exec {
program = stageProgram stage; inherit nextStage;
srunOptions = "--cpu-bind=verbose,rank"; argv = [
inherit nixPrefix; "--nx=${toString n}"
}; "--ny=${toString n}"
"--nz=${toString n}"
statspy = {stage, conf, ...}: with conf; w.statspy {
program = stageProgram stage;
};
perf = {stage, conf, ...}: with conf; w.perf {
program = stageProgram stage;
perfArgs = "sched record -a";
};
nixsetup = {stage, conf, ...}: with conf; w.nixsetup {
program = stageProgram stage;
nixsetup = "${nixPrefix}/bin/nix-setup";
};
extrae = {stage, conf, ...}: w.extrae {
program = stageProgram stage;
traceLib = "mpi"; # mpi -> libtracempi.so
configFile = ./extrae.xml;
};
ctf = {stage, conf, ...}: w.argv {
program = stageProgram stage;
env = ''
export NANOS6=ctf
export NANOS6_CTF2PRV=0
'';
};
argv = {stage, conf, ...}: with conf; w.argv {
program = stageProgram stage;
argv = ''(
--nx=${toString n}
--ny=${toString n}
--nz=${toString n}
)'';
};
bscOverlay = import ../../../overlay.nix;
genPkgs = newOverlay: nixpkgs {
overlays = [
bscOverlay
newOverlay
]; ];
}; };
# We may be able to use overlays by invoking the fix function directly, but we program = {nextStage, conf, ...}: with conf;
# have to get the definition of the bsc packages and the garlic ones as let
# overlays. customPkgs = stdexp.replaceMpi conf.mpi;
in
hpcgFn = {stage, conf, ...}: with conf; customPkgs.apps.hpcg.override {
let
# We set the mpi implementation to the one specified in the conf, so all
# packages in bsc will use that one.
customPkgs = genPkgs (self: super: {
bsc = super.bsc // { mpi = conf.mpi; };
});
in
customPkgs.bsc.garlic.hpcg.override {
inherit cc mpi gitBranch makefileName; inherit cc mpi gitBranch makefileName;
}; };
stages = with common; [] pipeline = stdexp.stdPipeline ++ [ exec program ];
# Use sbatch to request resources first
++ optional enableSbatch sbatch
# Repeats the next stages N times
++ optionals enableControl [ nixsetup control ]
# Executes srun to launch the program in the requested nodes, and
# immediately after enters the nix environment again, as slurmstepd launches
# the next stages from outside the namespace.
++ [ srun nixsetup ]
# Intrumentation with extrae
++ optional enableExtrae extrae
# Optionally profile the next stages with perf
++ optional enablePerf perf
# Optionally profile nanos6 with the new ctf
++ optional enableCtf ctf
# Execute the hpcg app with the argv and env vars
++ [ argv hpcgFn ];
# List of actual programs to be executed
jobs = map (conf: w.stagen { inherit conf stages; }) configs;
in in
# We simply run each program one after another
w.launch jobs stdexp.genExperiment { inherit configs pipeline; }

View File

@ -1,167 +1,63 @@
{ {
stdenv stdenv
, nixpkgs , stdexp
, pkgs , bsc
, genApp , targetMachine
, genConfigs , stages
, runWrappers
}: }:
with stdenv.lib; with stdenv.lib;
let let
bsc = pkgs.bsc; # Initial variable configuration
varConf = with bsc; {
# Set variable configuration for the experiment
varConfig = {
cc = [ bsc.icc ];
gitBranch = [ "garlic/seq" ];
n = [ 104 64 ]; n = [ 104 64 ];
}; };
# Common configuration # Generate the complete configuration for each unit
common = { genConf = with bsc; c: targetMachine.config // rec {
# hpcg options
n = c.n;
cc = icc;
mpi = impi;
gitBranch = "garlic/seq";
# Repeat the execution of each unit 30 times
loops = 30;
# Resources # Resources
ntasksPerNode = "48"; qos = "debug";
nodes = "1"; ntasksPerNode = 48;
nodes = 1;
# Stage configuration time = "02:00:00";
enableSbatch = true; cpuBind = "sockets,verbose";
enableControl = true; jobName = "hpcg-${toString n}-${gitBranch}";
enableExtrae = false;
enablePerf = false;
enableCtf = false;
# MN4 path
nixPrefix = "/gpfs/projects/bsc15/nix";
}; };
# Compute the cartesian product of all configurations # Compute the array of configurations
configs = map (conf: conf // common) (genConfigs varConfig); configs = stdexp.buildConfigs {
inherit varConf genConf;
stageProgram = stage:
if stage ? programPath
then "${stage}${stage.programPath}" else "${stage}";
w = runWrappers;
sbatch = {stage, conf, ...}: with conf; w.sbatch (
# Allow a user to define a custom reservation for the job in MareNostrum4,
# by setting the garlic.sbatch.reservation attribute in the
# ~/.config/nixpkgs/config.nix file. If the attribute is not set, no
# reservation is used. The user reservation may be overwritten by the
# experiment, if the reservation is set like with nodes or ntasksPerNode.
optionalAttrs (pkgs.config ? garlic.sbatch.reservation) {
inherit (pkgs.config.garlic.sbatch) reservation;
} // {
program = stageProgram stage;
exclusive = true;
time = "02:00:00";
qos = "debug";
jobName = "hpcg";
inherit nixPrefix nodes ntasksPerNode;
}
);
control = {stage, conf, ...}: with conf; w.control {
program = stageProgram stage;
}; };
srun = {stage, conf, ...}: with conf; w.srun { exec = {nextStage, conf, ...}: with conf; stages.exec {
program = stageProgram stage; inherit nextStage;
srunOptions = "--cpu-bind=verbose,rank"; argv = [
inherit nixPrefix; "--nx=${toString n}"
}; "--ny=${toString n}"
"--nz=${toString n}"
statspy = {stage, conf, ...}: with conf; w.statspy {
program = stageProgram stage;
};
perf = {stage, conf, ...}: with conf; w.perf {
program = stageProgram stage;
perfArgs = "sched record -a";
};
nixsetup = {stage, conf, ...}: with conf; w.nixsetup {
program = stageProgram stage;
nixsetup = "${nixPrefix}/bin/nix-setup";
};
extrae = {stage, conf, ...}: w.extrae {
program = stageProgram stage;
traceLib = "mpi"; # mpi -> libtracempi.so
configFile = ./extrae.xml;
};
ctf = {stage, conf, ...}: w.argv {
program = stageProgram stage;
env = ''
export NANOS6=ctf
export NANOS6_CTF2PRV=0
'';
};
argv = {stage, conf, ...}: with conf; w.argv {
program = stageProgram stage;
argv = ''(
--nx=${toString n}
--ny=${toString n}
--nz=${toString n}
)'';
};
bscOverlay = import ../../../overlay.nix;
genPkgs = newOverlay: nixpkgs {
overlays = [
bscOverlay
newOverlay
]; ];
}; };
# We may be able to use overlays by invoking the fix function directly, but we program = {nextStage, conf, ...}: with conf;
# have to get the definition of the bsc packages and the garlic ones as let
# overlays. customPkgs = stdexp.replaceMpi conf.mpi;
in
hpcgFn = {stage, conf, ...}: with conf; customPkgs.apps.hpcg.override {
let
# We set the mpi implementation to the one specified in the conf, so all
# packages in bsc will use that one.
customPkgs = genPkgs (self: super: {
bsc = super.bsc // { mpi = conf.mpi; };
});
in
customPkgs.bsc.garlic.hpcg.override {
inherit cc gitBranch; inherit cc gitBranch;
}; };
stages = with common; [] pipeline = stdexp.stdPipeline ++ [ exec program ];
# Use sbatch to request resources first
++ optional enableSbatch sbatch
# Repeats the next stages N times
++ optionals enableControl [ nixsetup control ]
# Executes srun to launch the program in the requested nodes, and
# immediately after enters the nix environment again, as slurmstepd launches
# the next stages from outside the namespace.
++ [ srun nixsetup ]
# Intrumentation with extrae
++ optional enableExtrae extrae
# Optionally profile the next stages with perf
++ optional enablePerf perf
# Optionally profile nanos6 with the new ctf
++ optional enableCtf ctf
# Execute the hpcg app with the argv and env vars
++ [ argv hpcgFn ];
# List of actual programs to be executed
jobs = map (conf: w.stagen { inherit conf stages; }) configs;
in in
# We simply run each program one after another
w.launch jobs stdexp.genExperiment { inherit configs pipeline; }

View File

@ -1,171 +0,0 @@
{
stdenv
, nixpkgs
, pkgs
, genApp
, genConfigs
, runWrappers
}:
with stdenv.lib;
let
bsc = pkgs.bsc;
# Set variable configuration for the experiment
varConfig = {
cc = [ bsc.icc ];
mpi = [ bsc.impi ];
#gitBranch = [ "garlic/tampi+send+oss+task" ];
n = [ 104 64 ];
nodes = [1 2 4];
};
# Common configuration
common = {
# Compile time nbody config
gitBranch = "symgs_coloring_more_than_one_block_per_task_halos_blocking_discreete";
# Resources
ntasksPerNode = "48";
# Stage configuration
enableSbatch = true;
enableControl = true;
enableExtrae = false;
enablePerf = false;
enableCtf = false;
# MN4 path
nixPrefix = "/gpfs/projects/bsc15/nix";
};
# Compute the cartesian product of all configurations
configs = map (conf: conf // common) (genConfigs varConfig);
stageProgram = stage:
if stage ? programPath
then "${stage}${stage.programPath}" else "${stage}";
w = runWrappers;
sbatch = {stage, conf, ...}: with conf; w.sbatch (
# Allow a user to define a custom reservation for the job in MareNostrum4,
# by setting the garlic.sbatch.reservation attribute in the
# ~/.config/nixpkgs/config.nix file. If the attribute is not set, no
# reservation is used. The user reservation may be overwritten by the
# experiment, if the reservation is set like with nodes or ntasksPerNode.
optionalAttrs (pkgs.config ? garlic.sbatch.reservation) {
inherit (pkgs.config.garlic.sbatch) reservation;
} // {
program = stageProgram stage;
exclusive = true;
time = "02:00:00";
qos = "debug";
jobName = "nbody-tampi";
inherit nixPrefix nodes ntasksPerNode;
}
);
control = {stage, conf, ...}: with conf; w.control {
program = stageProgram stage;
};
srun = {stage, conf, ...}: with conf; w.srun {
program = stageProgram stage;
srunOptions = "--cpu-bind=verbose,rank";
inherit nixPrefix;
};
statspy = {stage, conf, ...}: with conf; w.statspy {
program = stageProgram stage;
};
perf = {stage, conf, ...}: with conf; w.perf {
program = stageProgram stage;
perfArgs = "sched record -a";
};
nixsetup = {stage, conf, ...}: with conf; w.nixsetup {
program = stageProgram stage;
nixsetup = "${nixPrefix}/bin/nix-setup";
};
extrae = {stage, conf, ...}: w.extrae {
program = stageProgram stage;
traceLib = "mpi"; # mpi -> libtracempi.so
configFile = ./extrae.xml;
};
ctf = {stage, conf, ...}: w.argv {
program = stageProgram stage;
env = ''
export NANOS6=ctf
export NANOS6_CTF2PRV=0
'';
};
argv = {stage, conf, ...}: with conf; w.argv {
program = stageProgram stage;
argv = ''(
--nx=${toString n}
--ny=${toString n}
--nz=${toString n}
)'';
};
bscOverlay = import ../../../overlay.nix;
genPkgs = newOverlay: nixpkgs {
overlays = [
bscOverlay
newOverlay
];
};
# We may be able to use overlays by invoking the fix function directly, but we
# have to get the definition of the bsc packages and the garlic ones as
# overlays.
hpcgFn = {stage, conf, ...}: with conf;
let
# We set the mpi implementation to the one specified in the conf, so all
# packages in bsc will use that one.
customPkgs = genPkgs (self: super: {
bsc = super.bsc // { mpi = conf.mpi; };
});
in
customPkgs.bsc.garlic.hpcg.override {
inherit cc mpi gitBranch;
};
stages = with common; []
# Use sbatch to request resources first
++ optional enableSbatch sbatch
# Repeats the next stages N times
++ optionals enableControl [ nixsetup control ]
# Executes srun to launch the program in the requested nodes, and
# immediately after enters the nix environment again, as slurmstepd launches
# the next stages from outside the namespace.
++ [ srun nixsetup ]
# Intrumentation with extrae
++ optional enableExtrae extrae
# Optionally profile the next stages with perf
++ optional enablePerf perf
# Optionally profile nanos6 with the new ctf
++ optional enableCtf ctf
# Execute the nbody app with the argv and env vars
++ [ argv hpcgFn ];
# List of actual programs to be executed
jobs = map (conf: w.stagen { inherit conf stages; }) configs;
in
# We simply run each program one after another
w.launch jobs

View File

@ -197,7 +197,7 @@ let
gitBranch = "garlic/mpi+send+seq"; gitBranch = "garlic/mpi+send+seq";
}; };
hpcg = callPackage ./garlic/hpcg { hpcg = callPackage ./garlic/apps/hpcg/default.nix {
cc = self.bsc.icc; cc = self.bsc.icc;
gitBranch = "garlic/seq"; gitBranch = "garlic/seq";
}; };