From 20e99f122fca90344a29f2183932017854adbc45 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 19 Apr 2021 13:17:24 +0200 Subject: [PATCH] creams: use gitTable for all branches --- garlic/apps/creams/default.nix | 70 ++++++++++++++------------------ garlic/apps/creams/git-table.nix | 12 ++++++ garlic/apps/creams/input.nix | 47 +++++++++++---------- garlic/apps/index.nix | 5 +-- 4 files changed, 69 insertions(+), 65 deletions(-) create mode 100644 garlic/apps/creams/git-table.nix diff --git a/garlic/apps/creams/default.nix b/garlic/apps/creams/default.nix index a37bf02..cdcc14e 100644 --- a/garlic/apps/creams/default.nix +++ b/garlic/apps/creams/default.nix @@ -9,59 +9,49 @@ , gnuDef , intelDef , cc -, gitBranch +, gitBranch ? "garlic/mpi+send+seq" +, gitCommit ? null +, garlicTools }: assert (mpi == impi || mpi == openmpi); let - mpiName = (if mpi == openmpi then - "OpenMPI" - else - "IntelMPI"); + # FIXME: We should find a better way to specify the MPI implementation + # and the compiler. + mpiName = if mpi == openmpi then "OpenMPI" else "IntelMPI"; + compName = if cc == intelDef then "Intel" else "GNU"; - compName = (if cc == intelDef then - "Intel" - else - "GNU"); - -in -stdenv.mkDerivation rec { - name = "creams"; - - # src = /home/Computational/pmartin1/creams-simplified; - src = builtins.fetchGit { - url = "ssh://git@bscpm03.bsc.es/pmartin1/creams-simplified.git"; - ref = "${gitBranch}"; + gitSource = garlicTools.fetchGarlicApp { + appName = "creams"; + inherit gitCommit gitBranch; + gitTable = import ./git-table.nix; }; +in + stdenv.mkDerivation rec { + name = "creams"; - programPath = "/bin/creams.exe"; + inherit (gitSource) src gitBranch gitCommit; - buildInputs = [ - nanos6 - mpi - cc - tampi - mcxx - ]; + programPath = "/bin/creams.exe"; - hardeningDisable = [ "all" ]; + buildInputs = [ nanos6 mpi cc tampi mcxx ]; - configurePhase = '' - export TAMPI_HOME=${tampi} + hardeningDisable = [ "all" ]; - . etc/bashrc + configurePhase = '' + export TAMPI_HOME=${tampi} - export FORTRAN_COMPILER=${compName} - export MPI_LIB=${mpiName} + . etc/bashrc - echo + export FORTRAN_COMPILER=${compName} + export MPI_LIB=${mpiName} - CREAMS_UPDATE_ENVIRONMENT - ''; + CREAMS_UPDATE_ENVIRONMENT + ''; - installPhase = '' - mkdir -p $out/bin - cp -a build/* $out/bin - ''; -} + installPhase = '' + mkdir -p $out/bin + cp -a build/* $out/bin + ''; + } diff --git a/garlic/apps/creams/git-table.nix b/garlic/apps/creams/git-table.nix new file mode 100644 index 0000000..9600240 --- /dev/null +++ b/garlic/apps/creams/git-table.nix @@ -0,0 +1,12 @@ +{ + # Auto-generated with garlic-git-table on 2021-03-31 for repo: + # ssh://git@bscpm03.bsc.es/pmartin1/creams-simplified.git + + "garlic/mpi+isend+omp+task" = "e6aa540820ee12d3d45d0eef8e7eeb2f0f1daea2"; + "garlic/mpi+isend+oss+task" = "016f33b8bec996a4546e8f08b1b6b1709f00499b"; + "garlic/mpi+send+omp+fork" = "e56e059264ad1bfe5e0c96a8b9303d21dd7fa20a"; + "garlic/mpi+send+omp+task" = "919580213de34bc5b6ba60c768c5dde5e501a1f6"; + "garlic/mpi+send+oss+task" = "adab8b66f27317d51445648302e7b133edf4837d"; + "garlic/mpi+send+seq" = "956125f9334493d31ceee3fa7024efa65bee9ca5"; + "garlic/tampi+isend+oss+task" = "14a121627679a251909d4b8103d260e27eac1d29"; +} diff --git a/garlic/apps/creams/input.nix b/garlic/apps/creams/input.nix index 60d0801..8febb5b 100644 --- a/garlic/apps/creams/input.nix +++ b/garlic/apps/creams/input.nix @@ -2,30 +2,35 @@ stdenv , granul ? 0 , nprocz ? 0 -, gitBranch +, gitBranch ? "garlic/mpi+send+seq" +, gitCommit ? null +, garlicTools }: -stdenv.mkDerivation rec { - name = "creams-input"; - - # src = /home/Computational/pmartin1/creams-simplified; - src = builtins.fetchGit { - url = "ssh://git@bscpm03.bsc.es/pmartin1/creams-simplified.git"; - ref = "${gitBranch}"; +let + gitSource = garlicTools.fetchGarlicApp { + appName = "creams"; + inherit gitCommit gitBranch; + gitTable = import ./git-table.nix; }; +in + stdenv.mkDerivation rec { + name = "creams-input"; - phases = [ "unpackPhase" "patchPhase" "installPhase" ]; + inherit (gitSource) src gitBranch gitCommit; - patchPhase = '' - patchShebangs SodTubeBenchmark/gridScript.sh - ''; - - installPhase = '' - pushd SodTubeBenchmark - ./gridScript.sh 0 0 ${toString nprocz} ${toString granul} - popd + phases = [ "unpackPhase" "patchPhase" "installPhase" ]; - mkdir -p $out - cp -a SodTubeBenchmark $out/ - ''; -} + patchPhase = '' + patchShebangs SodTubeBenchmark/gridScript.sh + ''; + + installPhase = '' + pushd SodTubeBenchmark + ./gridScript.sh 0 0 ${toString nprocz} ${toString granul} + popd + + mkdir -p $out + cp -a SodTubeBenchmark $out/ + ''; + } diff --git a/garlic/apps/index.nix b/garlic/apps/index.nix index c9e32b8..ec54cd3 100644 --- a/garlic/apps/index.nix +++ b/garlic/apps/index.nix @@ -20,12 +20,9 @@ creams = callPackage ./creams/default.nix { gnuDef = self.gfortran10 ; # Default GNU compiler version intelDef = bsc.icc ; # Default Intel compiler version - gitBranch = "garlic/mpi+send+seq"; }; - creamsInput = callPackage ./creams/input.nix { - gitBranch = "garlic/mpi+send+seq"; - }; + creamsInput = callPackage ./creams/input.nix { }; hpcg = callPackage ./hpcg/default.nix { gitBranch = "garlic/tampi+isend+oss+task";