mirror of
https://github.com/c-sooyoung/bo-ptycho.git
synced 2026-09-17 19:29:07 +09:00
some conveniences
This commit is contained in:
@@ -2,12 +2,11 @@
|
|||||||
#SBATCH --job-name=Si2V
|
#SBATCH --job-name=Si2V
|
||||||
#SBATCH --nodes=1
|
#SBATCH --nodes=1
|
||||||
#SBATCH --ntasks=1
|
#SBATCH --ntasks=1
|
||||||
#SBATCH --cpus-per-task=1
|
#SBATCH --cpus-per-task=16
|
||||||
#SBATCH --gres=gpu:rtx-6000ada:4
|
#SBATCH --gres=gpu:rtx-6000ada:4
|
||||||
#SBATCH --time=100:00:00
|
#SBATCH --time=100:00:00
|
||||||
#SBATCH --output=/home/swim/slurm-logs/job_%j.log
|
#SBATCH --output=/home/swim/slurm-logs/job_%j.log
|
||||||
|
|
||||||
echo "2V"
|
|
||||||
pwd
|
pwd
|
||||||
hostname
|
hostname
|
||||||
date
|
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
|
source /home/swim/bo-ptycho/venv/bin/activate
|
||||||
|
|
||||||
cat config.yaml
|
YAML="config.yaml"
|
||||||
python -u main.py config.yaml
|
|
||||||
|
cat $YAML
|
||||||
|
python -u main.py $YAML
|
||||||
|
|
||||||
date
|
date
|
||||||
echo "SLURM JOB FINISHED"
|
echo "SLURM JOB FINISHED"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
import shutil
|
||||||
|
|
||||||
import pipelines
|
import pipelines
|
||||||
|
|
||||||
@@ -8,6 +9,12 @@ def main(config_yaml):
|
|||||||
with open(config_yaml, 'r') as f:
|
with open(config_yaml, 'r') as f:
|
||||||
config = yaml.safe_load(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)
|
pipelines.job_types[config['job']['type']](config)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user