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.

157 lines
2.9 KiB

5 years ago
= mpi !
Apostolos rootApostolos@swarmlab.io
// Metadata:
:description: Intro and Install
:keywords: mpi
:data-uri:
:toc: right
:toc-title: Πίνακας περιεχομένων
:toclevels: 4
:source-highlighter: highlight
:icons: font
:sectnums:
{empty} +
[[cheat-Docker]]
5 years ago
== Install mpi (Home PC)
5 years ago
- Install docker +
5 years ago
http://docs.swarmlab.io/Howtos/docker/install.adoc.html[^]
5 years ago
5 years ago
- Clone repo https://git.swarmlab.io:3000/swarmlab/swarmlab-mpi +
HowTo: See http://git.swarmlab.io/Howtos/git/use-git.adoc.html
5 years ago
5 years ago
.lab
[NOTE]
====
5 years ago
In Lab's everything is ready!
5 years ago
Goto "create"
====
5 years ago
[[cheat-swarmlab-mpi]]
5 years ago
== Usage (swarmlab-mpi)
5 years ago
- Open a console
- Create a directory
```
cd dir
swarmlab-mpi <tab><tab>
create create project (swarmlab-mpi create)
up start swarmlab-mpi (swarmlab-mpi up size=10)
scale resize swarmlab-mpi (swarmlab-mpi scale size=30)
reload rebuild image (swarmlab-mpi reload size=15)
login login swarmlab-mpi (swarmlab-mpi login)
exec execute command (swarmlab-mpi exec [SHELL COMMAND])
down stop swarmlab-mpi (swarmlab-mpi down)
clean clean project (swarmlab-mpi clean)
list show instances (swarmlab-mpi swarmlab-mpi list)
help show help (swarmlab-mpi help)
```
[NOTE]
====
Using the tab key to automatically complete unambiguous commands and paths in Bash
====
[[cheat-swarmlab-create]]
== Create swarmlab project
```
mkdir myproject
cd myproject
swarmlab-mpi create
```
.Relevant files:
5 years ago
```
5 years ago
Project
├── Dockerfile # Image specification
├── project # Sample program source code
│ └── mpi_hello_world.c
├── ssh # keys for accessing
│ ├── id_rsa # (could generate your own)
│ └── id_rsa.pub
├── docker-compose.yml # Container orchestration
5 years ago
```
5 years ago
[[cheat-swarmlab-up]]
== Spin up the swarmlab cluster
```
cd myproject
swarmlab-mpi up size=5
```
[[cheat-swarmlab-up1]]
== Login to the swarmlab cluster
```
cd myproject
swarmlab-mpi login
```
[[cheat-swarmlab-complile]]
== Compile and Run the sample program.
```
cd myproject
mpicc -o mpi_hello_world ./mpi_hello_world.c
mpirun ./mpi_hello_world
```
.New files
[NOTE]
====
copy or create files into the project directory. Compile and Run!
====
[[cheat-swarmlab-scale]]
== Scale cluster in real-time
As the cluster running, without having to close the session, open a different terminal and go back to the project directory.
```
cd myproject
swarmlab-mpi scale size=10
```
[[cheat-swarmlab-down]]
== shutdown swarmlab-mpi cluster
```
cd myproject
swarmlab-mpi down
```
:hardbreaks:
{empty} +
{empty} +
{empty}
:!hardbreaks:
'''
.Reminder
[NOTE]
====
:hardbreaks:
Caminante, no hay camino,
se hace camino al andar.
Wanderer, there is no path,
the path is made by walking.
*Antonio Machado* Campos de Castilla
====