source: issm/trunk/src/m/classes/public/queue/ClusterScript.m@ 3149

Last change on this file since 3149 was 3149, checked in by Eric.Larour, 15 years ago

More generic creation of queuing scripts.

File size: 4.0 KB
Line 
1function ClusterScript(fid,cluster,name,queue,executionpath,codepath,analysis_type,np,time,mem_debug);
2%CLUSTERSCRIPT cluster specific queuing script
3%
4% Usage: ClusterScript(fid,name,queue,executionpath,codepath,analysis_type,np,time);
5%
6%
7
8
9if strcmpi(cluster,'cosmos'),
10
11
12
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%cosmos%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 fprintf(fid,'#!/bin/bash\n');
15 fprintf(fid,'#PBS -l select=%i:ncpus=1\n',np);
16 fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
17 fprintf(fid,'#PBS -q %s\n',queue);
18 fprintf(fid,'#PBS -o %s.outlog \n',name);
19 fprintf(fid,'#PBS -e %s.errlog \n',name);
20 fprintf(fid,'export PBS_O_WORKDIR=%s\n',executionpath);
21 fprintf(fid,'cd $PBS_O_WORKDIR\n');
22 fprintf(fid,'export OMP_NUM_THREADS=1\n');
23 fprintf(fid,'ulimit -s unlimited\n');
24 fprintf(fid,'ulimit -c 0\n');
25 fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpirun -np %i %s/%s.exe %s %s.bin %s.outbin %s.lock',np,codepath,AnalysisTypeFromEnum(analysis_type),executionpath,name,name,name);
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27
28
29
30
31elseif (strcmpi(cluster,'astrid') | strcmpi(cluster,'larsen') | strcmpi(cluster,'wilkes')),
32
33
34
35
36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%astrid%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 fprintf(fid,'#!/bin/sh\n');
38 fprintf(fid,'rm -rf %s/%s.lock\n',executionpath,name);
39 if mem_debug==0,
40 fprintf(fid,'mpirun -np %i %s/%s.exe %s %s.bin %s.outbin %s.lock 2> %s.errlog >%s.outlog & ',np,codepath,AnalysisTypeFromEnum(analysis_type),executionpath,name,name,name,name,name);
41 else
42 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full %s/%s.exe %s %s.bin %s.outbin %s.lock 2> %s.errlog >%s.outlog & ',[ISSM_DIR '/externalpackages/valgrind/install/lib/libmpidebug.so'],np,[ISSM_DIR '/externalpackages/valgrind/install/bin/valgrind'],codepath,AnalysisTypeFromEnum(analysis_type),executionpath,name,name,name,name,name);
43 end
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45
46
47
48
49
50elseif (strcmpi(cluster,'gemini') | strcmpi(cluster,'pollux') | strcmpi(cluster,'castor')),
51
52 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%gemini%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53fprintf(fid,'#!/bin/sh\n');
54 fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
55 fprintf(fid,'#PBS -l ncpus=%i\n',np);
56 if ~isempty(queue),
57 fprintf(fid,'#PBS -q %s\n',queue);
58 end
59 fprintf(fid,'#PBS -o %s.outlog \n',name);
60 fprintf(fid,'#PBS -e %s.errlog \n',name);
61
62 fprintf(fid,'export PBS_O_WORKDIR=%s\n',executionpath);
63 fprintf(fid,'cd $PBS_O_WORKDIR\n');
64 fprintf(fid,'export OMP_NUM_THREADS=1\n');
65 fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/%s.exe %s %s.bin %s.outbin %s.lock',np-1,np,codepath,AnalysisTypeFromEnum(analysis_type),executionpath,name,name,name);
66 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67
68
69
70elseif strcmpi(cluster,'pfe'),
71
72
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%pfe%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74 fprintf(fid,'#PBS -S /bin/bash\n');
75 fprintf(fid,'#PBS -N %s\n',name);
76 fprintf(fid,'#PBS -l select=%i:ncpus=8:mpiprocs=8\n',np/8);
77 fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
78 fprintf(fid,'#PBS -W group_list=s1010\n');
79 fprintf(fid,'#PBS -m e\n');
80 fprintf(fid,'#PBS -o %s.outlog \n',name);
81 fprintf(fid,'#PBS -e %s.errlog \n\n',name);
82
83 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
84
85 fprintf(fid,'module load comp-intel/11.1.046\n');
86 fprintf(fid,'module load mpi/mpt.1.23.nas\n');
87 fprintf(fid,'module load math/intel_mkl_64_10.0.011\n\n');
88
89 fprintf(fid,'export PATH="$PATH:."\n\n');
90
91 fprintf(fid,'cd $PBS_O_WORKDIR\n\n');
92
93 fprintf(fid,'mpiexec -verbose -np %i %s/%s.exe $PBS_O_WORKDIR %s.bin %s.outbin %s.lock',np,codepath,AnalysisTypeFromEnum(analysis_type),name,name,name);
94 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95
96
97else
98 error(['ClusterScript error message: could not find settings for cluster ' cluster]);
99end
Note: See TracBrowser for help on using the repository browser.