Changeset 24538


Ignore:
Timestamp:
01/31/20 13:53:16 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: no more qmu directory when running dakota

Location:
issm/trunk-jpl/src/m
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/qmu/preqmu.m

    r17792 r24538  
    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
     
    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);
     
    7272        numresponses=numresponses+numel(responses.(field_name));
    7373end
    74 %}}}}
    7574
    7675%create in file for dakota
     
    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));
     
    9897        end
    9998end
    100 %}}}
    10199
    102100%register the fields that will be needed by the Qmu model.
  • issm/trunk-jpl/src/m/qmu/process_qmu_options.m

    r15771 r24538  
    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};
  • issm/trunk-jpl/src/m/solve/loadresultsfromcluster.m

    r24439 r24538  
    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
     54end
     55if exist([md.private.runtimename '.tar.gz']) & ~ispc(),
     56        delete([md.private.runtimename '.tar.gz']);
    6057end
    6158
     
    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
  • issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py

    r24213 r24538  
    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
    85 
    8680
    8781def TryRem(extension, filename):
  • issm/trunk-jpl/src/m/solve/loadresultsfromdisk.m

    r21069 r24538  
    6060else
    6161        md=postqmu(md);
    62         cd ..
    6362end
  • issm/trunk-jpl/src/m/solve/solve.m

    r22618 r24538  
    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
  • issm/trunk-jpl/src/m/solve/solve.py

    r24213 r24538  
    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
  • issm/trunk-jpl/src/m/solve/solveiceocean.m

    r22948 r24538  
    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
Note: See TracChangeset for help on using the changeset viewer.