saiph: add extra parameters for the app

This commit is contained in:
Rodrigo Arias 2021-04-01 19:02:35 +02:00
parent 5ea9ff5ad8
commit 0e0f1b265f
2 changed files with 36 additions and 24 deletions

View File

@ -13,6 +13,8 @@
saiph = callPackage ./saiph/default.nix { saiph = callPackage ./saiph/default.nix {
cc = bsc.clangOmpss2; cc = bsc.clangOmpss2;
L3SizeKB = garlic.targetMachine.config.hw.cacheSizeKB.L3;
cachelineBytes = garlic.targetMachine.config.hw.cachelineBytes;
}; };
creams = callPackage ./creams/default.nix { creams = callPackage ./creams/default.nix {

View File

@ -20,11 +20,20 @@
, enableVectFlags ? false , enableVectFlags ? false
, enableDebugFlags ? false , enableDebugFlags ? false
, enableAsanFlags ? false , enableAsanFlags ? false
, cachelineBytes ? 64 , cachelineBytes ? null
, l3sizeKBytes ? 33792 , L3SizeKB ? null
# Problem size:
, sizex ? 3
, sizey ? 4
, sizez ? 4
}: }:
assert enableManualDist -> (nbgx != null);
assert enableManualDist -> (nbgy != null);
assert enableManualDist -> (nbgz != null);
with stdenv.lib; with stdenv.lib;
with stdenv.lib.versions;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "saiph"; name = "saiph";
@ -33,9 +42,9 @@ stdenv.mkDerivation rec {
src = builtins.fetchGit ({ src = builtins.fetchGit ({
url = "ssh://git@bscpm03.bsc.es/DSLs/saiph.git"; url = "ssh://git@bscpm03.bsc.es/DSLs/saiph.git";
ref = "${gitBranch}"; ref = "${gitBranch}";
} // (if (gitCommit != null) then { } // (optionalAttrs (gitCommit != null) {
rev = gitCommit; rev = "${gitCommit}";
} else {})); }));
programPath = "/bin/Heat3D_vect"; programPath = "/bin/Heat3D_vect";
@ -53,25 +62,26 @@ stdenv.mkDerivation rec {
]; ];
# Required for nanos6 # Required for nanos6
hardeningDisable = [ "bindnow" ]; hardeningDisable = [ "all" ];
preBuild = '' preBuild = ''
cd saiphv2/cpp/src cd saiphv2/cpp/src
export VTK_VERSION=8.2 export VTK_VERSION=${majorMinor (getVersion vtk.name)}
export VTK_HOME=${vtk} export VTK_HOME=${vtk}
make clean make clean
'';
#NIX_CFLAGS_COMPILE = "-O1 -g"; sed -i '/SIZEX =/s/3/${toString sizex}/g' testApp/Heat3D_vect.cpp
#NIX_DEBUG = 5; 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 = [ makeFlags = [
"-f" "Makefile.${cc.CC}" "-f" "Makefile.${cc.CC}"
"apps" "apps"
"APP=Heat3D_vect" "APP=Heat3D_vect"
"ROW_ALIGNMENT=${toString cachelineBytes}" ] ++ optional (cachelineBytes != null) "ROW_ALIGNMENT=${toString cachelineBytes}"
"L3_SIZE_K=${toString l3sizeKBytes}" ++ optional (L3SizeKB != null) "L3_SIZE_K=${toString L3SizeKB}"
] ++ optional (enableManualDist) "DIST_SET=1" ++ optional (enableManualDist) "DIST_SET=1"
++ optional (enableManualDist) "NBG_X=${toString nbgx}" ++ optional (enableManualDist) "NBG_X=${toString nbgx}"
++ optional (enableManualDist) "NBG_Y=${toString nbgy}" ++ optional (enableManualDist) "NBG_Y=${toString nbgy}"
++ optional (enableManualDist) "NBG_Z=${toString nbgz}" ++ optional (enableManualDist) "NBG_Z=${toString nbgz}"