2020-06-30 12:19:36 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, nanos6
|
|
|
|
, mpi
|
|
|
|
, tampi
|
2020-09-23 13:10:12 +02:00
|
|
|
, cc
|
2020-06-30 12:19:36 +02:00
|
|
|
, vtk
|
|
|
|
, boost
|
2020-09-21 17:30:24 +02:00
|
|
|
, gitBranch ? "master"
|
2021-02-23 11:51:07 +01:00
|
|
|
, gitCommit ? null
|
2021-03-24 09:08:55 +01:00
|
|
|
, enableManualDist ? false
|
2021-02-25 17:59:35 +01:00
|
|
|
, nbgx ? null
|
|
|
|
, nbgy ? null
|
|
|
|
, nbgz ? null
|
|
|
|
, nblx ? null
|
|
|
|
, nbly ? null
|
|
|
|
, nblz ? null
|
2021-02-19 11:18:11 +01:00
|
|
|
, nsteps ? null
|
2021-03-24 09:08:55 +01:00
|
|
|
, numComm ? null
|
|
|
|
, enableVectFlags ? false
|
|
|
|
, enableDebugFlags ? false
|
|
|
|
, enableAsanFlags ? false
|
2021-04-01 19:02:35 +02:00
|
|
|
, cachelineBytes ? null
|
|
|
|
, L3SizeKB ? null
|
|
|
|
# Problem size:
|
|
|
|
, sizex ? 3
|
|
|
|
, sizey ? 4
|
|
|
|
, sizez ? 4
|
2020-06-30 12:19:36 +02:00
|
|
|
}:
|
|
|
|
|
2021-04-01 19:02:35 +02:00
|
|
|
assert enableManualDist -> (nbgx != null);
|
|
|
|
assert enableManualDist -> (nbgy != null);
|
|
|
|
assert enableManualDist -> (nbgz != null);
|
|
|
|
|
2020-11-12 19:37:30 +01:00
|
|
|
with stdenv.lib;
|
2021-04-01 19:02:35 +02:00
|
|
|
with stdenv.lib.versions;
|
2020-11-12 19:37:30 +01:00
|
|
|
|
2020-06-30 12:19:36 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2020-07-02 14:47:10 +02:00
|
|
|
name = "saiph";
|
2020-06-30 12:19:36 +02:00
|
|
|
|
2021-02-23 11:51:07 +01:00
|
|
|
inherit gitBranch gitCommit;
|
|
|
|
src = builtins.fetchGit ({
|
2020-12-07 13:47:17 +01:00
|
|
|
url = "ssh://git@bscpm03.bsc.es/DSLs/saiph.git";
|
2020-11-12 19:10:43 +01:00
|
|
|
ref = "${gitBranch}";
|
2021-04-01 19:02:35 +02:00
|
|
|
} // (optionalAttrs (gitCommit != null) {
|
|
|
|
rev = "${gitCommit}";
|
|
|
|
}));
|
2020-06-30 12:19:36 +02:00
|
|
|
|
2020-11-12 19:37:30 +01:00
|
|
|
programPath = "/bin/Heat3D_vect";
|
2020-06-30 12:19:36 +02:00
|
|
|
|
2020-09-21 19:23:17 +02:00
|
|
|
enableParallelBuilding = true;
|
2020-07-02 14:47:10 +02:00
|
|
|
dontStrip = true;
|
2020-07-03 11:13:41 +02:00
|
|
|
enableDebugging = true;
|
2020-06-30 12:19:36 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
nanos6
|
|
|
|
mpi
|
|
|
|
tampi
|
2020-09-23 13:10:12 +02:00
|
|
|
cc
|
2020-06-30 12:19:36 +02:00
|
|
|
vtk
|
|
|
|
boost
|
|
|
|
];
|
|
|
|
|
2020-09-21 19:23:17 +02:00
|
|
|
# Required for nanos6
|
2021-04-01 19:02:35 +02:00
|
|
|
hardeningDisable = [ "all" ];
|
2020-09-21 17:30:24 +02:00
|
|
|
|
2020-07-02 15:54:41 +02:00
|
|
|
preBuild = ''
|
2020-10-07 11:53:47 +02:00
|
|
|
cd saiphv2/cpp/src
|
2021-04-01 19:02:35 +02:00
|
|
|
export VTK_VERSION=${majorMinor (getVersion vtk.name)}
|
2020-07-02 14:47:10 +02:00
|
|
|
export VTK_HOME=${vtk}
|
2020-11-12 19:10:43 +01:00
|
|
|
make clean
|
2020-06-30 12:19:36 +02:00
|
|
|
|
2021-04-01 19:02:35 +02:00
|
|
|
sed -i '/SIZEX =/s/3/${toString sizex}/g' testApp/Heat3D_vect.cpp
|
|
|
|
sed -i '/SIZEY =/s/4/${toString sizey}/g' testApp/Heat3D_vect.cpp
|
|
|
|
sed -i '/SIZEZ =/s/4/${toString sizez}/g' testApp/Heat3D_vect.cpp
|
|
|
|
'';
|
2021-03-24 09:08:55 +01:00
|
|
|
|
2020-07-02 15:54:41 +02:00
|
|
|
makeFlags = [
|
2020-12-03 18:06:51 +01:00
|
|
|
"-f" "Makefile.${cc.CC}"
|
2020-07-02 15:54:41 +02:00
|
|
|
"apps"
|
2020-11-12 19:37:30 +01:00
|
|
|
"APP=Heat3D_vect"
|
2021-04-01 19:02:35 +02:00
|
|
|
] ++ optional (cachelineBytes != null) "ROW_ALIGNMENT=${toString cachelineBytes}"
|
|
|
|
++ optional (L3SizeKB != null) "L3_SIZE_K=${toString L3SizeKB}"
|
|
|
|
++ optional (enableManualDist) "DIST_SET=1"
|
|
|
|
++ optional (enableManualDist) "NBG_X=${toString nbgx}"
|
|
|
|
++ optional (enableManualDist) "NBG_Y=${toString nbgy}"
|
|
|
|
++ optional (enableManualDist) "NBG_Z=${toString nbgz}"
|
|
|
|
++ optional (nblx != null) "NBL_X=${toString nblx}"
|
|
|
|
++ optional (nbly != null) "NBL_Y=${toString nbly}"
|
|
|
|
++ optional (nblz != null) "NBL_Z=${toString nblz}"
|
|
|
|
++ optional (nsteps != null) "NSTEPS=${toString nsteps}"
|
|
|
|
++ optional (numComm != null) "NUM_COMM=${toString numComm}"
|
|
|
|
++ optional (enableVectFlags) "VECT_CHECKS=1"
|
|
|
|
++ optional (enableDebugFlags) "DEBUG_CHECKS=1"
|
|
|
|
++ optional (enableAsanFlags) "SANITIZE_CHECKS=1"
|
2020-11-12 19:37:30 +01:00
|
|
|
;
|
|
|
|
|
2020-06-30 12:19:36 +02:00
|
|
|
installPhase = ''
|
2020-07-02 14:47:10 +02:00
|
|
|
mkdir -p $out/lib
|
2020-06-30 12:19:36 +02:00
|
|
|
mkdir -p $out/bin
|
2020-07-02 14:47:10 +02:00
|
|
|
cp obj/libsaiphv2.so $out/lib/
|
2020-11-12 19:37:30 +01:00
|
|
|
cp bin/Heat3D_vect $out/bin/
|
2020-06-30 12:19:36 +02:00
|
|
|
'';
|
|
|
|
}
|