From 9377adf787bb4dda2fdff9fc4eba7ade07e17008 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 19 Apr 2021 13:32:43 +0200 Subject: [PATCH] fwi: add gitTable --- garlic/apps/fwi/default.nix | 97 ++++++++++++++++++----------------- garlic/apps/fwi/git-table.nix | 15 ++++++ 2 files changed, 66 insertions(+), 46 deletions(-) create mode 100644 garlic/apps/fwi/git-table.nix diff --git a/garlic/apps/fwi/default.nix b/garlic/apps/fwi/default.nix index ef31127..f58a2af 100644 --- a/garlic/apps/fwi/default.nix +++ b/garlic/apps/fwi/default.nix @@ -5,65 +5,70 @@ , mcxx ? null , cc , gitBranch ? "garlic/tampi+send+oss+task" +, gitCommit ? null , fwiParams +, garlicTools }: with stdenv.lib; assert !(tampi != null && mcxx == null); -stdenv.mkDerivation rec { - inherit gitBranch; - name = "fwi"; - - src = builtins.fetchGit { - url = "ssh://git@bscpm03.bsc.es/garlic/apps/fwi.git"; - ref = "${gitBranch}"; +let + gitSource = garlicTools.fetchGarlicApp { + appName = "fwi"; + inherit gitCommit gitBranch; + gitTable = import ./git-table.nix; }; +in + stdenv.mkDerivation rec { + name = "fwi"; - enableParallelBuilding = false; + inherit (gitSource) src gitBranch gitCommit; - buildInputs = [ - cc - ] - ++ optional (mpi != null) mpi - ++ optional (tampi != null) tampi - ++ optional (mcxx != null) mcxx; + enableParallelBuilding = false; - # FIXME: Correct this on the Makefile so we can just type "make fwi" - # FIXME: Allow multiple MPI implementations - postPatch = '' - sed -i 's/= OPENMPI$/= INTEL/g' Makefile - sed -i 's/USE_O_DIRECT ?= NO/USE_O_DIRECT ?= YES/g' Makefile || true - ''; + buildInputs = [ + cc + ] + ++ optional (mpi != null) mpi + ++ optional (tampi != null) tampi + ++ optional (mcxx != null) mcxx; - # FIXME: This is an ugly hack. - # When using _GNU_SOURCE or any other definition used in features.h, we need - # to define them before mcc includes nanos6.h from the command line. So the - # only chance is by setting it at the command line with -D. Using the DEFINES - # below, reaches the command line of the preprocessing stage with gcc. - preConfigure = '' - export DEFINES=-D_GNU_SOURCE + # FIXME: Correct this on the Makefile so we can just type "make fwi" + # FIXME: Allow multiple MPI implementations + postPatch = '' + sed -i 's/= OPENMPI$/= INTEL/g' Makefile + sed -i 's/USE_O_DIRECT ?= NO/USE_O_DIRECT ?= YES/g' Makefile || true + ''; - make depend + # FIXME: This is an ugly hack. + # When using _GNU_SOURCE or any other definition used in features.h, we need + # to define them before mcc includes nanos6.h from the command line. So the + # only chance is by setting it at the command line with -D. Using the DEFINES + # below, reaches the command line of the preprocessing stage with gcc. + preConfigure = '' + export DEFINES=-D_GNU_SOURCE - cp ${fwiParams}/generated_model_params.h src/ - ''; - - # We compile the ModelGenerator using gcc *only*, as otherwise it will - # be compiled with nanos6, which requires access to /sys to determine - # hardware capabilities. So it will fail in the nix-build environment, - # as there is no /sys mounted. - makeFlags = [ - #"COMPILER=GNU" - #"CC=${cc.cc.CC}" - "fwi" - ]; + make depend - installPhase = '' - mkdir -p $out/bin - cp fwi $out/bin - ''; + cp ${fwiParams}/generated_model_params.h src/ + ''; - programPath = "/bin/fwi"; -} + # We compile the ModelGenerator using gcc *only*, as otherwise it will + # be compiled with nanos6, which requires access to /sys to determine + # hardware capabilities. So it will fail in the nix-build environment, + # as there is no /sys mounted. + makeFlags = [ + #"COMPILER=GNU" + #"CC=${cc.cc.CC}" + "fwi" + ]; + + installPhase = '' + mkdir -p $out/bin + cp fwi $out/bin + ''; + + programPath = "/bin/fwi"; + } diff --git a/garlic/apps/fwi/git-table.nix b/garlic/apps/fwi/git-table.nix new file mode 100644 index 0000000..c20adff --- /dev/null +++ b/garlic/apps/fwi/git-table.nix @@ -0,0 +1,15 @@ +{ + # Auto-generated with garlic-git-table on 2021-04-19 for repo: + # ssh://git@bscpm03.bsc.es/garlic/apps/fwi.git + + "garlic/mpi+send+omp+fork" = "ea1ed53f20858dc082f9cbbe0e7e8fb28a6fe58a"; + "garlic/mpi+send+omp+task" = "aa8881056fb3fa98832d203899beacfb8fa702f6"; + "garlic/mpi+send+oss+task" = "c184484af8498fd939761575b34bb46ba3be0dde"; + "garlic/mpi+send+oss+task+NOREUSE" = "0062093ef744c694d69673d1881719958bbed353"; + "garlic/mpi+send+seq" = "cc184ad77f143481e2506933d0cdc038c349f071"; + "garlic/omp+task" = "1fe23690d74ae89ace5383ab165a6ce6346c2afd"; + "garlic/oss+task" = "68e6e8f17ee03addb460745acea2a38241ca89ee"; + "garlic/seq" = "aa6b6c5857125796c65fbf23018d557e4693f1ae"; + "garlic/tampi+isend+oss+task" = "7c98194e13786c4e8ecfa8a144587e5a95e09205"; + "garlic/tampi+send+oss+task" = "e08d66f7453c4034a363bb2d22c5248fe86ed740"; +}