Changeset 25601
- Timestamp:
- 09/28/20 11:46:23 (5 years ago)
- 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 30 30 end 31 31 end 32 if md.qmu.output ,32 if md.qmu.output & strcmpi(md.qmu.statistics.method(1).name,'None'), 33 33 if strcmpi(md.qmu.method.method,'nond_sampling'), 34 34 for i=1:md.qmu.method.params.samples … … 36 36 end 37 37 end 38 end 39 if ~strcmpi(md.qmu.statistics.method(1).name,'None'), 40 filelist{end+1}=[md.miscellaneous.name '.stats']; 38 41 end 39 42 else -
issm/branches/trunk-larour-SLPS2020/src/m/solve/loadresultsfromdisk.m
r24538 r25601 35 35 error(['No result found in binary file ' filename '. Check for solution crash.']); 36 36 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 37 45 md.results.(structure(1).SolutionType)=structure; 38 46 -
issm/branches/trunk-larour-SLPS2020/src/m/solve/parseresultsfromdisk.m
r25303 r25601 4 4 results=parseresultsfromdiskiosplit(md,filename); 5 5 else 6 results=parseresultsfromdiskioserial(md,filename); 7 end 8 9 6 %results=parseresultsfromdiskioserial(md,filename); 7 results=parseresultsfromdiskioserialsequential(md,filename); 8 end 9 10 function results=parseresultsfromdiskioserialsequential(md,filename) % {{{ 11 12 %Open file 13 fid=fopen(filename,'rb'); 14 if(fid==-1), 15 error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']); 16 end 17 18 %first pass to figure out the steps we have: 19 steps=[]; 20 while 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 28 end 29 30 steps=unique(steps) 31 32 %create structure: 33 results=struct('step',num2cell(steps)); 34 35 %second pass to fill the steps we have: 36 fseek(fid,0,-1); %rewind 37 while 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; 55 end 56 fclose(fid); 57 % }}} 10 58 function results=parseresultsfromdiskioserial(md,filename) % {{{ 11 59
Note:
See TracChangeset
for help on using the changeset viewer.