From c5cd96ab2551d4f5be018510623d87ad920db5c6 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Thu, 28 Sep 2023 08:42:27 +0200 Subject: [PATCH] remove docs on SCOOP, since vsc-mympirun-scoop is no longer installed on HPC-UGent systems --- config/templates/hpc.template | 1 - mkdocs/docs/HPC/examples/SCOOP/picalc.py | 44 ------- .../HPC/examples/SCOOP/picalc_job_script.pbs | 13 -- .../HPC/examples/SCOOP/squares_jobscript.pbs | 14 -- mkdocs/docs/HPC/multi_core_jobs.md | 11 -- mkdocs/docs/HPC/scoop.md | 121 ------------------ 6 files changed, 204 deletions(-) delete mode 100644 mkdocs/docs/HPC/examples/SCOOP/picalc.py delete mode 100644 mkdocs/docs/HPC/examples/SCOOP/picalc_job_script.pbs delete mode 100644 mkdocs/docs/HPC/examples/SCOOP/squares_jobscript.pbs delete mode 100644 mkdocs/docs/HPC/scoop.md diff --git a/config/templates/hpc.template b/config/templates/hpc.template index 1cdf5bfac37..75923f4b516 100644 --- a/config/templates/hpc.template +++ b/config/templates/hpc.template @@ -51,7 +51,6 @@ nav: - MATLAB: MATLAB.md - mympirun: mympirun.md - OpenFOAM: openFOAM.md - - SCOOP: scoop.md - FAQ: - Frequently Asked Questions: FAQ.md - Appendices: diff --git a/mkdocs/docs/HPC/examples/SCOOP/picalc.py b/mkdocs/docs/HPC/examples/SCOOP/picalc.py deleted file mode 100644 index 5d4553b56f2..00000000000 --- a/mkdocs/docs/HPC/examples/SCOOP/picalc.py +++ /dev/null @@ -1,44 +0,0 @@ -from math import hypot -from random import random -from scoop import futures - -NAME = 'SCOOP_piCalc' - -# A range is used in this function for python3. If you are using python2, -# an xrange might be more efficient. -try: - range_fn = xrange -except: - range_fn = range - - -def test(tries): - return sum(hypot(random(), random()) < 1 for i in range_fn(tries)) - -# Calculates pi with a Monte-Carlo method. This function calls the function -# test "n" times with an argument of "t". Scoop dispatches these -# functions interactively accross the available resources. -def calcPi(workers, tries): - expr = futures.map(test, [tries] * workers) - piValue = 4. * sum(expr) / float(workers * tries) - return piValue - - -if __name__ == '__main__': - import sys - nr_batches = 3000 - batch_size = 5000 - - # Program name and two arguments - if len(sys.argv) == 3: - try: - nr_batches = int(sys.argv[1]) - batch_size = int(sys.argv[2]) - except ValueError as ex: - sys.stderr.write("ERROR: Two integers expected as arguments: %s\n" % ex) - sys.exit(1) - elif len(sys.argv) != 1: - sys.stderr.write("ERROR: Expects either zero or two integers as arguments.\n") - sys.exit(1) - - print("PI=%f (in nr_batches=%d,batch_size=%d)" % (calcPi(nr_batches, batch_size), nr_batches, batch_size)) diff --git a/mkdocs/docs/HPC/examples/SCOOP/picalc_job_script.pbs b/mkdocs/docs/HPC/examples/SCOOP/picalc_job_script.pbs deleted file mode 100644 index ce3272d7110..00000000000 --- a/mkdocs/docs/HPC/examples/SCOOP/picalc_job_script.pbs +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -#PBS -l nodes=2:ppn=16 - -module load vsc-mympirun-scoop - -# change to directory where job was submitted from -cd $PBS_O_WORKDIR - -# assume picalc.py is in current directory -export PYTHONPATH=.:$PYTHONPATH - -# run 10k batches/workers with a batch size of 5000 -myscoop --scoop-module=picalc 10000 5000 diff --git a/mkdocs/docs/HPC/examples/SCOOP/squares_jobscript.pbs b/mkdocs/docs/HPC/examples/SCOOP/squares_jobscript.pbs deleted file mode 100644 index 3a4021865ca..00000000000 --- a/mkdocs/docs/HPC/examples/SCOOP/squares_jobscript.pbs +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -#PBS -l nodes=2:ppn=8 - -module load vsc-mympirun-scoop - -# change to directory where job was submitted from -cd $PBS_O_WORKDIR - -# assume squares.py is in current directory -export PYTHONPATH=.:$PYTHONPATH - -# compute first 10k squares, in parallel on available cores -myscoop --scoop-module=squares 10000 diff --git a/mkdocs/docs/HPC/multi_core_jobs.md b/mkdocs/docs/HPC/multi_core_jobs.md index 24fa34e1a69..f5754f69d73 100644 --- a/mkdocs/docs/HPC/multi_core_jobs.md +++ b/mkdocs/docs/HPC/multi_core_jobs.md @@ -100,17 +100,6 @@ MPI. Mimics a global address space on distributed memory systems, by distributing arrays over many nodes and one sided communication. This library is used a lot for chemical structure calculation codes and was used in one of the first applications that broke the PetaFlop barrier. - - - scoop - - - Python - - - Applies to both shared and distributed memory system. Not extremely advanced, but may present a quick road to parallelisation of Python code. - - !!! tip diff --git a/mkdocs/docs/HPC/scoop.md b/mkdocs/docs/HPC/scoop.md deleted file mode 100644 index a0b50fa2865..00000000000 --- a/mkdocs/docs/HPC/scoop.md +++ /dev/null @@ -1,121 +0,0 @@ -# SCOOP - -SCOOP (Scalable COncurrent Operations in Python) is a distributed task -module allowing concurrent parallel programming on various environments, -from heterogeneous grids to supercomputers. It is an alternative to the -worker framework, see [Multi-job submission](../multi_job_submission/#multi-job-submission). - -It can used for projects that require lots of (small) tasks to be -executed. - -The `myscoop` script makes it very easy to use SCOOP, even in a -multi-node setup. - -## Loading the module - -Before using `myscoop`, you first need to load the `vsc-mympirun-scoop` -module. We don't specify a version here (this is an exception, for most -other modules you should, see [Using explicit version numbers](../running_batch_jobs/#using-explicit-version-numbers)) because newer versions might include -important bug fixes or performance improvements. - -
$ module load vsc-mympirun-scoop
-
- -## Write a worker script - -A Python worker script implements both the main program, and (typically) -the small task function that needs to be executed a large amount of -times. - -This is done using the functionality provided by the `scoop` Python -module, for example `futures.map` (see also -). - -First, the necessary imports need to be specified: - -```python -import sys -from scoop import futures -``` - -A Python function must be implemented for the core task, for example to -compute the square of a number: - -```python -def square(x): - return x*x -``` - -The main function then applies this simple function to a range of values -specified as an argument. Note that it should be guarded by a -conditional (`if __name__ == "=__main__"`) to make sure it is only -executed when executing the script (and not when importing from it): - -```python -f __name__ == "__main__": - - # obtain n from first command line argument - n = int(sys.argv[1]) - - # compute the square of the first n numbers, in parallel using SCOOP functionality - squares = futures.map(square, range(n)) # note: returns an iterator - - print("First %d squares: %s" % (n, list(squares))) -``` - -## Executing the program - -To execute the Python script implementing the task and main function in -a SCOOP environment, specify to the `python` command to use the `scoop` -module: - -
$ python -m scoop squares.py 10000
-
- -## Using myscoop - -To execute the SCOOP program in an multi-node environment, where workers -are spread across multiple physical systems, simply use `myscoop`: just -specify the name of the Python module in which the SCOOP program is -implemented, and specify further arguments on the command line. - -You will need to make sure that the path to where the Python module is -located is listed in `$PYTHONPATH`. - -This is an example of a complete job script executing the SCOOP program -in parallel in a multi-node job (i.e., 2 nodes with 8 cores each): - -
-- squares_jobscript.pbs --
-```bash -{% include "./examples/SCOOP/squares_jobscript.pbs" %} -``` - -Note that you don't need to specify how many workers need to be used; -the `myscoop` command figures this out by itself. This is because -`myscoop` is a wrapper around `mympirun` (see [Mympirun](../mympirun/#mympirun)). In this example, 16 -workers (one per available core) will be execute the 10000 tasks one by -one until all squares are computed. - -To run the same command on the local system (e.g., a login node for -testing), add the `--sched=local` option to `myscoop`. - -## Example: calculating π - -A more practical example of a worker script is one to compute π -using a Monte-Carlo method (see also -). - -The `test` function implements a tiny task that is be executed `tries` -number of times by each worker. Afterwards, the number of successful -tests is determined using the Python `sum` function, and an approximate -value of π is computed and returned by `calcPi` so the main function -can print it out. - -
-- picalc.py --
-```python -{% include "./examples/SCOOP/picalc.py" %} -``` -
-- picalc_job_script.pbs --
-```bash -{% include "./examples/SCOOP/picalc_job_script.pbs" %} -```