Changeset 25601


Ignore:
Timestamp:
09/28/20 11:46:23 (5 years ago)
Author:
Eric.Larour
Message:

CHG: diverse

Location:
issm/branches/trunk-larour-SLPS2020/src/m/solve
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-larour-SLPS2020/src/m/solve/loadresultsfromcluster.m

    r24541 r25601  
    3030                end
    3131        end
    32         if md.qmu.output,
     32        if md.qmu.output & strcmpi(md.qmu.statistics.method(1).name,'None'),
    3333                if strcmpi(md.qmu.method.method,'nond_sampling'),
    3434                        for i=1:md.qmu.method.params.samples
     
    3636                        end
    3737                end
     38        end
     39        if ~strcmpi(md.qmu.statistics.method(1).name,'None'),
     40                filelist{end+1}=[md.miscellaneous.name '.stats'];
    3841        end
    3942else
  • issm/branches/trunk-larour-SLPS2020/src/m/solve/loadresultsfromdisk.m

    r24538 r25601  
    3535                error(['No result found in binary file ' filename '. Check for solution crash.']);
    3636        end
     37        if isempty(structure(1).SolutionType),
     38                if ~isempty(structure(end).SolutionType),
     39                        structure(1).SolutionType=structure(end).SolutionType;
     40                else
     41                        warning(['Cannot find a solution type in the results! Ascribing one: ''NoneSolution''.']);
     42                        structure(1).SolutionType='NoneSolution';
     43                end
     44        end
    3745        md.results.(structure(1).SolutionType)=structure;
    3846
  • issm/branches/trunk-larour-SLPS2020/src/m/solve/parseresultsfromdisk.m

    r25303 r25601  
    44        results=parseresultsfromdiskiosplit(md,filename);
    55else
    6         results=parseresultsfromdiskioserial(md,filename);
    7 end
    8 
    9 
     6        %results=parseresultsfromdiskioserial(md,filename);
     7        results=parseresultsfromdiskioserialsequential(md,filename);
     8end
     9
     10function results=parseresultsfromdiskioserialsequential(md,filename) % {{{
     11
     12%Open file
     13fid=fopen(filename,'rb');
     14if(fid==-1),
     15        error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
     16end
     17
     18%first pass to figure out the steps we have:
     19steps=[];
     20while  1,
     21        result  = ReadDataDimensions(fid);
     22        if isempty(result),
     23                break;
     24        end
     25        if result.step~=-9999,
     26                steps=[steps result.step];
     27        end
     28end
     29
     30steps=unique(steps)
     31
     32%create structure:
     33results=struct('step',num2cell(steps));
     34
     35%second pass to fill the steps we have:
     36fseek(fid,0,-1); %rewind
     37while  1,
     38        result  = ReadData(fid,md);
     39        if isempty(result),
     40                break;
     41        end
     42        if result.step==-9999,
     43                result.step=1;
     44                result.time=0;
     45        end
     46        %find where we are putting this step:
     47        ind=find(steps==result.step);
     48        if isempty(ind),
     49                error('could not find a step in our pre-structure! Something is very off!');
     50        end
     51
     52        %plug:
     53        results(ind).time=result.time;
     54        results(ind).(result.fieldname)=result.field;
     55end
     56fclose(fid);
     57% }}}
    1058function results=parseresultsfromdiskioserial(md,filename) % {{{
    1159
Note: See TracChangeset for help on using the changeset viewer.