Changeset 27949
- Timestamp:
- 10/08/23 10:33:56 (19 months ago)
- Location:
- issm/trunk-jpl/src/m/classes/clusters
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/clusters/generic.m
r27488 r27949 33 33 34 34 %Change the defaults if ispc 35 if ispc & ~ismingw,35 if ispc, 36 36 cluster.codepath = [issmdir() '\bin']; 37 37 cluster.etcpath = [issmdir() '\etc']; … … 99 99 100 100 if ~ispc(), 101 % Check that executable exists at the right path 102 if ~exist([cluster.codepath '/' executable],'file'), 103 error(['File ' cluster.codepath '/' executable ' does not exist']); 104 end 105 106 % Process codepath and prepend empty spaces with \ to avoid errors in queuing script 107 codepath=strrep(cluster.codepath,' ','\ '); 108 109 % Write queuing script 101 110 fid=fopen([modelname '.queue'],'w'); 102 111 fprintf(fid,'#!%s\n',cluster.shell); 103 if ~isvalgrind, 104 if cluster.interactive 105 if IssmConfig('_HAVE_MPI_'), 106 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname); 107 else 108 fprintf(fid,'%s/%s %s %s %s',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname); 109 end 110 else 111 if IssmConfig('_HAVE_MPI_'), 112 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s 2> %s.errlog > %s.outlog &',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname); 113 else 114 fprintf(fid,'%s/%s %s %s %s 2> %s.errlog > %s.outlog &',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname); 115 end 116 end 117 elseif isgprof, 118 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname); 119 else 112 if isvalgrind, 120 113 %Add --gen-suppressions=all to get suppression lines 121 114 %fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib); it could be deleted … … 137 130 end 138 131 end 132 elseif isgprof, 133 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname); 134 else 135 if cluster.interactive 136 if IssmConfig('_HAVE_MPI_'), 137 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname); 138 else 139 fprintf(fid,'%s/%s %s %s %s',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname); 140 end 141 else 142 if IssmConfig('_HAVE_MPI_'), 143 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s 2> %s.errlog > %s.outlog &',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname); 144 else 145 fprintf(fid,'%s/%s %s %s %s 2> %s.errlog > %s.outlog &',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname); 146 end 147 end 139 148 end 140 149 if ~io_gather, %concatenate the output files: … … 144 153 145 154 else % Windows 146 147 155 fid=fopen([modelname '.bat'],'w'); 148 156 fprintf(fid,'@echo off\n'); 149 157 150 % if IssmConfig('_HAVE_PETSC_MPI_'),151 % warning('parallel runs not allowed yet in Windows. Defaulting to 1 cpus');152 % cluster.np=1;153 % end154 155 158 if cluster.np>1, 156 % fprintf(fid,'"C:\\Program Files\\MPICH2\\bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s',cluster.np,cluster.codepath,executable,solution,modelname);157 159 fprintf(fid,'"C:\\Program Files\\Microsoft MPI\\Bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s',cluster.np,cluster.codepath,executable,solution,modelname); 158 160 else 159 fprintf(fid,'"%s /%s" %s ./ %s',cluster.codepath,executable,solution,modelname);161 fprintf(fid,'"%s\\%s" %s ./ %s',cluster.codepath,executable,solution,modelname); 160 162 end 161 163 fclose(fid); -
issm/trunk-jpl/src/m/classes/clusters/generic.py
r27262 r27949 18 18 19 19 class generic(object): 20 """ GENERICcluster class definition20 """generic cluster class definition 21 21 22 22 Usage: -
issm/trunk-jpl/src/m/classes/clusters/generic_static.m
r27262 r27949 3 3 % Usage: 4 4 % cluster=generic_static('name','astrid','np',3); 5 % cluster=generic('name',oshostname(),'np',3,'login','username'); 6 % 7 % TODO: 8 % - Add support for restart to Windows (under MSYS2), then activate tests 125 9 % and 126 in test suite 10 % 5 11 6 12 classdef generic_static … … 17 23 methods 18 24 function cluster=generic_static(varargin) % {{{ 25 19 26 %use provided options to change fields 20 27 options=pairoptions(varargin{:}); … … 69 76 end 70 77 71 % Check that executable exists at the right path 72 if ~exist([cluster.codepath '/' executable],'file'), 73 error(['File ' cluster.codepath '/' executable ' does not exist']); 78 if ~ispc(), 79 % Check that executable exists at the right path 80 if ~exist([cluster.codepath '/' executable],'file'), 81 error(['File ' cluster.codepath '/' executable ' does not exist']); 82 end 83 84 % Process codepath and prepend empty spaces with \ to avoid errors in queuing script 85 codepath=strrep(cluster.codepath,' ','\ '); 86 87 % Write queuing script 88 fid=fopen([modelname '.queue'],'w'); 89 fprintf(fid,'#!%s\n',cluster.shell); 90 if cluster.interactive 91 if IssmConfig('_HAVE_MPI_'), 92 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname); 93 else 94 fprintf(fid,'%s/%s %s %s %s',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname); 95 end 96 else 97 if IssmConfig('_HAVE_MPI_'), 98 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s 2> %s.errlog > %s.outlog &',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname); 99 else 100 fprintf(fid,'%s/%s %s %s %s 2> %s.errlog > %s.outlog &',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname); 101 end 102 end 103 fclose(fid); 104 else % Windows 105 fid=fopen([modelname '.bat'],'w'); 106 fprintf(fid,'@echo off\n'); 107 108 if cluster.np>1, 109 fprintf(fid,'"%s\\mpiexec.exe" -n %i "%s/%s" %s ./ %s',cluster.codepath,cluster.np,cluster.codepath,executable,solution,modelname); 110 else 111 fprintf(fid,'"%s\\%s" %s ./ %s',cluster.codepath,executable,solution,modelname); 112 end 113 fclose(fid); 74 114 end 75 115 76 % Process codepath and prepend empty spaces with \ to avoid errors in queuing script 77 codepath=strrep(cluster.codepath,' ','\ '); 78 79 % Write queuing script 80 fid=fopen([modelname '.queue'],'w'); 81 fprintf(fid,'#!%s\n',cluster.shell); 82 fprintf(fid,['%s/mpiexec -np %i %s/%s %s %s %s \n'],codepath,cluster.np,codepath,executable,solution,'./',modelname); 83 fclose(fid); 84 85 % Create an errlog and outlog file 86 fid=fopen([modelname '.errlog'],'w'); 87 fclose(fid); 88 fid=fopen([modelname '.outlog'],'w'); 89 fclose(fid); 116 %in interactive mode, create a run file, and errlog and outlog file 117 if cluster.interactive, 118 fid=fopen([modelname '.errlog'],'w'); 119 fclose(fid); 120 fid=fopen([modelname '.outlog'],'w'); 121 fclose(fid); 122 end 90 123 end 91 124 %}}}
Note:
See TracChangeset
for help on using the changeset viewer.