source: issm/oecreview/Archive/24307-24683/ISSM-24537-24538.diff

Last change on this file was 24684, checked in by Mathieu Morlighem, 5 years ago

CHG: added new review

File size: 7.1 KB
  • ../trunk-jpl/src/m/qmu/preqmu.m

     
    2323iparams   = getfieldvalue(options,'iparams',1);
    2424
    2525%first create temporary directory in which we will work
    26 if strncmpi(overwrite,'y',1)
    27         system(['rm -rf ' qmudir '/*']);
    28 else
    29         %does the directory exist? if so, then error out
    30         if exist(qmudir)==7,
    31                 error('Existing ''%s'' directory, cannot overwrite. Specify ''overwrite'',''y'' option in solve arguments.',options.qmudir);
    32         end
    33 end
    34 mkdir(qmudir)
    35 cd(qmudir)
     26%if strncmpi(overwrite,'y',1)
     27%       system(['rm -rf ' qmudir '/*']);
     28%else
     29%       %does the directory exist? if so, then error out
     30%       if exist(qmudir)==7,
     31%               error('Existing ''%s'' directory, cannot overwrite. Specify ''overwrite'',''y'' option in solve arguments.',options.qmudir);
     32%       end
     33%end
     34%mkdir(qmudir)
     35%cd(qmudir)
    3636
    3737%when running in library mode, the in file needs to be called md.miscellaneous.name.qmu.in
    3838qmufile=[md.miscellaneous.name ];
     
    4545variables=expandvariables(md,variables);
    4646responses=expandresponses(md,responses);
    4747
    48 %go through variables and responses, and check they don't have more than md.qmu.numberofpartitions values. Also determine numvariables and numresponses{{{
     48%go through variables and responses, and check they don't have more than md.qmu.numberofpartitions values. Also determine numvariables and numresponses
    4949numvariables=0;
    5050variable_fieldnames=fieldnames(variables);
    5151for i=1:length(variable_fieldnames),
     
    7171        end
    7272        numresponses=numresponses+numel(responses.(field_name));
    7373end
    74 %}}}}
    7574
    7675%create in file for dakota
    7776dakota_in_data(md.qmu.method(imethod),variables,responses,md.qmu.params(iparams),qmufile);
    7877system(['rm -rf ' md.miscellaneous.name '.m']);
    7978
    80 %build a list of variables and responses descriptors. the list is not expanded. {{{
     79%build a list of variables and responses descriptors. the list is not expanded.
    8180variabledescriptors={};
    8281variable_fieldnames=fieldnames(md.qmu.variables(ivar));
    8382for i=1:length(variable_fieldnames),
     
    9796                responsedescriptors{end+1}=fieldresponses(j).descriptor;
    9897        end
    9998end
    100 %}}}
    10199
    102100%register the fields that will be needed by the Qmu model.
    103101md.qmu.numberofresponses=numresponses;
  • ../trunk-jpl/src/m/qmu/process_qmu_options.m

     
    7373                iparams=options{i,2};
    7474        case 'overwrite'
    7575                outoptions.overwrite=options{i,2};
    76         case 'keep'
    77                 outoptions.keep=options{i,2};
    7876        case 'outfiles'
    7977                outoptions.outfiles=options{i,2};
    8078        case 'rstfile'
  • ../trunk-jpl/src/m/solve/solveiceocean.m

     
    134134elseif md.settings.waitonlock==0,
    135135         disp('Model results must be loaded manually with md=loadresultsfromcluster(md);');
    136136end
    137 
    138 %post processes qmu results if necessary
    139 if md.qmu.isdakota,
    140         if ~strncmpi(getfieldvalue(options,'keep','y'),'y',1)
    141                 system(['rm -rf qmu' num2str(feature('GetPid'))]);
    142         end
    143 end
  • ../trunk-jpl/src/m/solve/loadresultsfromcluster.py

     
    7676    # remove this for bin file debugging
    7777        TryRem('.bin', filename)
    7878
    79     #cwd = os.getcwd().split('/')[-1]
    80     if md.qmu.isdakota:
    81         os.chdir('..')
    82     #TryRem('', cwd)
    83 
    8479    return md
    8580
    86 
    8781def TryRem(extension, filename):
    8882    try:
    8983        os.remove(filename + extension)
  • ../trunk-jpl/src/m/solve/solve.py

     
    152152                print('loading results from cluster')
    153153            md = loadresultsfromcluster(md)
    154154
    155     #post processes qmu results if necessary
    156     if md.qmu.isdakota:
    157         if not strncmpi(options.getfieldvalue('keep', 'y'), 'y', 1):
    158             shutil.rmtree('qmu' + str(os.getpid()))
    159 
    160155    return md
  • ../trunk-jpl/src/m/solve/loadresultsfromcluster.m

     
    4545md=loadresultsfromdisk(md,[md.miscellaneous.name '.outbin']);
    4646
    4747%erase the log and output files
    48 if md.qmu.isdakota,
    49         delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.outlog']);
    50         delete([['qmu' num2str(feature('GetPid')) '/']  md.miscellaneous.name '.errlog']);
    51 else
    52         if ~nolog,
    53                 delete([md.miscellaneous.name '.outlog']);
    54                 delete([md.miscellaneous.name '.errlog']);
    55         end
     48if ~nolog,
     49        delete([md.miscellaneous.name '.outlog']);
     50        delete([md.miscellaneous.name '.errlog']);
     51end
     52if exist([md.private.runtimename '.outbin'])
    5653        delete([md.miscellaneous.name '.outbin']);
    57         if exist([md.private.runtimename '.tar.gz']) & ~ispc(),
    58                 delete([md.private.runtimename '.tar.gz']);
    59         end
    6054end
     55if exist([md.private.runtimename '.tar.gz']) & ~ispc(),
     56        delete([md.private.runtimename '.tar.gz']);
     57end
    6158
    6259%erase input file if run was carried out on same platform.
    6360hostname=oshostname();
    6461if strcmpi(hostname,cluster.name),
    65         if md.qmu.isdakota,
    66                 delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.bin']);
    67                 delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.queue']);
     62        delete([md.miscellaneous.name '.bin']);
     63        delete([md.miscellaneous.name '.toolkits']);
     64        if ~ispc(),
     65                delete([md.miscellaneous.name '.queue']);
    6866        else
    69                 delete([md.miscellaneous.name '.bin']);
    70                 delete([md.miscellaneous.name '.toolkits']);
    71                 if ~ispc(),
    72                         delete([md.miscellaneous.name '.queue']);
    73                 else
    74                         delete([md.miscellaneous.name '.bat']);
    75                 end
     67                delete([md.miscellaneous.name '.bat']);
    7668        end
    7769end
  • ../trunk-jpl/src/m/solve/solve.m

     
    171171elseif md.settings.waitonlock==0,
    172172         disp('Model results must be loaded manually with md=loadresultsfromcluster(md);');
    173173end
    174 
    175 %post processes qmu results if necessary
    176 if md.qmu.isdakota,
    177         if ~strncmpi(getfieldvalue(options,'keep','y'),'y',1)
    178                 system(['rm -rf qmu' num2str(feature('GetPid'))]);
    179         end
    180 end
  • ../trunk-jpl/src/m/solve/loadresultsfromdisk.m

     
    5959%post processes qmu results if necessary
    6060else
    6161        md=postqmu(md);
    62         cd ..
    6362end
Note: See TracBrowser for help on using the repository browser.