From 293ce350192b315d6f0454ba4ae5c135bc1feb8a Mon Sep 17 00:00:00 2001 From: Michael Blaschek <michael.blaschek@univie.ac.at> Date: Wed, 11 Nov 2020 09:55:30 +0100 Subject: [PATCH] Update README.md --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f56287b..0f78d20 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Of course that is a silly job. However, there are things to learn for this examp * `output`, this is just for you * `ntasks`, this tells slurm how many threads you should be allowed to have * `time`, this tells slurm how much time it should give your job + * other `#SBATCH` commands [https://slurm.schedmd.com/sbatch.html](https://slurm.schedmd.com/sbatch.html) 2. Submit the job with `sbatch` 3. Check the Queue and Status of your job with `squeue` @@ -78,9 +79,47 @@ module load miniconda3 # nice for testing /usr/bin/time -v python3 fibonacci.py ``` +Save the job as `fibonacci.job` and submit the job with `sbatch fibonacci.job`. Let's have a look at the output. - - +``` +Recursive version +165580141, Elapsed: 00h00m55s +Loop version +165580141, Elapsed: 00h00m00s +Memory version +165580141, Elapsed: 00h00m00s + Command being timed: "python3 fibonacci.py" + User time (seconds): 55.84 + System time (seconds): 0.00 + Percent of CPU this job got: 99% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:55.94 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 10900 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 1288 + Voluntary context switches: 9 + Involuntary context switches: 22 + Swaps: 0 + File system inputs: 0 + File system outputs: 0 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 +``` +You can find information on the CPU usage, memory, ... For this job the only relevant information is on the CPU, as it basically only uses that. +The time man page is [here](https://man7.org/linux/man-pages/man1/time.1.html). + +## Run a Multi-processing job + +**under construction.** +`icc -o fibonacci.x fibonacci_openmp.c` +ask for more tasks # Interactive Sessions @@ -112,23 +151,21 @@ How to submit an MPI batch job ```bash #!/bin/bash -# Some example sbatch options. -# See also https://slurm.schedmd.com/sbatch.html -#SBATCH --job-name=testprog -#SBATCH --output=testprog.out +#SBATCH --job-name=hello +#SBATCH --output=hello.log #SBATCH --ntasks=7 # Load the OpenMPI module. module load openmpi/4.0.5 -# Run the program with mpirun. Additional mpirun options -# are not required. mpirun will get the info (e.g., hosts) -# from SLURM. -srun ./testprog +# Run the program with mpi. Srun will execute mpirun with +# the info (e.g., hosts) from SLURM. +srun ./hello ``` + Submit with ```bash -sbatch mpiexample.sh +sbatch hello.job ``` # Useful things -- GitLab