prepare scripts for university sc cluster

This commit is contained in:
Malte Tammena 2024-05-25 08:09:53 +02:00
parent 04ff305dbb
commit 27ed3caf0b
3 changed files with 42 additions and 3 deletions

View file

@ -168,10 +168,32 @@
}); });
}; };
packages = packages = let
validate = pkgs.writeShellApplication {
name = "validate";
runtimeInputs = [
aba2sat
aspforaba
pkgs.coreutils
pkgs.hyperfine
pkgs.jq
];
text = builtins.readFile ./scripts/validate.sh;
};
sc-batch = pkgs.writeShellApplication {
name = "sc-batch";
runtimeInputs = [
validate
];
text = builtins.readFile ./scripts/sc-batch.sh;
};
aspforaba = pkgs.callPackage ./nix/packages/aspforaba.nix {inherit (self'.packages) clingo;};
in
{ {
inherit validate aba2sat aspforaba sc-batch;
default = aba2sat; default = aba2sat;
aspforaba = pkgs.callPackage ./nix/packages/aspforaba.nix {inherit (self'.packages) clingo;};
clingo = pkgs.callPackage ./nix/packages/clingo.nix {}; clingo = pkgs.callPackage ./nix/packages/clingo.nix {};
} }
// lib.optionalAttrs (!pkgs.stdenv.isDarwin) { // lib.optionalAttrs (!pkgs.stdenv.isDarwin) {

14
scripts/sc-batch.sh Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Batch script to run on sc.uni-leipzig.de cluster, i used
# sbatch -a "1-$(cat acyclic.list | wc -l)" ./scripts/sc-batch.sh
FILE_LIST=acyclic.list
file="$(pwd)/$(awk "NR == $SLURM_ARRAY_TASK_ID" "$FILE_LIST")"
arg=$(cat "$file.asm")
OUTPUT_DIR="$(pwd)/output"
export OUTPUT_DIR
./validate --file "$file" --arg "$arg" --time --problem dc-co

View file

@ -1,5 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Validate the correctness and optionally measure times of aba2sat and aspforaba
# best used through the bundled nix version `nix run .#validate`
print_help_and_exit() { print_help_and_exit() {
if [ -n "$1" ]; then if [ -n "$1" ]; then
printf "%s\n\n" "$1" printf "%s\n\n" "$1"
@ -70,7 +73,7 @@ run_dc_co() {
POSITIONAL_ARGS=() POSITIONAL_ARGS=()
ASPFORABA=ASPforABA ASPFORABA=ASPforABA
ABA2SAT=result/bin/aba2sat ABA2SAT=aba2sat
ABA_FILE= ABA_FILE=
ABA_FILE_DIR= ABA_FILE_DIR=
ABA_FILE_EXT=aba ABA_FILE_EXT=aba