mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-11 22:49:56 +08:00
Compare commits
7 Commits
6efc29a7a4
...
93dc607cb5
| Author | SHA1 | Date | |
|---|---|---|---|
| 93dc607cb5 | |||
| f653471c23 | |||
| 0416427642 | |||
| 9595bed7c0 | |||
| e2556f3a04 | |||
| f5e70e16b2 | |||
| ebc05b9911 |
@@ -9,7 +9,7 @@ let
|
||||
nixpkgs = { march = "haswell"; nixRoot = "/data/gpfs01/wlin/.nix"; nixos = false; };
|
||||
});
|
||||
python = pkgs.python3.withPackages (ps: with ps; [ phonopy ]);
|
||||
chn-bsub = pkgs.localPackages.chn-bsub.overrideAttrs
|
||||
chn-bsub = pkgs.localPackages.chn-bsub.override
|
||||
(prev: { bsubConfig = builtins.toFile "bsub.yaml" (builtins.toJSON (import ./bsub.nix)); });
|
||||
wlin = pkgs.symlinkJoin
|
||||
{
|
||||
@@ -20,6 +20,6 @@ let
|
||||
lsd
|
||||
];
|
||||
postBuild = "echo ${inputs.self.rev or "dirty"} > $out/.version";
|
||||
passthru = { inherit pkgs; archive = pkgs.closureInfo { rootPaths = [ wlin.drvPath ]; }; };
|
||||
passthru = { inherit pkgs chn-bsub; archive = pkgs.closureInfo { rootPaths = [ wlin.drvPath ]; }; };
|
||||
};
|
||||
in wlin
|
||||
|
||||
@@ -73,6 +73,11 @@ in platformConfig //
|
||||
{ commandLineArgs = prev.commandLineArgs or "" + " --disable-features=GlobalShortcutsPortal"; });
|
||||
xray = prev.xray.overrideAttrs (prev: { patches = prev.patches or [] ++ [ ./xray.patch ]; });
|
||||
btop = prev.btop.overrideAttrs (prev: { patches = prev.patches or [] ++ [ ./btop.patch ]; });
|
||||
prrte = prev.prrte.overrideAttrs (prev:
|
||||
{
|
||||
configureFlags = prev.configureFlags or [] ++ [ "--with-lsf" ];
|
||||
buildInputs = prev.buildInputs or [] ++ [ final.localPackages.lsf final.libnsl ];
|
||||
});
|
||||
}
|
||||
// (
|
||||
let
|
||||
|
||||
@@ -211,4 +211,13 @@
|
||||
structuredExtraConfig = { BTRFS_ALLOCATOR_HINTS = lib.kernel.yes; BTRFS_READ_POLICIES = lib.kernel.yes; };
|
||||
};
|
||||
};
|
||||
# download include from /opt/ibm/lsfsuite/lsf/10.1/include into lsf/include
|
||||
# download lib from /opt/ibm/lsfsuite/lsf/10.1/linux2.6-glibc2.3-x86_64/lib into lsf/lib and only preserve .so
|
||||
lsf = pkgs.requireFile
|
||||
{
|
||||
name = "lsf";
|
||||
sha256 = "0rij4xx705yj1vr5jd31hb8izmb35vkrdql0850qc5cn30jnkf4l";
|
||||
hashMode = "recursive";
|
||||
message = "lsf not found.";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
Queues:
|
||||
normal: [ 4, 4, 20 ]
|
||||
normal_1day: [ 4, 7, 28 ]
|
||||
|
||||
normal: [ 4, 4, 20 ]
|
||||
normal_1day: [ 4, 7, 28 ]
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
postInstall = "ln -s chn-bsub $out/bin/chn_bsub";
|
||||
cmakeFlags = lib.optional (bsubConfig != null) [ "-DBSUB_CONFIG=${bsubConfig}" ];
|
||||
passthru = { inherit bsubConfig; };
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ int main()
|
||||
}();
|
||||
std::string OutputFile = "output.txt";
|
||||
} State;
|
||||
struct { std::map<std::string, std::array<int, 3>> Queues; } QueueConfig =
|
||||
std::map<std::string, std::array<int, 3>> QueueConfig =
|
||||
YAML::LoadFile(BSUB_CONFIG).as<decltype(QueueConfig)>();
|
||||
State.QueueEntries = QueueConfig.Queues
|
||||
State.QueueEntries = QueueConfig
|
||||
| ranges::views::transform([](auto const& item) { return item.first; })
|
||||
| ranges::to_vector;
|
||||
|
||||
@@ -140,7 +140,7 @@ int main()
|
||||
State.CurrentInterface = InterfaceType::Confirm;
|
||||
State.SubmitCommand = [&]
|
||||
{
|
||||
auto [nproc, nthr, ncpu] = QueueConfig.Queues.at(State.QueueEntries[State.QueueSelected]);
|
||||
auto [nproc, nthr, ncpu] = QueueConfig.at(State.QueueEntries[State.QueueSelected]);
|
||||
auto args = std::vector<std::string>
|
||||
{
|
||||
"bsub",
|
||||
|
||||
@@ -147,6 +147,7 @@ inputs: rec
|
||||
missgram = inputs.pkgs.callPackage ./missgram { inherit biu sqlgen; stdenv = inputs.pkgs.clang18Stdenv; };
|
||||
sqlgen = inputs.pkgs.callPackage ./sqlgen.nix { src = inputs.topInputs.sqlgen; inherit reflectcpp; };
|
||||
reflectcpp = inputs.pkgs.callPackage ./reflectcpp.nix { src = inputs.topInputs.reflectcpp; };
|
||||
lsf = inputs.pkgs.callPackage ./lsf.nix { src = inputs.topInputs.self.src.lsf; };
|
||||
|
||||
fromYaml = content: builtins.fromJSON (builtins.readFile
|
||||
(inputs.pkgs.runCommand "toJSON" {}
|
||||
|
||||
18
packages/lsf.nix
Normal file
18
packages/lsf.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ stdenv, src, autoPatchelfHook, libz }: stdenv.mkDerivation rec
|
||||
{
|
||||
name = "lsf";
|
||||
inherit src;
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
buildInputs = [ stdenv.cc.cc libz ];
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
autoPatchelfIgnoreMissingDeps = [ "libnvidia-ml.so.1" ];
|
||||
installPhase =
|
||||
''
|
||||
runHook preInstall
|
||||
mkdir -p $out
|
||||
cp -r * $out
|
||||
rm $out/lib/{hwloc_nvml,sec_ego_kerberos,sec_ego_gsskrb,sec_ego_pam_default}.so
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
@@ -1,44 +1,46 @@
|
||||
{ stdenv, src, writeShellScriptBin, lib, rsync, which, wannier90, hdf5, mpi, mkl }:
|
||||
let vasp = stdenv.mkDerivation
|
||||
{
|
||||
name = "vasp-intel";
|
||||
src = src.vasp;
|
||||
patches = [ ../vtst.patch ];
|
||||
configurePhase =
|
||||
let
|
||||
vasp = stdenv.mkDerivation
|
||||
{
|
||||
name = "vasp-intel";
|
||||
src = src.vasp;
|
||||
patches = [ ../vtst.patch ];
|
||||
configurePhase =
|
||||
''
|
||||
cp ${./makefile.include} makefile.include
|
||||
chmod +w makefile.include
|
||||
cp ${../constr_cell_relax.F} src/constr_cell_relax.F
|
||||
cp -r ${src.vtst.patch}/vtstcode6.4.3/* src
|
||||
chmod -R +w src
|
||||
'';
|
||||
buildInputs = [ hdf5 wannier90 mkl ];
|
||||
nativeBuildInputs = [ rsync which mpi ];
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
for i in std gam ncl; do cp bin/vasp_$i $out/bin/vasp-$i; done
|
||||
'';
|
||||
# NIX_DEBUG = "7";
|
||||
enableParallelBuilding = true;
|
||||
env = { DEPS = "1"; MKLROOT = mkl; OMPI_F90 = "ifx"; };
|
||||
};
|
||||
wrapper = writeShellScriptBin "vasp-intel"
|
||||
''
|
||||
cp ${./makefile.include} makefile.include
|
||||
chmod +w makefile.include
|
||||
cp ${../constr_cell_relax.F} src/constr_cell_relax.F
|
||||
cp -r ${src.vtst.patch}/vtstcode6.4.3/* src
|
||||
chmod -R +w src
|
||||
'';
|
||||
buildInputs = [ hdf5 wannier90 mkl ];
|
||||
nativeBuildInputs = [ rsync which mpi ];
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
for i in std gam ncl; do cp bin/vasp_$i $out/bin/vasp-$i; done
|
||||
'';
|
||||
# NIX_DEBUG = "7";
|
||||
enableParallelBuilding = true;
|
||||
env = { DEPS = "1"; MKLROOT = mkl; OMPI_F90 = "ifx"; };
|
||||
};
|
||||
in writeShellScriptBin "vasp-intel"
|
||||
''
|
||||
export PATH=${vasp}/bin:${mpi}/bin''${PATH:+:$PATH}
|
||||
export PATH=${vasp}/bin:${mpi}/bin''${PATH:+:$PATH}
|
||||
|
||||
# set OMP_NUM_THREADS if SLURM_CPUS_PER_TASK is set
|
||||
if [ -z "$OMP_NUM_THREADS" ] && [ -n "$SLURM_CPUS_PER_TASK" ]; then
|
||||
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
|
||||
fi
|
||||
# set OMP_NUM_THREADS to 1 if not set
|
||||
if [ -z "$OMP_NUM_THREADS" ]; then
|
||||
export OMP_NUM_THREADS=1
|
||||
fi
|
||||
# set OMP_STACKSIZE to 512M if not set
|
||||
if [ -z "$OMP_STACKSIZE" ]; then
|
||||
export OMP_STACKSIZE=512m
|
||||
fi
|
||||
# set OMP_NUM_THREADS if SLURM_CPUS_PER_TASK is set
|
||||
if [ -z "$OMP_NUM_THREADS" ] && [ -n "$SLURM_CPUS_PER_TASK" ]; then
|
||||
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
|
||||
fi
|
||||
# set OMP_NUM_THREADS to 1 if not set
|
||||
if [ -z "$OMP_NUM_THREADS" ]; then
|
||||
export OMP_NUM_THREADS=1
|
||||
fi
|
||||
# set OMP_STACKSIZE to 512M if not set
|
||||
if [ -z "$OMP_STACKSIZE" ]; then
|
||||
export OMP_STACKSIZE=512m
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
''
|
||||
exec "$@"
|
||||
'';
|
||||
in wrapper // { passthru = wrapper.passthru // { inherit mpi; }; }
|
||||
|
||||
Reference in New Issue
Block a user