Difference between revisions of "GPUs Basel 2018"

From Dynamo
Jump to navigation Jump to search
Line 24: Line 24:
  
 
* Open a local Linux terminal and navigate to the directory where you just created the tutorial dataset and project. Copy the project data (particles) to sciCORE:
 
* Open a local Linux terminal and navigate to the directory where you just created the tutorial dataset and project. Copy the project data (particles) to sciCORE:
  <tt>rsync -avuP myParticles USERNAME@login.bc2.unibas.ch:/scicore/home/PATH/dynamo_projects</tt>
+
  <tt>rsync -avuP myParticles USERNAME@login.scicore.unibas.ch:/scicore/home/s-gpu-course/USERNAME/dynamo_projects</tt>
  
 
* Copy the previously created tar file of the project to sciCORE:
 
* Copy the previously created tar file of the project to sciCORE:
  <tt>rsync -avuP myProject.tar USERNAME@login.bc2.unibas.ch:/scicore/home/PATH/dynamo_projects</tt>
+
  <tt>rsync -avuP myProject.tar USERNAME@login.scicore.unibas.ch:/scicore/home/s-gpu-course/USERNAME/dynamo_projects</tt>
  
 
* Login to your sciCORE account:
 
* Login to your sciCORE account:
Line 37: Line 37:
  
 
* While logged in to your sciCORE account, activate dynamo:
 
* While logged in to your sciCORE account, activate dynamo:
  <tt>source PATH/dynamo_activate_linux_shipped_MCR.sh</tt>
+
  <tt>source /scicore/home/s-gpu-course/GROUP/dynamo_activate_linux_shipped_MCR.sh</tt>
  
 
* Untar the Dynamo project:
 
* Untar the Dynamo project:
Line 45: Line 45:
 
  <tt>nano submit_job.sh</tt>
 
  <tt>nano submit_job.sh</tt>
  
* Copy (and adapt) the following lines into the newly created script. In any case you have to change the path following the command ''cd'' to the path of your project. Depending on your project you might also have to adapt the project name and the time requested (''time=hh:mm:ss'') in the script. Note the that the K80 and TitanX GPUs use different scripts. Also, if you are using the K80 and think that your job will run longer than 30 minutes, set the ''qos'' to ''6hours'' and adapt the time to anything between 30 minutes and 6 hours:
+
* Copy (and adapt) the following lines into the newly created script. Depending on your project you might have to adapt the project name and the time requested (''time=hh:mm:ss'') in the script. If your job will run longer than 30 minutes, set the ''qos'' to ''6hours'' and adapt the time to anything between 30 minutes and 6 hours:
 
 
For using the K80 GPUs:
 
  
 
  <nowiki>#!/bin/bash -l
 
  <nowiki>#!/bin/bash -l
Line 58: Line 56:
 
#SBATCH --ntasks-per-node=1
 
#SBATCH --ntasks-per-node=1
 
#SBATCH --cpus-per-task=1
 
#SBATCH --cpus-per-task=1
#SBATCH --partition=k80
+
#SBATCH --partition=pascal
 
#SBATCH --gres=gpu:1
 
#SBATCH --gres=gpu:1
 +
#SBATCH --reservation=dynamo
 
module load CUDA/7.5.18
 
module load CUDA/7.5.18
source PATH/dynamo_activate_linux_shipped_MCR.sh
+
source /scicore/home/s-gpu-course/GROUP/dynamo_activate_linux_shipped_MCR.sh
cd PATH/dynamo_projects
+
cd $HOME/dynamo_projects
 
echo "dvput myProject -gpu_identifier_set $CUDA_VISIBLE_DEVICES" > dcommands.sh
 
echo "dvput myProject -gpu_identifier_set $CUDA_VISIBLE_DEVICES" > dcommands.sh
 
echo "dvunfold myProject" >> dcommands.sh
 
echo "dvunfold myProject" >> dcommands.sh
Line 69: Line 68:
 
./myProject.m</nowiki>
 
./myProject.m</nowiki>
  
For using the TitanX GPUs:
 
 
<nowiki>#!/bin/bash -l
 
#
 
#SBATCH --job-name=dTest
 
#SBATCH --qos=emgpu
 
#SBATCH --time=00:30:00
 
#SBATCH --mem=16G
 
#SBATCH --nodes=1
 
#SBATCH --ntasks-per-node=1
 
#SBATCH --cpus-per-task=1
 
#SBATCH --partition=titanx
 
#SBATCH --gres=gpu:1
 
module load CUDA/7.5.18
 
source PATH/dynamo_activate_linux_shipped_MCR.sh
 
cd PATH/dynamo_projects
 
echo "dvput myProject -gpu_identifier_set $CUDA_VISIBLE_DEVICES" > dcommands.sh
 
echo "dvunfold myProject" >> dcommands.sh
 
dynamo dcommands.sh
 
chmod u=rxw ./myProject.m
 
./myProject.m</nowiki>
 
  
 
* You can now run your alignment project by submitting the previously created script to SLURM with:
 
* You can now run your alignment project by submitting the previously created script to SLURM with:

Revision as of 10:58, 27 August 2018

Here we describe how to use the GPUs provided for the Basel Workshop 2018. We go through each step and use a simple tutorial dataset and project as an example. You can use the same steps described here on your own project.

The GPUs we use are located on the high performance computing cluster of the University of Basel called sciCORE (https://scicore.unibas.ch) which uses the SLURM queuing system. A queuing system coordinates the access to the GPUs and is needed when there are many users using a limited amount of GPUs.

The main idea is that we create an alignment project locally, move it to the cluster on sciCORE and then run it using a pre-installed Dynamo standalone version on sciCORE. How you can do that is described in the following steps.


On your local Matlab session with Dynamo loaded:

  • Create a tutorial project with Dynamo:
dtutorial myParticles -p myProject -M 128

We now have a tutorial dataset with 128 particles in the directory myParticles and a tutorial alignment project myProject.

  • Open the alignment project window:
dcp myProject

and under computing environment select GPU (standalone) as an environment.

  • Check and unfold the project.
  • Before moving the data to sciCORE we have to compress the project. In the project window go to Tools and then create a tarball.


On your local Linux terminal:

  • Open a local Linux terminal and navigate to the directory where you just created the tutorial dataset and project. Copy the project data (particles) to sciCORE:
rsync -avuP myParticles USERNAME@login.scicore.unibas.ch:/scicore/home/s-gpu-course/USERNAME/dynamo_projects
  • Copy the previously created tar file of the project to sciCORE:
rsync -avuP myProject.tar USERNAME@login.scicore.unibas.ch:/scicore/home/s-gpu-course/USERNAME/dynamo_projects
  • Login to your sciCORE account:
ssh -Y USERNAME@login.scicore.unibas.ch

When asked to continue type "yes". Use the provided password.


While logged in to your sciCORE account:

  • While logged in to your sciCORE account, activate dynamo:
source /scicore/home/s-gpu-course/GROUP/dynamo_activate_linux_shipped_MCR.sh
  • Untar the Dynamo project:
dynamo dvuntar myProject.tar 
  • Create a blank SLURM submission script (text file) named submit_job.sh:
nano submit_job.sh
  • Copy (and adapt) the following lines into the newly created script. Depending on your project you might have to adapt the project name and the time requested (time=hh:mm:ss) in the script. If your job will run longer than 30 minutes, set the qos to 6hours and adapt the time to anything between 30 minutes and 6 hours:
#!/bin/bash -l
#
#SBATCH --job-name=dTest
#SBATCH --qos=30min
#SBATCH --time=00:30:00
#SBATCH --mem=16G
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --partition=pascal
#SBATCH --gres=gpu:1
#SBATCH --reservation=dynamo
module load CUDA/7.5.18
source /scicore/home/s-gpu-course/GROUP/dynamo_activate_linux_shipped_MCR.sh
cd $HOME/dynamo_projects
echo "dvput myProject -gpu_identifier_set $CUDA_VISIBLE_DEVICES" > dcommands.sh
echo "dvunfold myProject" >> dcommands.sh
dynamo dcommands.sh
chmod u=rxw ./myProject.m
./myProject.m


  • You can now run your alignment project by submitting the previously created script to SLURM with:
sbatch submit_job.sh
  • With the following commands you can check the overall status of the submitted jobs:

Check your status in the queue:

squeue -u USERNAME

See all users in queue for the K80 GPU:

squeue -q 30min

See all users in queue for the TitanX GPU:

squeue -q empgu

To cancel the job type scancel followed by the job ID that was shown by the squeue command:

scancel my_job_id

Some ways to check the last output:

ls -rtl
tail -f slurm-45994509.out
less slurm-45994509.out

To check the last average load the standalone Dynamo environment by typing dynamo into the terminal and use the usual commands, e.g.:

ddb myProject:a -v