Changeset 24540
- Timestamp:
- 01/31/20 14:07:53 (5 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/qmu/postqmu.m
r24439 r24540 1 1 function md=postqmu(md) 2 %INPUT function md=postqmu(md ,qmufile,qmudir)2 %INPUT function md=postqmu(md) 3 3 %Deal with dakota output results in files. 4 4 -
issm/trunk-jpl/src/m/qmu/postqmu.py
r24213 r24540 6 6 7 7 8 def postqmu(md , qmufile, qmudir='qmu' + str(getpid())):8 def postqmu(md): 9 9 ''' 10 10 Deal with dakota output results in files. 11 11 12 12 INPUT function 13 md = postqmu(md , qmufile, qmudir)13 md = postqmu(md) 14 14 15 By default: qmudir = 'qmu' + pid (eg. 'qmu2189')16 15 ''' 17 16 … … 24 23 print(fline) 25 24 26 raise RuntimeError('Dakota returned error in ' + str(qmuerrfile) + ' file. ' + str(qmudir) + ' directory retained.')25 raise RuntimeError('Dakota returned error in ' + str(qmuerrfile) + ' file.') 27 26 28 27 # parse inputs and results from dakota -
issm/trunk-jpl/src/m/qmu/preqmu.m
r24538 r24540 6 6 % options come from the solve.m routine. They can include Dakota options: 7 7 % 8 % qmudir: any directory where to run the qmu analysis9 8 % qmufile: input file for Dakota 10 9 % ivar: selection number for variables input (if several are specified in variables) … … 12 11 % imethod: same thing for methods 13 12 % iparams: same thing for params 14 % overwrite: overwrite qmudir before analysis15 13 16 14 disp('preprocessing dakota inputs'); 17 qmudir = getfieldvalue(options,'qmudir',['qmu' num2str(feature('GetPid'))]); % qmudir = ['qmu_' datestr(now,'yyyymmdd_HHMMSS')]; 18 qmufile = getfieldvalue(options,'qmufile','qmu');% qmufile cannot be changed unless ????script.sh is also changed 19 overwrite = getfieldvalue(options,'overwrite','n'); 15 qmufile = getfieldvalue(options,'qmufile','qmu'); 20 16 ivar = getfieldvalue(options,'ivar',1); 21 17 iresp = getfieldvalue(options,'iresp',1); … … 23 19 iparams = getfieldvalue(options,'iparams',1); 24 20 25 %first create temporary directory in which we will work26 %if strncmpi(overwrite,'y',1)27 % system(['rm -rf ' qmudir '/*']);28 %else29 % %does the directory exist? if so, then error out30 % if exist(qmudir)==7,31 % error('Existing ''%s'' directory, cannot overwrite. Specify ''overwrite'',''y'' option in solve arguments.',options.qmudir);32 % end33 %end34 %mkdir(qmudir)35 %cd(qmudir)36 37 21 %when running in library mode, the in file needs to be called md.miscellaneous.name.qmu.in 38 qmufile=[md.miscellaneous.name 22 qmufile=[md.miscellaneous.name]; 39 23 40 24 %retrieve variables and resposnes for this particular analysis. -
issm/trunk-jpl/src/m/qmu/preqmu.py
r24213 r24540 15 15 options come from the solve.py routine. They can include Dakota options: 16 16 17 qmudir: any directory where to run the qmu analysis18 17 qmufile: input file for Dakota 19 18 … … 23 22 imethod: same thing for methods 24 23 iparams: same thing for params 25 26 overwrite: overwrite qmudir before analysis27 24 ''' 28 25 29 26 print('preprocessing dakota inputs') 30 qmudir = options.getfieldvalue('qmudir', 'qmu' + str(os.getpid()))31 # qmudir = ['qmu_' datestr(now, 'yyyymmdd_HHMMSS')]32 27 qmufile = options.getfieldvalue('qmufile', 'qmu') 33 28 # qmufile cannot be changed unless ????script.sh is also changed 34 overwrite = options.getfieldvalue('overwrite', 'n')35 29 options.addfielddefault('ivar', 0) 36 30 options.addfielddefault('iresp', 0) 37 31 options.addfielddefault('imethod', 0) 38 32 options.addfielddefault('iparams', 0) 39 40 # first create temporary directory in which we will work41 if strncmpi(overwrite, 'y', 1):42 os.system('rm -rf ' + qmudir + '/* ')43 else:44 # does the directory exist? if so, then error out45 if os.path.isdir(qmudir):46 raise RuntimeError('Existing ' + str(options.qmudir) + ' directory, cannot overwrite. Specify "overwrite", "y" option in solve arguments.')47 48 # os.makedirs() raises error when dir exists, matlab's mkdir() does not49 if not os.path.isdir(qmudir):50 os.makedirs(qmudir)51 os.chdir(qmudir)52 33 53 34 # when running in library mode, the in file needs to be called md.miscellaneous.name.qmu.in -
issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py
r24252 r24540 58 58 #post processes qmu results if necessary 59 59 else: 60 md = postqmu(md , filename)60 md = postqmu(md) 61 61 62 62 return md
Note:
See TracChangeset
for help on using the changeset viewer.