Download code/slurm/lane_cpu.sh from bryan7264/lorapop: direct link, hf CLI and curl.
- Browser
- Download file 848 Bytes
-
https://huggingface.co/datasets/bryan7264/lorapop/resolve/main/code/slurm/lane_cpu.sh
- Command line
-
hf download hf://datasets/bryan7264/lorapop/code/slurm/lane_cpu.sh
-
curl -L -o lane_cpu.sh https://huggingface.co/datasets/bryan7264/lorapop/resolve/main/code/slurm/lane_cpu.sh
848 Bytes
| # MIT License, Bryan Cheng, 2026. Devel-CPU lane runner (D-029): keeps up to 2 jobs of this user in the devel partition by | |
| # submitting the first non-comment line of slurm/cpu_queue.txt (a complete sbatch command); logs to slurm/cpu_queue.done. | |
| cd /home/bjc75/other/finetuning | |
| Q=slurm/cpu_queue.txt | |
| while true; do | |
| if [ "$(squeue -u bjc75 -h -p devel -o %i | wc -l)" -lt 2 ]; then | |
| line=$(grep -v '^[[:space:]]*#' $Q | grep -m1 .) | |
| if [ -z "$line" ]; then echo "$(date) queue empty"; exit 0; fi | |
| out=$(bash -c "$line" 2>&1 | tail -1) | |
| echo "$(date) | $line | $out" >> slurm/cpu_queue.done | |
| if echo "$out" | grep -q "Submitted batch job"; then | |
| grep -vxF -- "$line" $Q > $Q.tmp; mv $Q.tmp $Q; echo "$(date) submitted: $out" | |
| else | |
| echo "$(date) FAILED: $line -> $out"; sleep 600 | |
| fi | |
| fi | |
| sleep 120 | |
| done | |