Skip to content

Commit

Permalink
[dynres] miniapps: refactor and add fortran app
Browse files Browse the repository at this point in the history
  • Loading branch information
augu5te committed Oct 17, 2023
1 parent bc8c4aa commit d92bb0a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion nur.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ rec {
#Time-X EuroHPC project: dynres (mpi and dynamicity)
pmix-dynres = pkgs.callPackage ./pkgs/pmix-dynres { };
prrte-dynres = pkgs.callPackage ./pkgs/prrte-dynres { pmix = pmix-dynres; };
openmpi-dynres = pkgs.callPackage ./pkgs/openmpi-dynres { pmix = pmix-dynres; prrte = prrte-dynres; };
openmpi-dynres = pkgs.callPackage ./pkgs/openmpi-dynres { fortranSupport = true; pmix = pmix-dynres; prrte = prrte-dynres; };
miniapps-dynres = pkgs.callPackage ./pkgs/miniapps-dynres { openmpi-dynres = openmpi-dynres; };
dyn_rm-dynres = pkgs.callPackage ./pkgs/dyn_rm-dynres { pmix = pmix-dynres; };

Expand Down
33 changes: 23 additions & 10 deletions pkgs/miniapps-dynres/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitLab, scons, openmpi-dynres
{ lib, stdenv, fetchFromGitLab, scons, gfortran, openmpi-dynres
} :

stdenv.mkDerivation rec {
Expand All @@ -10,27 +10,40 @@ stdenv.mkDerivation rec {
group = "dynres";
owner = "applications";
repo = pname;
rev = "ec96341aae5b30b9e4348972f46a8478443fc8b7";
sha256 = "sha256-7HgSDaGfWSdJtaKlCHweiW1yE7AIftvTgdM1br8B7gY=";
#rev = "ec96341aae5b30b9e4348972f46a8478443fc8b7";
#sha256 = "sha256-7HgSDaGfWSdJtaKlCHweiW1yE7AIftvTgdM1br8B7gY=";
rev = "204f360206030930cef7185f5258aac21c89f334";
sha256 = "sha256-F3K2wP0LRVY4mDrPqGEtxrmUCzAJSANaE9Mt72Kk08Q=";
};

postPatch = ''
substituteInPlace SConstruct --replace "/usr/bin/g++" "g++"
substituteInPlace SConstruct --replace "['include']" "'${openmpi-dynres}/include'"
#substituteInPlace SConstruct --replace "/usr/bin/g++" "g++"
#substituteInPlace SConstruct --replace "['include']" "'${openmpi-dynres}/include'"
substituteInPlace dyn_mpi_sessions_test_all.sh --replace "-x LD_LIBRARY_PATH -x DYNMPI_BASE \$DYNMPI_BASE/build/test_applications/build/" " "
substituteInPlace dyn_mpi_sessions_test_all_8nodes.sh --replace "-x LD_LIBRARY_PATH -x DYNMPI_BASE \$DYNMPI_BASE/build/test_applications/build/" " "
'';

nativeBuildInputs = [ scons openmpi-dynres ];
nativeBuildInputs = [ scons openmpi-dynres gfortran ];

buildInputs = [ ];

buildPhase = ''
export LD_LIBRARY_PATH=${openmpi-dynres}/lib
scons example=DynMPISessions_v2a compileMode=release
'';
#export LD_LIBRARY_PATH=${openmpi-dynres}/lib
mpic++ -o build/DynMPISessions_v2a_release -O3 -mtune=native -std=gnu++11 -DNDEBUG examples/dyn_mpi_sessions_v2a.cpp
mpic++ -o build/DynMPISessions_v2a_nb_release -O3 -mtune=native -std=gnu++11 -DNDEBUG examples/dyn_mpi_sessions_v2a_nb.cpp
#scons example=DynMPISessions_v2a compileMode=release
#scons example=DynMPISessions_v2a_nb compileMode=release
#scons example=DynMPISessions_v2a_fortran compileMode=release
mpif90 -o ./build/dyn_mpi_sessions_v2a_fortran -ffree-line-length-none -cpp -O3 -mtune=native ./examples/util.f90 ./examples/dyn_mpi_sessions_v2a.f90
'';

installPhase = ''
cp -a build $out/
mkdir -p $out/bin
cp -a build/* $out/bin
cp dyn_mpi_sessions_test_all_8nodes.sh dyn_mpi_sessions_test_all.sh $out/bin
'';

meta = with lib; {
description = "Time-X EuroHPC project: miniapps";
homepage = "";
Expand Down

0 comments on commit d92bb0a

Please sign in to comment.