Compare commits

...

7 Commits

9 changed files with 83 additions and 49 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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.";
};
}

View File

@@ -1,4 +1,2 @@
Queues:
normal: [ 4, 4, 20 ]
normal_1day: [ 4, 7, 28 ]

View File

@@ -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; };
}

View File

@@ -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",

View File

@@ -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
View 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
'';
}

View File

@@ -1,5 +1,6 @@
{ stdenv, src, writeShellScriptBin, lib, rsync, which, wannier90, hdf5, mpi, mkl }:
let vasp = stdenv.mkDerivation
let
vasp = stdenv.mkDerivation
{
name = "vasp-intel";
src = src.vasp;
@@ -23,7 +24,7 @@ let vasp = stdenv.mkDerivation
enableParallelBuilding = true;
env = { DEPS = "1"; MKLROOT = mkl; OMPI_F90 = "ifx"; };
};
in writeShellScriptBin "vasp-intel"
wrapper = writeShellScriptBin "vasp-intel"
''
export PATH=${vasp}/bin:${mpi}/bin''${PATH:+:$PATH}
@@ -41,4 +42,5 @@ in writeShellScriptBin "vasp-intel"
fi
exec "$@"
''
'';
in wrapper // { passthru = wrapper.passthru // { inherit mpi; }; }