Skip to content
Snippets Groups Projects
Commit abaee47f authored by Chao Zhan's avatar Chao Zhan
Browse files

init tutorial 8

parent bf9399d6
No related branches found
No related tags found
No related merge requests found
# ALP4 Tutorial-7
# ALP4 Tutorial-8
This branch contains all materials for the 7th tutorial session.
This branch contains all materials for the 8th tutorial session.
## Agenda
- Assignment's solution presentation (if any)
- Recap & Discussion: Parallelism, MPI
- Q&A
## MPI Environment Setup
First, make sure you have access to Andorra. Then log in Andorra via `ssh`.
Inside Andorra, you can try
```bash
ping compute <press Tab>
```
to show all the available computing nodes, which looks like this:
```bash
compute01 compute05 compute09
compute01.imp.fu-berlin.de compute05.imp.fu-berlin.de compute09.imp.fu-berlin.de
compute02 compute06 compute10
compute02.imp.fu-berlin.de compute06.imp.fu-berlin.de compute10.imp.fu-berlin.de
compute03 compute07 compute11
compute03.imp.fu-berlin.de compute07.imp.fu-berlin.de compute11.imp.fu-berlin.de
compute04 compute08 compute12
compute04.imp.fu-berlin.de compute08.imp.fu-berlin.de compute12.imp.fu-berlin.de
```
You can then refer these nodes later using their names, such as `compute01`, `compute02` to execute your MPI programs.
Now, log in one of these node within Andorra via `ssh`, for example `ssh compute01`. You might be required to input your password (from your ZEDAT account).
After that, you are in the computing environment in which you can compile and run your MPI Program.
You files on Andorra are synchronized among these nodes, so you can use them directly.
### Example
You can try to run the code examples provided by this repo.
First, clone this repo on Andorra:
```bash
# via SSH
git clone git@git.imp.fu-berlin.de:mactavish96/alp4-tutorials.git
# via HTTP
git clone https://git.imp.fu-berlin.de/mactavish96/alp4-tutorials.git
```
Then, log into one of these node, e.g. `ssh compute01`.
Then, find your the git repo you just cloned and `cd <path to the repo>/exercises/MPI_examples/hello_world`
And then, run `make` to compile the program.
At last, run `mpirun -H compute01,compute02,compute03,compute04 ./hello_world` to execute your MPI program.
You will see output like this:
```bash
compute01% mpirun -H compute01,compute02,compute03,compute04 ./hello_world
Hello world, processor: compute01, rank: 0, total num of processors: 4
Hello world, processor: compute03, rank: 2, total num of processors: 4
Hello world, processor: compute04, rank: 3, total num of processors: 4
Hello world, processor: compute02, rank: 1, total num of processors: 4
```
### More
For further information, please check the [http://www.mi.fu-berlin.de/w/IT/ComputeServer](http://www.mi.fu-berlin.de/w/IT/ComputeServer)
......@@ -6,8 +6,8 @@ title: Q&A
Any questions about:
- Fifth Assignment Sheet
- Sixth Assignment Sheet
- Seventh Assignment Sheet
- Topics from the lectures
- Organisation
......
......@@ -16,7 +16,7 @@ transition: fade-out
css: unocss
---
# ALP4 Tutorial 7
# ALP4 Tutorial 8
## Chao Zhan
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment