mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 03:18:45 +08:00
services.slurm: support tui
This commit is contained in:
parent
b5a4aee761
commit
50da5ffa0b
@ -127,7 +127,13 @@ inputs:
|
|||||||
wireguardIp = "192.168.83.3";
|
wireguardIp = "192.168.83.3";
|
||||||
};
|
};
|
||||||
gamemode = { enable = true; drmDevice = 0; };
|
gamemode = { enable = true; drmDevice = 0; };
|
||||||
slurm = { enable = true; cpu = { cores = 16; threads = 2; }; memoryMB = 90112; gpus."4060" = 1; };
|
slurm =
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
cpu = { cores = 16; threads = 2; mpiThreads = 2; openmpThreads = 4; };
|
||||||
|
memoryMB = 90112;
|
||||||
|
gpus."4060" = 1;
|
||||||
|
};
|
||||||
xrdp = { enable = true; hostname = [ "pc.chn.moe" ]; };
|
xrdp = { enable = true; hostname = [ "pc.chn.moe" ]; };
|
||||||
};
|
};
|
||||||
bugs = [ "xmunet" "backlight" "amdpstate" "hibernate-mt7921e" "suspend-hibernate-no-platform" ];
|
bugs = [ "xmunet" "backlight" "amdpstate" "hibernate-mt7921e" "suspend-hibernate-no-platform" ];
|
||||||
|
@ -76,7 +76,7 @@ inputs:
|
|||||||
slurm =
|
slurm =
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
cpu = { cores = 16; threads = 2; };
|
cpu = { cores = 16; threads = 2; mpiThreads = 3; openmpThreads = 4; };
|
||||||
memoryMB = 94208;
|
memoryMB = 94208;
|
||||||
gpus = { "2080_ti" = 1; "3090" = 1; "4090" = 1; };
|
gpus = { "2080_ti" = 1; "3090" = 1; "4090" = 1; };
|
||||||
};
|
};
|
||||||
|
@ -66,7 +66,7 @@ inputs:
|
|||||||
slurm =
|
slurm =
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
cpu = { sockets = 2; cores = 22; threads = 2; };
|
cpu = { sockets = 2; cores = 22; threads = 2; mpiThreads = 4; openmpThreads = 10; };
|
||||||
memoryMB = 253952;
|
memoryMB = 253952;
|
||||||
gpus = { "4090" = 1; "p5000" = 1; };
|
gpus = { "4090" = 1; "p5000" = 1; };
|
||||||
};
|
};
|
||||||
|
@ -8,6 +8,8 @@ inputs:
|
|||||||
sockets = mkOption { type = types.ints.unsigned; default = 1; };
|
sockets = mkOption { type = types.ints.unsigned; default = 1; };
|
||||||
cores = mkOption { type = types.ints.unsigned; };
|
cores = mkOption { type = types.ints.unsigned; };
|
||||||
threads = mkOption { type = types.ints.unsigned; default = 1; };
|
threads = mkOption { type = types.ints.unsigned; default = 1; };
|
||||||
|
mpiThreads = mkOption { type = types.ints.unsigned; default = 1; };
|
||||||
|
openmpThreads = mkOption { type = types.ints.unsigned; default = 1; };
|
||||||
};
|
};
|
||||||
memoryMB = mkOption { type = types.ints.unsigned; };
|
memoryMB = mkOption { type = types.ints.unsigned; };
|
||||||
gpus = mkOption { type = types.attrsOf types.ints.unsigned; };
|
gpus = mkOption { type = types.attrsOf types.ints.unsigned; };
|
||||||
@ -112,6 +114,30 @@ inputs:
|
|||||||
"slurm/db" = { owner = "slurm"; key = "mariadb/slurm"; };
|
"slurm/db" = { owner = "slurm"; key = "mariadb/slurm"; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixos.services.mariadb = { enable = true; instances.slurm = {}; };
|
nixos =
|
||||||
|
{
|
||||||
|
packages._packages = [(inputs.pkgs.localPackages.sbatch-tui.overrideAttrs (prev: { src =
|
||||||
|
let device = inputs.pkgs.substituteAll
|
||||||
|
{
|
||||||
|
src = "${prev.src}/src/device.cpp.template";
|
||||||
|
CpuMpiThreads = slurm.cpu.mpiThreads;
|
||||||
|
CpuOpenmpThreads = slurm.cpu.openmpThreads;
|
||||||
|
GpuIds = builtins.concatStringsSep ", " (builtins.map (gpu: ''"${gpu}"'') (builtins.attrNames slurm.gpus));
|
||||||
|
};
|
||||||
|
in inputs.pkgs.runCommand "src" {}
|
||||||
|
''cp -r ${prev.src} $out; chmod +w -R $out; cp ${device} $out/src/device.cpp''; }))];
|
||||||
|
user.sharedModules = [{ home.packages =
|
||||||
|
[
|
||||||
|
(inputs.pkgs.writeShellScriptBin "sbatch"
|
||||||
|
''
|
||||||
|
if [ "$#" -eq 0 ]; then
|
||||||
|
sbatch-tui
|
||||||
|
else
|
||||||
|
/run/current-system/sw/bin/sbatch "$@"
|
||||||
|
fi
|
||||||
|
'')
|
||||||
|
];}];
|
||||||
|
services.mariadb = { enable = true; instances.slurm = {}; };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user