2020-09-30 17:32:49 +02:00
|
|
|
{
|
|
|
|
stdenv
|
2021-05-03 11:10:19 +02:00
|
|
|
, python3
|
|
|
|
, granul ? 9
|
|
|
|
, nprocx ? 1
|
|
|
|
, nprocy ? 1
|
|
|
|
, nprocz ? 1
|
|
|
|
, nx ? 20
|
|
|
|
, ny ? 20
|
|
|
|
, nz ? 7000
|
2021-04-19 13:17:24 +02:00
|
|
|
, gitBranch ? "garlic/mpi+send+seq"
|
|
|
|
, gitCommit ? null
|
|
|
|
, garlicTools
|
2020-09-30 17:32:49 +02:00
|
|
|
}:
|
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
let
|
|
|
|
gitSource = garlicTools.fetchGarlicApp {
|
|
|
|
appName = "creams";
|
|
|
|
inherit gitCommit gitBranch;
|
|
|
|
gitTable = import ./git-table.nix;
|
2020-09-30 17:32:49 +02:00
|
|
|
};
|
2021-05-03 11:10:19 +02:00
|
|
|
|
|
|
|
gen = ./gen_grid.py;
|
2021-04-19 13:17:24 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "creams-input";
|
|
|
|
|
2021-05-03 11:10:19 +02:00
|
|
|
buildInputs = [ python3 ];
|
2021-04-19 13:17:24 +02:00
|
|
|
|
2021-05-03 11:10:19 +02:00
|
|
|
inherit (gitSource) src gitBranch gitCommit;
|
2020-09-30 17:32:49 +02:00
|
|
|
|
2021-05-03 11:10:19 +02:00
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
2020-10-01 16:48:35 +02:00
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -a SodTubeBenchmark $out/
|
2021-04-06 19:19:24 +02:00
|
|
|
|
2021-05-03 11:10:19 +02:00
|
|
|
python3 ${gen} \
|
|
|
|
--npx ${toString nprocx} \
|
|
|
|
--npy ${toString nprocy} \
|
|
|
|
--npz ${toString nprocz} \
|
|
|
|
--grain ${toString granul} \
|
|
|
|
--nx ${toString nx} \
|
|
|
|
--ny ${toString ny} \
|
|
|
|
--nz ${toString nz} \
|
|
|
|
> $out/SodTubeBenchmark/grid.dat
|
|
|
|
'';
|
2021-04-19 13:17:24 +02:00
|
|
|
}
|