saiph: add gitTable

This commit is contained in:
Rodrigo Arias 2021-04-19 16:40:53 +02:00
parent 9377adf787
commit 1402111e40
2 changed files with 73 additions and 61 deletions

View File

@ -26,6 +26,7 @@
, sizex ? 3 , sizex ? 3
, sizey ? 4 , sizey ? 4
, sizez ? 4 , sizez ? 4
, garlicTools
}: }:
assert enableManualDist -> (nbgx != null); assert enableManualDist -> (nbgx != null);
@ -35,70 +36,71 @@ assert enableManualDist -> (nbgz != null);
with stdenv.lib; with stdenv.lib;
with stdenv.lib.versions; with stdenv.lib.versions;
stdenv.mkDerivation rec { let
name = "saiph"; gitSource = garlicTools.fetchGarlicApp {
appName = "saiph";
inherit gitCommit gitBranch;
gitTable = import ./git-table.nix;
};
in
stdenv.mkDerivation rec {
name = "saiph";
inherit gitBranch gitCommit; inherit (gitSource) src gitBranch gitCommit;
src = builtins.fetchGit ({
url = "ssh://git@bscpm03.bsc.es/DSLs/saiph.git";
ref = "${gitBranch}";
} // (optionalAttrs (gitCommit != null) {
rev = "${gitCommit}";
}));
programPath = "/bin/Heat3D_vect"; programPath = "/bin/Heat3D_vect";
enableParallelBuilding = true; enableParallelBuilding = true;
dontStrip = true; dontStrip = true;
enableDebugging = true; enableDebugging = true;
buildInputs = [ buildInputs = [
nanos6 nanos6
mpi mpi
tampi tampi
cc cc
vtk vtk
boost boost
]; ];
# Required for nanos6 # Required for nanos6
hardeningDisable = [ "all" ]; hardeningDisable = [ "all" ];
preBuild = ''
cd saiphv2/cpp/src
export VTK_VERSION=${majorMinor (getVersion vtk.name)}
export VTK_HOME=${vtk}
make clean
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
'';
makeFlags = [
"-f" "Makefile.${cc.CC}"
"apps"
"APP=Heat3D_vect"
] ++ 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"
;
installPhase = '' preBuild = ''
mkdir -p $out/lib cd saiphv2/cpp/src
mkdir -p $out/bin export VTK_VERSION=${majorMinor (getVersion vtk.name)}
cp obj/libsaiphv2.so $out/lib/ export VTK_HOME=${vtk}
cp bin/Heat3D_vect $out/bin/ make clean
'';
} 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
'';
makeFlags = [
"-f" "Makefile.${cc.CC}"
"apps"
"APP=Heat3D_vect"
] ++ 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"
;
installPhase = ''
mkdir -p $out/lib
mkdir -p $out/bin
cp obj/libsaiphv2.so $out/lib/
cp bin/Heat3D_vect $out/bin/
'';
}

View File

@ -0,0 +1,10 @@
{
# Auto-generated with garlic-git-table on 2021-04-19 for repo:
# ssh://git@bscpm03.bsc.es/garlic/apps/saiph.git
"garlic/mpi+isend+omp+fork+simd" = "96823846b327b6860f05d428f0cd5ed8ca537a0e";
"garlic/mpi+isend+omp+task+simd" = "de0346a559120f561bff554aa86b34d01214b714";
"garlic/mpi+isend+seq+simd" = "1411dad765231f5d3cec9f621526583974232d42";
"garlic/tampi+isend+omp+task+simd" = "587a7651df8eb69cae4a79bdfc5cb7f50723f3ce";
"garlic/tampi+isend+oss+task+simd" = "3731197d3e35df248fa6bdb7e4cb05c5dd4f2597";
}