Difference between revisions of "GPUs EMBO 2018"

From Dynamo
Jump to navigation Jump to search
Line 22: Line 22:
 
== Submission script model ==
 
== Submission script model ==
 
there is a sample script located in  
 
there is a sample script located in  
  <tt> path this and that </tt>
+
  <tt> /g/embo2018/cryo06/Dynamo/test/submit.scrip </tt>
  
 +
containing: 
 
  <pre>
 
  <pre>
 
#!/bin/bash
 
#!/bin/bash
 
#SBATCH -p gpu
 
#SBATCH -p gpu
 
#SBATCH -N 1 #stay on a single node. remove for CPU jobs
 
#SBATCH -N 1 #stay on a single node. remove for CPU jobs
#SBATCH -J jobname   XXXX CHANGE THIS
+
#SBATCH -J jobname   # change this
#SBATCH --ntasks=7       
+
#SBATCH --ntasks=1;     
 
#SBATCH -o run.out          # STDOUT
 
#SBATCH -o run.out          # STDOUT
 
#SBATCH -e run.err          # STDERR
 
#SBATCH -e run.err          # STDERR
#SBATCH --gres=gpu:2 XXXX CHANGE THIS
+
#SBATCH --gres=gpu:2   # XXXX CHANGE THIS
 
#SBATCH --mail-type=END,FAIL
 
#SBATCH --mail-type=END,FAIL
#SBATCH --mem=120GB
+
#SBATCH --mem=12GB
 
#SBATCH --time=0-03:00:00
 
#SBATCH --time=0-03:00:00
  
module load CUDA/7.5.18-GCC-6.4.0-2.28
 
 
module load dynamo
 
module load dynamo
 
+
export LD_LIBRARY_PATH=$EBROOTGCC/lib64:$LD_LIBRARY_PATH
echo "dvput MYPROJECT -gpu_identifier_set $CUDA_VISIBLE_DEVICES" > dcommands.sh
+
module load CUDA/9.1.85_387.26-GCC-6.4.0-2.28
 +
echo "dvput MYPROJECT -gpu_identifier_set $CUDA_VISIBLE_DEVICES" dcommands.sh
 
echo "dvunfold MYPROJECT" >> dcommands.sh
 
echo "dvunfold MYPROJECT" >> dcommands.sh
 
dynamo dcommands.sh
 
dynamo dcommands.sh
 +
 
chmod u=rxw ./MYPROJECT.m
 
chmod u=rxw ./MYPROJECT.m
./myProject.m
+
./MYPROJECT.m
  
 
</pre>
 
</pre>
Line 52: Line 54:
 
You can copy the script to your local folder (where you have created the project) and edit it to match the requirements of the project. Basically, you need to change the number of GPUs, the name of the project.  Rename it to something you can identify later, like  <tt>ptest.script</tt>
 
You can copy the script to your local folder (where you have created the project) and edit it to match the requirements of the project. Basically, you need to change the number of GPUs, the name of the project.  Rename it to something you can identify later, like  <tt>ptest.script</tt>
  
 +
<tt> cp /g/embo2018/cryo06/Dynamo/test/submit.script ptest.script</tt>
 +
 +
To edit the new script, use
 +
<tt>emacs ptest.script</tt>
 +
Operate the changes in the EMACS terminal. To leave, press Ctrl+x then Ctrl+c
 +
 
== Submit the script ==
 
== Submit the script ==
 
<tt>srun ptest.script</tt>
 
<tt>srun ptest.script</tt>

Revision as of 10:24, 26 August 2018

We exemplify the process of sending projects to the GPU by the creation and running of a synthetic project.

Creation of the project

  • Create a tutorial project
dtutorial t -p MYPROJECT -M 100   

This project contains 100 synthetic thermosomes.

  • Adapt the project to be ran on a GPU environment
dvput MYPROJECT destination matlab_gpu
  • Passes a group of GPU identifiers. Assuming that we just want to use 2 GPUs:
dvput ptest gpu_identifier_set  0:1
  • Unfolds the project:
dvunfold ptest

It creates a script called ptest.sh that needs to be submitted to the a GPU.

Submission of the project

Submission script model

there is a sample script located in

 /g/embo2018/cryo06/Dynamo/test/submit.scrip 

containing:

#!/bin/bash
#SBATCH -p gpu
#SBATCH -N 1 #stay on a single node. remove for CPU jobs
#SBATCH -J jobname    # change this
#SBATCH --ntasks=1;       
#SBATCH -o run.out          # STDOUT
#SBATCH -e run.err          # STDERR
#SBATCH --gres=gpu:2   # XXXX CHANGE THIS	
#SBATCH --mail-type=END,FAIL
#SBATCH --mem=12GB		
#SBATCH --time=0-03:00:00

module load dynamo
export LD_LIBRARY_PATH=$EBROOTGCC/lib64:$LD_LIBRARY_PATH
module load CUDA/9.1.85_387.26-GCC-6.4.0-2.28
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

Adapt the script to the project

You can copy the script to your local folder (where you have created the project) and edit it to match the requirements of the project. Basically, you need to change the number of GPUs, the name of the project. Rename it to something you can identify later, like ptest.script

 cp /g/embo2018/cryo06/Dynamo/test/submit.script ptest.script

To edit the new script, use

emacs ptest.script

Operate the changes in the EMACS terminal. To leave, press Ctrl+x then Ctrl+c

Submit the script

srun ptest.script