Skip to content

JLBS_mpi_4py_tutorial #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,90 @@
# CuTonala_2024_A
Parallel Programming Course

=== Dependencies ===

These programs depend on mpi4py (>= Version 3.1.5)

The mpi4py documentation and installation instructions
can be found at:

http://mpi4py.scipy.org/

=== How to run on a single (multi-core) host ===

Run it with

mpirun -np 4 ./some-program

where the number after "-np " is the number of parallel MPI
processes to be started.


=== How to run on multiple hosts ===

If you want to run the program distributed over multiple hosts,
you have to create a <hostfile> which looks like:

-- hostfile --
host1 slots=4
host2 slots=4
host3 slots=4
--------------

Where "slots=" specifies the number of parallel processes that should be
started on that host.

Run it with

mpirun --hostfile <hostfile> ./some-program


=== Run on a cluster with the Torque Job scheduling system ===

The Torque HPC documentation and installation instructions
can be found at:

Terascale Open-source Resource and QUEue manager (TORQUE) is a
job scheduler/resource manager that employs PBS.
Jobs can be run either interactively or as a submitted PVS
batch script that is run non-interactively and subsequently
controlled through TORQUE.

https://hpc-wiki.info/hpc/Torque
https://docs.adaptivecomputing.com/torque/3-0-5/1.1installation.php

There are two possibilities:

a) Run interactively:

Request an interactive session and allocate a number of processors/nodes for
your session:

$ qsub -I X -l nodes=4:ppn=4

Where "-I" means you want to work interactively, "-X" requests grapical
(X-Window) I/O -- (you can run arbitrary programs that open windows). The
option "-l " specifies the resources you want to allocate. "-l nodes=4:ppn=4"
requests four compute nodes with each having four processor cores
[ppn =^ ProcessorsPerNode]. So in total you allocate 16 CPU cores.
[The scheduler is free to run your job on two nodes having 8 CPU cores each]

Once your interactive session is ready, you run

$ mpirun ./your-program

mpirun automatically knowns how many parallel processes have to be started and
where they have to be started.

b) Submit as non-interactive batch-job:

Use

$ qsub -l nodes=4:ppn=4 ./your-jobfile.job

to submit jour job-file. Similar to the interactive case, "-l" again is used
to request resources from the scheduling system. The job file usually is a
simple shell script which specifies the commands to be run once your job
starts. In addition, the jobfile can contain "#PBS <something>" statements
which are used to specify additional options which could have been specified
in the "qsub" commandline. Please see "man qsub" for details.
Loading