some conveniences

This commit is contained in:
2026-08-14 19:29:34 +09:00
parent 785760d23d
commit 79be9e3ed3
2 changed files with 12 additions and 4 deletions
+5 -4
View File
@@ -2,12 +2,11 @@
#SBATCH --job-name=Si2V
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --cpus-per-task=16
#SBATCH --gres=gpu:rtx-6000ada:4
#SBATCH --time=100:00:00
#SBATCH --output=/home/swim/slurm-logs/job_%j.log
echo "2V"
pwd
hostname
date
@@ -18,8 +17,10 @@ export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH
source /home/swim/bo-ptycho/venv/bin/activate
cat config.yaml
python -u main.py config.yaml
YAML="config.yaml"
cat $YAML
python -u main.py $YAML
date
echo "SLURM JOB FINISHED"
+7
View File
@@ -1,6 +1,7 @@
import os
import sys
import yaml
import shutil
import pipelines
@@ -8,6 +9,12 @@ def main(config_yaml):
with open(config_yaml, 'r') as f:
config = yaml.safe_load(f)
result_dir = config["io"]["result_dir"]
if os.path.exists(result_dir):
shutil.rmtree(result_dir)
os.makedirs(result_dir, exist_ok=True)
shutil.copy(config_yaml, os.path.join(result_dir, os.path.basename(config_yaml)))
pipelines.job_types[config['job']['type']](config)