User Tools

Site Tools


java

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
java [2017/10/06 18:09]
meesters [Memory]
java [2019/01/14 10:31]
meesters [CPU]
Line 14: Line 14:
 #SBATCH -A zdvhpc #SBATCH -A zdvhpc
 #SBATCH -n 1 #SBATCH -n 1
-#SBATCH --mem=5G+#SBATCH --mem=1800M
  
 module load lang/Java module load lang/Java
Line 21: Line 21:
 srun -n 1  java -Xms1G -Xmx1G -version srun -n 1  java -Xms1G -Xmx1G -version
 </​code>​ </​code>​
-Note that for larger heap sizes, you just need to keep the offset large enough. Set ''​-c ​n''​ with ''​n''​ being the number of threads you want to instruct your program to use; it will be ''​1''​ by default.+Note that for larger heap sizes, you just need to keep the offset large enough. Set ''​-c ​x''​ with ''​x''​ being the number of threads you want to instruct your program to use; it will be ''​1''​ by default.
  
 <WRAP center round important 60%> <WRAP center round important 60%>
Line 31: Line 31:
 As Java creates additional threads for JVM maintainance (e.g. garbage collection) it is advisable to reserve an additional core for the Java overhead. I.e., if you have a single-threaded Java application,​ you should reserve a second CPU slot by using the ''​-c 2''​ option in your submission script to ''​sbatch''​. As Java creates additional threads for JVM maintainance (e.g. garbage collection) it is advisable to reserve an additional core for the Java overhead. I.e., if you have a single-threaded Java application,​ you should reserve a second CPU slot by using the ''​-c 2''​ option in your submission script to ''​sbatch''​.
  
 +
 +==== Pointing JAVA applications to node local scratch directories ====
 +
 +On our clusters all jobs are provided with a node local scratch directory: ''/​localscratch/​$SLURM_JOB_ID''​. If a particular application does not allow this directory to be supplied on the command line, yet requires to write scratch files the ''​_JAVA_OPTIONS''​ allows to define the scratch directory anyway:
 +
 +<code bash>
 +# put this in your job submission script to specify the local scratch directory
 +export _JAVA_OPTIONS="​-Djava.io.tmpdir=/​localscratch/​${SLURM_JOB_ID}/"​
 +</​code>​
java.txt · Last modified: 2019/01/14 10:31 by meesters