Difference between revisions of "Jobscript-examples"

From HPC Wiki
Jump to navigation Jump to search
Line 3: Line 3:
 
If you're not sure, go to [[Schedulers|this overview]] to figure out, which scheduler is used in your case.
 
If you're not sure, go to [[Schedulers|this overview]] to figure out, which scheduler is used in your case.
  
−
== Serial Job ==
 
−
 
−
This job will run a given executable, in this case "myapp.exe".
 
−
<syntaxhighlight lang="zsh">
 
−
#!/usr/bin/env zsh
 
−
 
−
### Job name
 
−
#BSUB -J MYJOB
 
−
 
−
### File where the output should be written
 
−
#BSUB -o MYJOB_OUTPUT.txt
 
−
 
−
### Time your job needs to execute, e. g. 1 h 20 min
 
−
#BSUB -W 1:20
 
−
 
−
### Memory your job needs, e. g. 1000 MB
 
−
#BSUB -M 1000
 
−
 
−
### Stack limit per process, e. g. 20 MB
 
−
#BSUB -S 20
 
−
 
−
### The last part consists of regular shell commands:
 
−
### Change to working directory
 
−
cd /home/user/mywork
 
−
 
−
### Execute your application
 
−
myapp.exe
 
−
</syntaxhighlight>
 
−
 
−
 
−
== OpenMP Job ==
 
−
 
−
This job will start the [[Parallel_Programming|parallel program]] "myapp.exe" with 24 threads.
 
−
<syntaxhighlight lang="zsh">
 
−
#!/usr/bin/env zsh
 
−
 
−
### Job name
 
−
#BSUB -J OMPJOB
 
−
 
−
### File where the output should be written
 
−
#BSUB -o OMPJOB_OUTPUT
 
−
 
−
### Time your job needs to execute, e. g. 15 min
 
−
#BSUB -W 0:15
 
−
 
−
### Memory your job needs, e. g. 1000 MB
 
−
#BSUB -M 1000
 
−
 
−
### Stack limit per process, e. g. 50 MB
 
−
#BSUB -S 50
 
−
 
−
###
 
−
 
−
### Change to working directory
 
−
cd /home/user/mywork
 
−
 
−
### Execute your application
 
−
myapp.exe
 
−
</syntaxhighlight>
 
  
 
== References ==
 
== References ==
 
[https://doc.itc.rwth-aachen.de/display/CC/Example+scripts More detailled examples]
 
[https://doc.itc.rwth-aachen.de/display/CC/Example+scripts More detailled examples]

Revision as of 16:01, 28 March 2018

These examples are very minimal and intended to give a rough overview of the functionality of jobscripts. They contain comments starting with "###" that explain the code. Follow one of these links to view the examples, depending on the scheduler that manages your facility's batch system: LSF, SLURM, Torque. If you're not sure, go to this overview to figure out, which scheduler is used in your case.


References

More detailled examples