Changeset 15316
- Timestamp:
- 06/22/13 10:58:18 (12 years ago)
- Location:
- issm/trunk-jpl/src/m/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/model/model.m
r15106 r15316 1201 1201 ylim([min(obj.mesh.y) max(obj.mesh.y)]) 1202 1202 end % }}} 1203 function md=upload(md) % {{{ 1204 %the goal of this routine is to upload the model onto a server, and to empty it. 1205 %So first, save the model with a unique name and upload the file to the server: 1206 random_part=fix(rand(1)*10000); 1207 id=[md.miscellaneous.name '-' regexprep(datestr(now),'[^\w'']','') '-' num2str(random_part) '-' getenv('USER') '-' oshostname() '.upload']; 1208 eval(['save ' id ' md']); 1209 1210 %Now, upload the file: 1211 issmscpout(md.settings.upload_server,md.settings.upload_path,md.settings.upload_login,md.settings.upload_port,{id},1); 1212 1213 %Now, empty this model of everything except settings, and record name of file we just uploaded! 1214 settings_back=md.settings; 1215 md=model(); 1216 md.settings=settings_back; 1217 md.settings.upload_filename=id; 1218 1219 %get locally rid of file that was uploaded 1220 eval(['delete ' id]); 1221 1222 1223 end % }}} 1224 function md=download(md) % {{{ 1225 1226 %the goal of this routine is to download the internals of the current model from a server, because 1227 %this model is empty, except for the settings which tell us where to go and find this model! 1228 1229 %Download the file: 1230 issmscpin(md.settings.upload_server, md.settings.upload_login, md.settings.upload_port, md.settings.upload_path, {md.settings.upload_filename}); 1231 1232 name=md.settings.upload_filename; 1233 1234 %Now, load this model: 1235 md=loadmodel(md.settings.upload_filename); 1236 1237 %get locally rid of file that was downloaded 1238 eval(['delete ' name]); 1239 1240 end % }}} 1203 1241 end 1204 1242 end -
issm/trunk-jpl/src/m/classes/settings.m
r15131 r15316 11 11 output_frequency = 0; 12 12 waitonlock = 0; 13 upload_server = ''; 14 upload_path = ''; 15 upload_login = ''; 16 upload_port = 0; 17 upload_filename = ''; 18 13 19 end 14 20 methods … … 40 46 %0 to deactivate 41 47 obj.waitonlock=Inf; 48 49 %upload options: 50 upload_port = 0; 51 42 52 end % }}} 43 53 function md = checkconsistency(obj,md,solution,analyses) % {{{ … … 58 68 fielddisplay(obj,'output_frequency','frequency at which results are saved in all solutions with multiple time_steps'); 59 69 fielddisplay(obj,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)'); 70 fielddisplay(obj,'upload_server','server hostname where model should be uploaded'); 71 fielddisplay(obj,'upload_path','path on server where model should be uploaded'); 72 fielddisplay(obj,'upload_login','server login'); 73 fielddisplay(obj,'upload_port','port login (default is 0)'); 74 fielddisplay(obj,'upload_filename','unique id generated when uploading the file to server'); 60 75 61 76 end % }}}
Note:
See TracChangeset
for help on using the changeset viewer.