bscpkgs/garlic/exp/nbody/common.nix

38 lines
746 B
Nix
Raw Normal View History

{
stdenv
2022-09-01 16:27:29 +02:00
, lib
, stdexp
, bsc
, stages
, numactl
, garlicTools
}:
2022-09-01 16:27:29 +02:00
with lib;
with garlicTools;
rec {
getConfigs = {varConf, genConf}: stdexp.buildConfigs {
inherit varConf genConf;
};
exec = {nextStage, conf, ...}: stages.exec
(
{
inherit nextStage;
argv = with conf; [ "-t" timesteps "-p" particles ];
}
# Use numactl to use the interleave policy if requested (default is
# false)
// optionalAttrs (conf.interleaveMem or false) {
program = "${numactl}/bin/numactl --interleave=all ${stageProgram nextStage}";
}
);
program = {nextStage, conf, ...}: bsc.garlic.apps.nbody.override {
inherit (conf) blocksize gitBranch;
};
pipeline = stdexp.stdPipeline ++ [ exec program ];
}