Skip to content
Snippets Groups Projects
Verified Commit 64c19916 authored by Jakub Kropáček's avatar Jakub Kropáček Committed by Jakub Kropáček
Browse files

update submission examples

parent 90d37fc0
No related branches found
No related tags found
No related merge requests found
Pipeline #28102 passed with warnings
......@@ -48,19 +48,21 @@ Then we create a jobscript:
```bash
#!/bin/bash
#PBS -A PROJECT_ID
#PBS -A OPEN-00-00
#PBS -q qprod
#PBS -l select=1:ncpus=24,walltime=02:00:00
#PBS -l select=1,walltime=02:00:00
# change to scratch directory
SCR=/scratch/work/user/$USER/$PBS_JOBID
mkdir -p $SCR ; cd $SCR || exit
SCRDIR=/scratch/project/${PBS_ACCOUNT,,}/${USER}/${PBS_JOBID}
mkdir -p $SCRDIR
cd $SCRDIR || exit
# get individual tasks from tasklist with index from PBS JOB ARRAY
TASK=$(sed -n "${PBS_ARRAY_INDEX}p" $PBS_O_WORKDIR/tasklist)
# copy input file and executable to scratch
cp $PBS_O_WORKDIR/$TASK input ; cp $PBS_O_WORKDIR/myprog.x .
cp $PBS_O_WORKDIR/$TASK input
cp $PBS_O_WORKDIR/myprog.x .
# execute the calculation
./myprog.x < input > output
......
No preview for this file type
......@@ -346,9 +346,12 @@ The recommended way to run production jobs is to change to the `/scratch` direct
```bash
#!/bin/bash
# change to scratch directory, exit on failure
SCRDIR=/scratch/$USER/myjob
cd $PBS_O_WORKDIR
SCRDIR=/scratch/project/open-00-00/${USER}/myjob
mkdir -p $SCRDIR
# change to scratch directory, exit on failure
cd $SCRDIR || exit
# copy input file to scratch
......@@ -389,10 +392,12 @@ Example jobscript for an MPI job with preloaded inputs and executables, options
#PBS -q qprod
#PBS -N MYJOB
#PBS -l select=100:mpiprocs=1:ompthreads=16
#PBS -A OPEN-0-0
#PBS -A OPEN-00-00
# job is run using project resources; here ${PBS_ACCOUNT,,} translates to "open-00-00"
SCRDIR=/scratch/project/${PBS_ACCOUNT,,}/${USER}/myjob
# change to scratch directory, exit on failure
SCRDIR=/scratch/$USER/myjob
cd $SCRDIR || exit
# load the MPI module
......@@ -407,7 +412,9 @@ mpirun ./mympiprog.x
exit
```
In this example, input and executable files are assumed to be preloaded manually in the `/scratch/$USER/myjob` directory. Note the `mpiprocs` and `ompthreads` qsub options controlling the behavior of the MPI execution. `mympiprog.x` is executed as one process per node, on all 100 allocated nodes. If `mympiprog.x` implements OpenMP threads, it will run 16 threads per node.
In this example, input and executable files are assumed to be preloaded manually in the `/scratch/project/open-00-00/$USER/myjob` directory. Because we used the `qprod` queue, we had to specify which project's resources we want to use, and our `PBS_ACCOUNT` variable will be set accordingly (OPEN-00-00). `${PBS_ACCOUNT,,}` uses one of the bash's built-in functions to translate it into lower case.
Note the `mpiprocs` and `ompthreads` qsub options controlling the behavior of the MPI execution. `mympiprog.x` is executed as one process per node, on all 100 allocated nodes. If `mympiprog.x` implements OpenMP threads, it will run 16 threads per node.
### Example Jobscript for Single Node Calculation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment