From 4452535a0b2ca79c2d00600c7fdb09f267a84f05 Mon Sep 17 00:00:00 2001
From: Xuan Gu <xuan.gu@liu.se>
Date: Thu, 28 Sep 2023 10:09:58 +0000
Subject: [PATCH] Update file run_benchmark_single_node.sh

---
 .../Segmentation/nnUNet/run_benchmark_single_node.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/PyTorch/Segmentation/nnUNet/run_benchmark_single_node.sh b/PyTorch/Segmentation/nnUNet/run_benchmark_single_node.sh
index 0291857..1834e9d 100644
--- a/PyTorch/Segmentation/nnUNet/run_benchmark_single_node.sh
+++ b/PyTorch/Segmentation/nnUNet/run_benchmark_single_node.sh
@@ -3,8 +3,10 @@
 MODULE_NAME=nnunet_for_pytorch
 MODULE_VERSION=21.11.0
 WORK_DIR=/proj/nsc_testing/xuan/berzelius-benchmarks/PyTorch/Segmentation/nnUNet
+SBATCH_DIR=$WORK_DIR/benchmark_dim${1}_nodes${2}_gpus${3}_batchsize${4}_iteration${5}.sbatch
+LOG_DIR=benchmark_dim${1}_nodes${2}_gpus${3}_batchsize${4}_amp_iteration${5}.json
 
-cat <<EOT >  $WORK_DIR/benchmark_dim${1}_nodes${2}_gpus${3}_batchsize${4}_iteration${5}.sbatch
+cat <<EOT >  $SBATCH_DIR
 
 #!/bin/bash
 
@@ -23,13 +25,11 @@ CONTAINER_DIR=/proj/nsc_testing/xuan/containers/${MODULE_NAME}_${MODULE_VERSION}
 mkdir -p $WORK_DIR/sbatch_out 
 
 cd $WORK_DIR
-rm -f results/benchmark_dim${1}_nodes${2}_gpus${3}_batchsize${4}_tf32_iteration${5}.json
-srun apptainer exec --nv -B ${PWD}/data:/data -B ${PWD}/results:/results $CONTAINER_DIR bash -c "cd /workspace/nnunet_pyt && python scripts/benchmark.py --mode train --gpus ${3} --dim ${1} --batch_size ${4} --nodes ${2} --logname='benchmark_dim${1}_nodes${2}_gpus${3}_batchsize${4}_tf32_iteration${5}.json'"
 
-rm -f results/benchmark_dim${1}_nodes${2}_gpus${3}_batchsize${4}_amp_iteration${5}.json
-srun apptainer exec --nv -B ${PWD}/data:/data -B ${PWD}/results:/results $CONTAINER_DIR bash -c "cd /workspace/nnunet_pyt && python scripts/benchmark.py --mode train --gpus ${3} --dim ${1} --batch_size ${4} --nodes ${2} --amp --logname='benchmark_dim${1}_nodes${2}_gpus${3}_batchsize${4}_amp_iteration${5}.json'" 
+rm -f results/$LOG_DIR
+srun apptainer exec --nv -B ${PWD}/data:/data -B ${PWD}/results:/results $CONTAINER_DIR bash -c "cd /workspace/nnunet_pyt && python scripts/benchmark.py --mode train --gpus ${3} --dim ${1} --batch_size ${4} --nodes ${2} --amp --logname='$LOG_DIR'" 
 
 
 EOT
 
-sbatch scripts/benchmark_dim${1}_nodes${2}_gpus${3}_batchsize${4}_iteration${5}.sbatch
\ No newline at end of file
+sbatch $SBATCH_DIR
\ No newline at end of file
-- 
GitLab