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

Last change on this file since 3308 was 3308, checked in by seroussi, 15 years ago

minor

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