Changeset 961


Ignore:
Timestamp:
06/12/09 15:25:27 (16 years ago)
Author:
Eric.Larour
Message:

Added qmu serial capability

Location:
issm/trunk/src/m/classes
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/@model/model.m

    r804 r961  
    262262        md.qmu_method=struct();
    263263        md.qmu_params=struct();
    264         md.dakotaplugin=0;
    265264        md.dakotaresults=struct();
    266265        md.dakotain='';
     
    269268        md.qmu_analysis=0;
    270269        md.npart=0;
     270        md.numberofvariables=0;
     271        md.numberofresponses=0;
     272        md.variabledescriptors=NaN;
     273        md.responsedescriptors=NaN;
    271274
    272275        %Ice solver string
  • issm/trunk/src/m/classes/public/BuildQueueingScriptGeneric.m

    r869 r961  
    3131end
    3232
    33 fprintf(fid,' %s %s.bin %s.outbin %s.lock %s.qmu.in %s.qmu.out %s.qmu.err 2> %s.errlog >%s.outlog & ',executionpath,md.name,md.name,md.name,md.name,md.name,md.name,md.name,md.name);
     33fprintf(fid,' %s %s.bin %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',executionpath,md.name,md.name,md.name,md.name,md.name);
    3434fclose(fid);
  • issm/trunk/src/m/classes/public/displayqmu.m

    r804 r961  
    1111disp(sprintf('      ''%s''','qmu using Dakota'));
    1212
    13 for i=1:numel(md.variables)
    14     disp(sprintf('         variables%s:  (arrays of each variable class)',...
    15         string_dim(md.variables,i)));
    16     fnames=fieldnames(md.variables(i));
    17     maxlen=0;
    18     for j=1:numel(fnames)
    19         maxlen=max(maxlen,length(fnames{j}));
    20     end
    21    
    22     for j=1:numel(fnames)
    23         disp(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
    24             fnames{j},size(md.variables.(fnames{j})),class(md.variables.(fnames{j}))));
    25     end
    26 end
     13if ~md.qmu_analysis,
     14        disp(sprintf('         %s','no scheduled qmu. activate by doing md.qmu_analysis=1'));
     15else
     16
     17        for i=1:numel(md.variables)
     18                disp(sprintf('         variables%s:  (arrays of each variable class)',...
     19                        string_dim(md.variables,i)));
     20                fnames=fieldnames(md.variables(i));
     21                maxlen=0;
     22                for j=1:numel(fnames)
     23                        maxlen=max(maxlen,length(fnames{j}));
     24                end
     25               
     26                for j=1:numel(fnames)
     27                        disp(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
     28                                fnames{j},size(md.variables.(fnames{j})),class(md.variables.(fnames{j}))));
     29                end
     30        end
    2731
    2832
    29 for i=1:numel(md.responses)
    30     disp(sprintf('         responses%s:  (arrays of each response class)',...
    31         string_dim(md.responses,i)));
    32     fnames=fieldnames(md.responses(i));
    33     maxlen=0;
    34     for j=1:numel(fnames)
    35         maxlen=max(maxlen,length(fnames{j}));
    36     end
    37    
    38     for j=1:numel(fnames)
    39         disp(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
    40             fnames{j},size(md.responses.(fnames{j})),class(md.responses.(fnames{j}))));
    41     end
    42 end
     33        for i=1:numel(md.responses)
     34                disp(sprintf('         responses%s:  (arrays of each response class)',...
     35                        string_dim(md.responses,i)));
     36                fnames=fieldnames(md.responses(i));
     37                maxlen=0;
     38                for j=1:numel(fnames)
     39                        maxlen=max(maxlen,length(fnames{j}));
     40                end
     41               
     42                for j=1:numel(fnames)
     43                        disp(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
     44                                fnames{j},size(md.responses.(fnames{j})),class(md.responses.(fnames{j}))));
     45                end
     46        end
    4347
    4448
    45 disp(sprintf('         qmu_method:  (array of dakota_method class)'));
    46 for i=1:numel(md.qmu_method);
    47     if strcmp(class(md.qmu_method(i)),'dakota_method')
    48         disp(sprintf('            method%s :    ''%s''',...
    49             string_dim(md.qmu_method,i),md.qmu_method(i).method));
    50     end
     49        disp(sprintf('         qmu_method:  (array of dakota_method class)'));
     50        for i=1:numel(md.qmu_method);
     51                if strcmp(class(md.qmu_method(i)),'dakota_method')
     52                        disp(sprintf('            method%s :    ''%s''',...
     53                                string_dim(md.qmu_method,i),md.qmu_method(i).method));
     54                end
     55        end
     56
     57        for i=1:numel(md.qmu_params)
     58                disp(sprintf('         qmu_params%s:  (array of method-independent parameters)',...
     59                        string_dim(md.qmu_params,i)));
     60                fnames=fieldnames(md.qmu_params(i));
     61                maxlen=0;
     62                for j=1:numel(fnames)
     63                        maxlen=max(maxlen,length(fnames{j}));
     64                end
     65               
     66                for j=1:numel(fnames)
     67                        disp(sprintf(['            %-' num2str(maxlen+1) 's: %s'],...
     68                                fnames{j},any2str(md.qmu_params(i).(fnames{j}))));
     69                end
     70        end
     71
     72        for i=1:numel(md.dakotaresults)
     73                disp(sprintf('         dakotaresults%s:  (information from dakota files)',...
     74                        string_dim(md.dakotaresults,i)));
     75                fnames=fieldnames(md.dakotaresults(i));
     76                maxlen=0;
     77                for j=1:numel(fnames)
     78                        maxlen=max(maxlen,length(fnames{j}));
     79                end
     80               
     81                for j=1:numel(fnames)
     82                        disp(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
     83                                fnames{j},size(md.dakotaresults.(fnames{j})),class(md.dakotaresults.(fnames{j}))));
     84                end
     85        end
     86
     87        if isempty(md.dakotain), disp(sprintf('         dakotain: N/A')); else disp(sprintf('         dakotain:    [%ix%i]    (can be accessed by typing md.dakotain)',size(md.dakotain)));end
     88        if isempty(md.dakotaout), disp(sprintf('         dakotaout: N/A')); else disp(sprintf('         dakotaout:    [%ix%i]    (can be accessed by typing md.dakotaout)',size(md.dakotaout)));end
     89        if isempty(md.dakotadat), disp(sprintf('         dakotadat: N/A')); else disp(sprintf('         dakotadat:    [%ix%i]    (can be accessed by typing md.dakotadat)',size(md.dakotadat)));end
     90        disp(sprintf('         npart   : %i (number of partitions for semi-descrete qmu)',md.npart));
     91        disp(sprintf('         dakotaplugin   : %i (are we running using the library mode for Dakota? defaults to 0',md.dakotaplugin));
    5192end
    52 
    53 for i=1:numel(md.qmu_params)
    54     disp(sprintf('         qmu_params%s:  (array of method-independent parameters)',...
    55         string_dim(md.qmu_params,i)));
    56     fnames=fieldnames(md.qmu_params(i));
    57     maxlen=0;
    58     for j=1:numel(fnames)
    59         maxlen=max(maxlen,length(fnames{j}));
    60     end
    61    
    62     for j=1:numel(fnames)
    63         disp(sprintf(['            %-' num2str(maxlen+1) 's: %s'],...
    64             fnames{j},any2str(md.qmu_params(i).(fnames{j}))));
    65     end
    66 end
    67 
    68 for i=1:numel(md.dakotaresults)
    69     disp(sprintf('         dakotaresults%s:  (information from dakota files)',...
    70         string_dim(md.dakotaresults,i)));
    71     fnames=fieldnames(md.dakotaresults(i));
    72     maxlen=0;
    73     for j=1:numel(fnames)
    74         maxlen=max(maxlen,length(fnames{j}));
    75     end
    76    
    77     for j=1:numel(fnames)
    78         disp(sprintf(['            %-' num2str(maxlen+1) 's:    [%ix%i]    ''%s'''],...
    79             fnames{j},size(md.dakotaresults.(fnames{j})),class(md.dakotaresults.(fnames{j}))));
    80     end
    81 end
    82 
    83 if isempty(md.dakotain), disp(sprintf('         dakotain: N/A')); else disp(sprintf('         dakotain:    [%ix%i]    (can be accessed by typing md.dakotain)',size(md.dakotain)));end
    84 if isempty(md.dakotaout), disp(sprintf('         dakotaout: N/A')); else disp(sprintf('         dakotaout:    [%ix%i]    (can be accessed by typing md.dakotaout)',size(md.dakotaout)));end
    85 if isempty(md.dakotadat), disp(sprintf('         dakotadat: N/A')); else disp(sprintf('         dakotadat:    [%ix%i]    (can be accessed by typing md.dakotadat)',size(md.dakotadat)));end
    86 disp(sprintf('         npart   : %i (number of partitions for semi-descrete qmu)',md.npart));
    87 disp(sprintf('         dakotaplugin   : %i (are we running using the library mode for Dakota? defaults to 0',md.dakotaplugin));
  • issm/trunk/src/m/classes/public/ismodelselfconsistent.m

    r806 r961  
    158158%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  SOLUTION CHECKS  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    159159%QMU
    160 if md.dakotaplugin==1,
    161         if md.qmu_params.evaluation_concurrency~=1,
    162                 disp(['concurrency should be set to 1 when running dakota in library mode']);
    163                 bool=0;return;
    164         end
     160if md.qmu_params.evaluation_concurrency~=1,
     161        disp(['concurrency should be set to 1 when running dakota in library mode']);
     162        bool=0;return;
    165163end
    166164
  • issm/trunk/src/m/classes/public/marshall.m

    r816 r961  
    159159%Qmu: the rest will be handle by qmumarshall
    160160WriteData(fid,md.qmu_analysis,'Integer','qmu_analysis');
     161WriteData(fid,md.name,'String','name');
    161162
    162163%Get penalties to connect collapsed and non-collapsed 3d meshes:
  • issm/trunk/src/m/classes/public/process_solve_options.m

    r708 r961  
    7979end
    8080
     81
     82%  process qmu arguments
     83
     84%first, the defaults
     85qmudir ='qmu';% qmudir =['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
     86qmufile='qmu';%  qmufile can not be changed unless cielo_ice_script.sh is also changed
     87ivar   =1;
     88iresp  =1;
     89imethod=1;
     90iparams=1;
     91runmpi =false;
     92
     93for i=1:size(options,1),
     94        switch options{i,1},
     95        case 'qmudir'
     96                qmudir=options{i,2};
     97        case 'qmufile'
     98                qmufile=options{i,2};
     99        case 'ivar'
     100                ivar=options{i,2};
     101        case 'iresp'
     102                iresp=options{i,2};
     103        case 'imethod'
     104                imethod=options{i,2};
     105        case 'iparams'
     106                iparams=options{i,2};
     107        case 'overwrite'
     108                outoptions.overwrite=options{i,2};
     109        case 'outfiles'
     110                outoptions.outfiles=options{i,2};
     111        case 'rstfile'
     112                outoptions.rstfile=options{i,2};
     113        case 'rundakota'
     114                outoptions.rundakota=options{i,2};
     115        case 'runmpi'
     116                runmpi=options{i,2};
     117        otherwise
     118                %nothing
     119        end
     120end
     121
    81122%setup final options structure
    82123outoptions.analysis_type=analysis_type;
    83124outoptions.package=package;
    84125outoptions.sub_analysis_type=sub_analysis_type;
     126outoptions.qmudir=qmudir;
     127outoptions.qmufile=qmufile;
     128outoptions.ivar=ivar;
     129outoptions.iresp=iresp;
     130outoptions.imethod=imethod;
     131outoptions.iparams=iparams;
     132outoptions.runmpi=runmpi;
  • issm/trunk/src/m/classes/public/solve.m

    r681 r961  
    3737end
    3838
     39%if running qmu analysis, some preprocessing of dakota files using
     40%models fields needs to be carried out.
     41if md.qmu_analysis,
     42        md=preqmu(md,options);
     43end
     44
    3945displaystring(md.debug,'\n%s\n','launching solution sequence');
    4046
    4147%If running in parallel, we have a different way of launching the solution
    42 %sequences. qmu is the only solution sequence that cannot run in parallel
    43 if ~strcmpi(md.analysis_type,'qmu'),
    44         if ~strcmpi(md.cluster,'none'),
    45                 md=solveparallel(md);
    46                 return;
    47         end
     48%sequences.
     49if ~strcmpi(md.cluster,'none'),
     50        md=solveparallel(md);
     51        return;
    4852end
    49 
    5053%Launch correct solution sequence
    5154if strcmpi(md.analysis_type,'diagnostic'),
     
    5760elseif strcmpi(md.analysis_type,'transient'),
    5861        md=transient(md);
    59 
    60 elseif strcmpi(md.analysis_type,'qmu'),
    61         md=qmu(md,package);
    6262
    6363elseif strcmpi(md.analysis_type,'mesh2grid'),
     
    8080end
    8181
     82%post processes qmu results if necessary
     83if md.qmu_analysis,
     84        md=postqmu(md);
     85        cd ..
     86end
     87
    8288%Check result is consistent
    8389displaystring(md.debug,'%s\n','checking result consistency');
     
    9197addpath(genpath_ice([ISSM_DIR '/src/m/solutions/cielo']));
    9298addpath(genpath_ice([ISSM_DIR '/bin']));
     99
  • issm/trunk/src/m/classes/public/solveparallel.m

    r672 r961  
    1414marshall(md);
    1515
     16%add qmu fields to binary file if running qmu analysis
     17if md.qmu_analysis,
     18        qmumarshall(md,md.variables(options.ivar),md.responses(options.iresp));
     19end
     20
    1621%Now, we need to build the queuing script, used by the cluster to launch the job.
    1722BuildQueueingScript(md,executionpath,codepath);
Note: See TracChangeset for help on using the changeset viewer.