Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
habrok:advanced_job_management:many_file_jobs [2023/09/19 18:06] – [Putting it all together: example jobscript] camarocico | habrok:advanced_job_management:many_file_jobs [2023/10/02 12:20] (current) – Removed verbose option from extraction command aurel | ||
---|---|---|---|
Line 13: | Line 13: | ||
< | < | ||
mkdir $TMPDIR/ | mkdir $TMPDIR/ | ||
- | tar xvzf / | + | tar xzf / |
</ | </ | ||
Line 32: | Line 32: | ||
cd $TMPDIR | cd $TMPDIR | ||
- | python train.py | + | python train.py |
</ | </ | ||
Line 54: | Line 54: | ||
#SBATCH --job-name=rice_classifier | #SBATCH --job-name=rice_classifier | ||
#SBATCH --output=rice_classifier.out | #SBATCH --output=rice_classifier.out | ||
- | #SBATCH --time=00:20:00 | + | #SBATCH --time=00:10:00 |
#SBATCH --nodes=1 | #SBATCH --nodes=1 | ||
#SBATCH --ntasks=1 | #SBATCH --ntasks=1 | ||
Line 64: | Line 64: | ||
mkdir -p $TMPDIR/ | mkdir -p $TMPDIR/ | ||
- | # Extract tar file (which could be stored on /scratch to local disk | + | # Extract tar file (which could be stored on /scratch) to local disk |
- | tar xzvf / | + | tar xzf / |
cp / | cp / | ||
cd $TMPDIR | cd $TMPDIR | ||
Line 74: | Line 74: | ||
# Run the training | # Run the training | ||
- | python train.py | + | python train.py |
- | mkdir -p / | + | mkdir -p / |
- | tar czvf / | + | tar czvf / |
</ | </ | ||
Line 110: | Line 110: | ||
</ | </ | ||
- | This will create a folder '' | + | This will create a folder '' |
Because of the way the command '' | Because of the way the command '' | ||
< | < | ||
- | python | + | python |
wait | wait | ||
</ | </ | ||
Line 124: | Line 124: | ||
< | < | ||
- | #!/usr/bin/env bash | + | # |
- | + | #SBATCH --job-name=rice_classifier | |
- | #SBATCH --time=00:10:00 | + | #SBATCH --output=rice_classifier.out |
+ | #SBATCH --time=00:30:00 | ||
#SBATCH --nodes=1 | #SBATCH --nodes=1 | ||
#SBATCH --ntasks=1 | #SBATCH --ntasks=1 | ||
- | #SBATCH --cpus-per-task=1 | + | #SBATCH --cpus-per-task=16 |
- | #SBATCH --mem=2GB | + | #SBATCH --mem=4GB |
- | #SBATCH --partition=gpu | + | #SBATCH --partition=regular |
- | #SBATCH --gres=gpu: | + | |
#SBATCH --signal=B: | #SBATCH --signal=B: | ||
- | # Change directory to local directory | + | mkdir $TMPDIR/dataset |
- | cd $TMPDIR | + | |
# Extract tar file (which could be stored on /scratch) to local disk | # Extract tar file (which could be stored on /scratch) to local disk | ||
- | tar xvzf /scratch/$USER/path/to/compressed.tar.gz $TMPDIR | + | tar xzf /scratch/public/hb-courses/basic/inputfiles/ |
+ | cp / | ||
+ | cd $TMPDIR | ||
- | trap 'mkdir / | + | # Compress and save the results if the timelimit is close |
+ | trap ' | ||
# Load modules | # Load modules | ||
- | module load Python/3.10.8-GCCcore-12.2.0 | + | module load matplotlib/3.5.2-foss-2022a |
+ | module load TensorFlow/2.11.0-foss-2022a-CUDA-11.7.0 | ||
+ | |||
+ | # Create folders for final results | ||
+ | mkdir -p $TMPDIR/ | ||
# Run in the background and wait | # Run in the background and wait | ||
- | python | + | python |
wait | wait | ||
+ | |||
+ | mkdir -p / | ||
+ | tar czvf / | ||
</ | </ | ||