This commit is contained in:
2026-03-30 16:25:35 +02:00
parent 01b96ef523
commit 4ad11eb64d
2 changed files with 21 additions and 10 deletions

View File

@@ -9,26 +9,26 @@ draft: false
--- ---
1. On all computers 1. On all computers
``` ```bash
sudo apt install openssh-client sudo apt install openssh-client
sudo apt install openssh-server sudo apt install openssh-server
sudo apt install openmpi-bin libopenmpi-dev sudo apt install openmpi-bin libopenmpi-dev
``` ```
2. Disable firewall 2. Disable firewall
``` ```bash
sudo ufw status sudo ufw status
sudo ufw disable sudo ufw disable
``` ```
3. Try connecting master to every slave ( you will need password ) 3. Try connecting master to every slave ( you will need password )
``` ```bash
ssh user@ipslave1 ssh user@ipslave1
ssh user@ipslave2 ssh user@ipslave2
``` ```
4. On master generate a key and put it on the slaves 4. On master generate a key and put it on the slaves
``` ```bash
ssh-keygen -t rsa ssh-keygen -t rsa
ssh-copy-id user@ipslave1 ssh-copy-id user@ipslave1
@@ -36,25 +36,25 @@ ssh-copy-id user@ipslave2
``` ```
5. Try connecting master to every slave ( you will not need password ) 5. Try connecting master to every slave ( you will not need password )
``` ```bash
ssh user@ipslave1 ssh user@ipslave1
ssh user@ipslave2 ssh user@ipslave2
``` ```
6. Compile program 6. Compile program
``` ```bash
mpicc main.c -o main mpicc main.c -o main
mpic++ main.cpp -o main mpic++ main.cpp -o main
``` ```
7. Copy main in to /tmp folder for easy same location ( program needs to be in the same path on all computers ) 7. Copy main in to /tmp folder for easy same location ( program needs to be in the same path on all computers )
``` ```bash
cp /path/to/main /tmp/mympiprogram/ cp /path/to/main /tmp/mympiprogram/
``` ```
8. Copy program to all computers 8. Copy program to all computers
- Could use NFS server for auto copy - Could use NFS server for auto copy
``` ```bash
scp <source> <destination> scp <source> <destination>
scp /tmp/mympiprogram/main user@ipslave1:/tmp/mympiprogram/main scp /tmp/mympiprogram/main user@ipslave1:/tmp/mympiprogram/main
scp /tmp/mympiprogram/main user@ipslave2:/tmp/mympiprogram/main scp /tmp/mympiprogram/main user@ipslave2:/tmp/mympiprogram/main
@@ -65,12 +65,12 @@ scp /tmp/mympiprogram/main user@ipslave2:/tmp/mympiprogram/main
- `num < c1 + c2 + c3` - `num < c1 + c2 + c3`
- c1 is number of processes that can run on the computer - c1 is number of processes that can run on the computer
- num is number of processes that are needed for the program - num is number of processes that are needed for the program
``` ```bash
mpirun -np <num> --host 127.0.0.1:<c1>,ipslave1:<c2>,ipslave2<c3> /tmp/mympiprogram/main mpirun -np <num> --host 127.0.0.1:<c1>,ipslave1:<c2>,ipslave2<c3> /tmp/mympiprogram/main
``` ```
10. Enable firewall 10. Enable firewall
``` ```bash
sudo ufw status sudo ufw status
sudo ufw enable sudo ufw enable
``` ```

View File

@@ -0,0 +1,11 @@
<section class="container page">
<article>
<header>
<h1 class="title">
{{ .Title }}
</h1>
</header>
{{ .Content }}
</article>
</section>