You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
1.9 KiB

4 years ago
# mpi !
4 years ago
4 years ago
Instances of Ubuntu Linux with [MPICH](https://www.mpich.org) -- portable implementation of Message Passing Interface (MPI) standard. Designed for MPI program development and deployment.
## LabInstance mpi2
![alt text](images/swarmlab-network.png "")
4 years ago
> ### NOTE
>
> Vlabs are reset every night around 02:00!
>
>> If you would like to keep your work please refer to "publish".
>
> Vlabs dont have firewall restrictions BUT the machines are not exposed to the internet.
>
> You share all machines so please be cooperative and discrete.
>
4 years ago
## Quickstart
This is a quickstart guide of howto use this *LabInstance to deploy MPI programs*
### HowTo use it
4 years ago
- cd /home/ubuntu
4 years ago
4 years ago
> git clone https://git.swarmlab.io:3000/labs/examples-mpi2.git
4 years ago
4 years ago
- cd examples-mpi2/examples
> make all
4 years ago
### Default Configuration
- Working Directory
4 years ago
> /home/ubuntu
4 years ago
4 years ago
- Default user
4 years ago
> ubuntu
4 years ago
#### Find lab workers
4 years ago
4 years ago
The host file that contains addresses of connected workers can be created with:
4 years ago
4 years ago
>
> swarmlab-getworkers > /home/ubuntu/invhosts
>
4 years ago
4 years ago
#### connect to workers
```bash
ssh ubuntu@[IP]
Info: user has sudo privileges without a password
```
4 years ago
4 years ago
#### Compile
4 years ago
4 years ago
> mpicc -o /home/ubuntu/mpi_hello_world examples/mpi_hello_world.c
4 years ago
4 years ago
#### run the MPI hello world program
4 years ago
4 years ago
> mpirun -n 10 -f /home/ubuntu/hosts /home/ubuntu/mpi_hello_world
4 years ago
---
**NOTE:** copy hello world to all clients
```bash
# scp hello wrold to all clients. sudo -u mpi for auto scp connect. see /home/mpi/.ssh
while read -r line;
do
4 years ago
scp /home/ubuntu/mpi_hello_world ubuntu@$line:/home/ubuntu/mpi_hello_world
4 years ago
done < /home/ubuntu/hosts
4 years ago
```
---
4 years ago
#### Publish Your Work
```bash
mkdir /home/ubuntu/directory
put your files and other directories into /home/ubuntu/directory
swarmlab-publish /home/ubuntu/directory
open URL in Browser
```
4 years ago
---
**MORE INFO**
4 years ago
See examples directory
4 years ago
```bash
cd examples
make mpi_hello_world
make example ex=squares
...
```
4 years ago
---