|
|
This page concerns the master students of UCLouvain who were granted an access to the local clusters.
|
|
|
|
|
|
# Launch a simulation on a cluster with Linux
|
|
|
|
|
|
## Access to the MEMA cluster
|
|
|
|
|
|
In order to use these clusters, you need to get an account from Jonathan Lambrechts (jonathan.lambrechts@uclouvain.be).
|
|
|
|
|
|
Create a file config in your .ssh folder
|
|
|
|
|
|
```bash
|
|
|
vim .ssh/config
|
|
|
```
|
|
|
|
|
|
If you are not familiar with vim, you can find the basic commands here:
|
|
|
|
|
|
[coderwall.com](https://coderwall.com/p/adv71w/basic-vim-commands-for-getting-started)
|
|
|
|
|
|
Add an entry to braque in your config file
|
|
|
|
|
|
```bash
|
|
|
Host braque
|
|
|
Hostname braque.mema.ucl.ac.be
|
|
|
User YourUserName
|
|
|
ForwardAgent yes
|
|
|
```
|
|
|
|
|
|
Add an entry to a cluster (ex: debcalc) in your config file
|
|
|
|
|
|
```bash
|
|
|
Host debcalcProxy
|
|
|
Hostname debcalc.mema.ucl.ac.be
|
|
|
ProxyCommand ssh -q braque nc %h %p $*
|
|
|
User YourUserName
|
|
|
```
|
|
|
|
|
|
## Connect to the cluster
|
|
|
|
|
|
In a terminal write
|
|
|
|
|
|
```bash
|
|
|
ssh debcalc
|
|
|
```
|
|
|
where debcalc is the Host you write in your .ssh/config file
|
|
|
|
|
|
## Install SLIM
|
|
|
|
|
|
Go in your home folder
|
|
|
|
|
|
```bash
|
|
|
cd ~
|
|
|
```
|
|
|
|
|
|
Clone the git repository
|
|
|
|
|
|
```bash
|
|
|
git clone https://git.immc.ucl.ac.be/slim/slim.git
|
|
|
```
|
|
|
|
|
|
If the previous line does not work, download an archive of the code on the home page, copy it to the cluster and extract it there.
|
|
|
|
|
|
Add those line in the ```~/.bashrc``` file before the aliases definition (you can use ```vim ```to modify it)
|
|
|
|
|
|
```bash
|
|
|
export PATH=$HOME/slim/build:$PATH
|
|
|
```
|
|
|
|
|
|
Resource your ```bashrc``` file
|
|
|
|
|
|
``` bash
|
|
|
source ~/.bashrc
|
|
|
```
|
|
|
|
|
|
Create a build folder in the slim folder
|
|
|
|
|
|
```bash
|
|
|
cd slim
|
|
|
mkdir build
|
|
|
```
|
|
|
|
|
|
Go in the build folder
|
|
|
|
|
|
```bash
|
|
|
cd build
|
|
|
```
|
|
|
|
|
|
Create the cmake file
|
|
|
```bash
|
|
|
cmake ..
|
|
|
```
|
|
|
|
|
|
Compile the code
|
|
|
|
|
|
```bash
|
|
|
make -j8
|
|
|
```
|
|
|
|
|
|
## Submit a job
|
|
|
|
|
|
Before submitting a job, check that there is enough available processor to process your simulation. If not, wait for the current user to free them. In order to check the availability of the processors, use the command
|
|
|
|
|
|
```bash
|
|
|
htop
|
|
|
```
|
|
|
|
|
|
To launch the simulation, write
|
|
|
|
|
|
```bash
|
|
|
mpirun -np NbProc slim run.py
|
|
|
```
|
|
|
|
|
|
where NbProc is the number of processors. If you want to write the log of the simulation in a file, use
|
|
|
|
|
|
```bash
|
|
|
mpirun -np NbProc slim run.py>log
|
|
|
```
|
|
|
|
|
|
For an ongoing simulation, you can read the log with
|
|
|
|
|
|
```bash
|
|
|
tail -f log
|
|
|
```
|
|
|
|
|
|
If you want to be able to logout of the clusters without ending your simulation, you have to use a screen:
|
|
|
|
|
|
First, create a screen:
|
|
|
|
|
|
```bash
|
|
|
screen -S myScreen
|
|
|
```
|
|
|
|
|
|
Then, launch your simulation.
|
|
|
|
|
|
To logout of the screen, use ctrl+a then ctrl+d.
|
|
|
|
|
|
To connect to the screen (when you are logged on the cluster):
|
|
|
|
|
|
```bash
|
|
|
screen -r myScreen
|
|
|
```
|
|
|
|
|
|
To logout of the cluster, write
|
|
|
|
|
|
```bash
|
|
|
logout
|
|
|
``` |