Testing experiments with nbody

This commit is contained in:
Rodrigo Arias 2020-07-27 17:55:56 +02:00
parent b042e783e5
commit b93851ba93
2 changed files with 70 additions and 0 deletions

View File

@ -16,6 +16,11 @@ let
ppong = callPackage ./ppong { };
nbody = callPackage ./nbody {
cc = pkgs.gcc7;
gitBranch = "garlic/seq";
};
exp = {
mpiImpl = callPackage ./experiments {
apps = genApps [ ppong ] (
@ -24,6 +29,27 @@ let
}
);
};
nbody = callPackage ./experiments {
apps = genApps [ nbody ] (
genConfigs {
cc = [ pkgs.gcc7 pkgs.gcc9 ];
gitBranch = [ "garlic/seq" ];
}
);
};
# Test if there is any difference between intel -march and -xCORE
# with target avx2.
march = callPackage ./experiments {
apps = genApps [ nbody ] (( genConfigs {
cc = [ bsc.icc ];
cflags = [ "-march=core-avx2" "-xCORE-AVX2" ];
}) ++ ( genConfigs {
cc = [ bsc.clang-ompss2 ];
cflags = [ "-march=core-avx2" ];
}));
};
};
};

View File

@ -0,0 +1,44 @@
{
stdenv
, cc
, cflags ? null
, gitBranch
, blocksize ? "2048"
, particles ? "16384"
, timesteps ? "10"
}:
stdenv.mkDerivation {
name = "nbody";
src = builtins.fetchGit {
url = "ssh://git@bscpm02.bsc.es/rarias/nbody.git";
ref = gitBranch;
};
buildInputs = [
cc
];
preBuild = (if cflags != null then ''
makeFlagsArray+=(CFLAGS=${cflags})
'' else "");
makeFlags = [
"CC=${cc.cc.CC}"
"BS=${blocksize}"
];
installPhase = ''
mkdir -p $out/bin
cp nbody $out/bin/
cat > $out/bin/run <<EOF
#!/bin/bash
exec $out/bin/nbody -p ${particles} -t ${timesteps}
EOF
chmod +x $out/bin/run
'';
}