Changeset 2242


Ignore:
Timestamp:
09/15/09 16:01:54 (16 years ago)
Author:
Eric.Larour
Message:

steadystate_core: minor.
plot_hist_norm: transferred to public/plot directory.
new settings for cosmos cluster
new plot: plot_qmuhistnorm, based on John's plot_hist_norm.

Location:
issm/trunk
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/etc/cluster.rc

    r2188 r2242  
    2323
    2424cluster_name=cosmos
    25 cluster_codepath=/home/larour/tier2_ice/cluster_delivery
    26 cluster_executionpath=/scratch/larour/Testing/AGU_2008
     25cluster_codepath=/work00/edw/larour/issm-2.0/bin
     26cluster_executionpath=/work00/edw/larour/Execution
    2727
    2828cluster_name=mustang
  • issm/trunk/src/c/parallel/steadystate_core.cpp

    r2008 r2242  
    7878        for(;;){
    7979       
    80                 if(debug)_printf_("%s%i\n","computing temperature and velocity for step: ",step);
     80                if(debug)_printf_("%s%i\n","   computing temperature and velocity for step: ",step);
    8181
    8282                //first compute temperature at steady state.
  • issm/trunk/src/m/classes/public/BuildQueueingScriptcosmos.m

    r465 r2242  
    11function BuildQueueingScriptcosmos(md,executionpath,codepath)
    2 %BUILDQUEUEINGSCRIPTCOSMOS - build queueing script for batch system when running parallel
    3 %
    4 %   solutiontype is 'diagnostic','prognostic','transient','thermal','parameters' or 'control'
    5 %   and varargin is an optional package name ('cielo', 'ice' or 'macayeal')
    6 %
    7 %   Usage:
    8 %       md=solve(md,solutiontype,varargin)
    9 %
    10 %   Examples:
    11 %      md=solve(md,'diagnostic','macayeal');
    12 %
    13 
    14 function BuildQueueingScriptcosmos(md,solutiontype,executionpath,codepath)
    15 %BUILDQUEUEINGSCRIPTCOSMOS - ...
     2%BUILDQUEUEINGSCRIPTGEMINI - ...
    163%
    174%   Usage:
     
    229fid=fopen(scriptname,'w');
    2310if fid==-1,
    24         error(['BuildQueueingScriptcosmoserror message: could not open ' scriptname ' file for ascii writing']);
     11        error(['BuildQueueingScriptcosmos error message: could not open ' scriptname ' file for ascii writing']);
    2512end
    2613
    27 fprintf(fid,'#!/bin/sh\n');
    28 fprintf(fid,'#BSUB -n %i -W %i\n',md.np,md.time);
    29 if md.exclusive,
    30         fprintf(fid,'#BSUB -x\n');
     14%check queue names:
     15available_queues={'debug','shortq','longq','specialq'};
     16if  ~ismemberi(md.queue,available_queues),
     17        error('BuildQueueingScriptcosmos error message: availables queues are debug, shortq, longq and specialq');
    3118end
    32 fprintf(fid,'#BSUB -a mpich_gm\n');
    33 fprintf(fid,'#BSUB -J %s\n',md.name);
    34 fprintf(fid,'#BSUB -o %s.outlog -e %s.errlog\n',md.name,md.name);
    35 fprintf(fid,'cd %s\n',executionpath);
    36 fprintf(fid,'rm -rf %s.outlog %s.errlog %s.lock\n',md.name,md.name,md.name);
    37 if md.alloc_cleanup,
    38         fprintf(fid,'mpirun.lsf /home/larour/bin/alloc_cleanup.exe\n');
     19
     20%test parameters for each queue:
     21if strcmpi(md.queue,'debug'),
     22        if md.np>32,
     23                error('BuildQueueingScriptcosmos error message: debug queue only allows 32 cpus');
     24        end
     25        if md.time>60,
     26                error('BuildQueueingScriptcosmos error message: debug queue only allows 60 minutes');
     27        end
    3928end
    40 if strcmpi(solutiontype,'diagnostic'),
    41         fprintf(fid,'mpirun.lsf %s/diagnostic.exe %s %s.bin %s.outbin %s.lock',codepath,executionpath,md.name,md.name,md.name);
    42 elseif strcmpi(solutiontype,'control') ,
    43         fprintf(fid,'mpirun.lsf %s/control.exe %s %s.bin %s.outbin %s.lock',codepath,executionpath,md.name,md.name,md.name);
    44 elseif strcmpi(solutiontype,'thermal') ,
    45         fprintf(fid,'mpirun.lsf %s/thermal.exe %s %s.bin %s.outbin %s.lock',codepath,executionpath,md.name,md.name,md.name);
    46 else
    47         error('BuildQueueingScriptcosmos error message: unsupported solution type!');
     29
     30if strcmpi(md.queue,'shortq'),
     31        if md.np>128,
     32                error('BuildQueueingScriptcosmos error message: shortq queue only allows 128 cpus');
     33        end
     34        if md.time>180,
     35                error('BuildQueueingScriptcosmos error message: shortq queue only allows 180 minutes');
     36        end
    4837end
     38
     39if strcmpi(md.queue,'longq'),
     40        if md.np>128,
     41                error('BuildQueueingScriptcosmos error message: longq queue only allows 128 cpus');
     42        end
     43        if md.time>720,
     44                error('BuildQueueingScriptcosmos error message: longq queue only allows 720 minutes');
     45        end
     46end
     47
     48if strcmpi(md.queue,'specialq'),
     49        if md.np>10,
     50                error('BuildQueueingScriptcosmos error message: longq queue only allows 10 cpus');
     51        end
     52end
     53
     54
     55
     56fprintf(fid,'#!/bin/csh\n');
     57fprintf(fid,'#PBS -l select=%i:ncpus=1\n',md.np);
     58fprintf(fid,'#PBS -l walltime=%i\n',md.time*60); %walltime is in seconds.
     59if ~isempty(md.queue),
     60        fprintf(fid,'#PBS -q %s\n',md.queue);
     61end
     62fprintf(fid,'#PBS -o %s.outlog \n',md.name);
     63fprintf(fid,'#PBS -e %s.errlog \n',md.name);
     64
     65fprintf(fid,'setenv PBS_O_WORKDIR %s\n',executionpath);
     66fprintf(fid,'cd $PBS_O_WORKDIR\n');
     67fprintf(fid,'setenv OMP_NUM_THREADS 1\n');
     68fprintf(fid,'limit stacksize unlimited\n');
     69fprintf(fid,'limit coredumpsize 0\n');
     70fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpirun -np %i -machinefile $PBS_NODEFILE %s/%s.exe %s %s.bin %s.outbin %s.lock',md.np,codepath,AnalysisTypeFromEnum(md.analysis_type),executionpath,md.name,md.name,md.name);
    4971fclose(fid);
  • issm/trunk/src/m/classes/public/BuildQueueingScriptgemini.m

    r2215 r2242  
    2424fprintf(fid,'cd $PBS_O_WORKDIR\n');
    2525fprintf(fid,'export OMP_NUM_THREADS=1\n');
    26 fprintf(fid,'mpirun -np %i %s/%s.exe %s %s.bin %s.outbin %s.lock',md.np,codepath,AnalysisTypeFromEnum(md.analysis_type),executionpath,md.name,md.name,md.name);
     26fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/%s.exe %s %s.bin %s.outbin %s.lock',md.np-1,md.np,codepath,AnalysisTypeFromEnum(md.analysis_type),executionpath,md.name,md.name,md.name);
    2727
    2828fclose(fid);
  • issm/trunk/src/m/classes/public/LaunchQueueJobcosmos.m

    r1268 r2242  
    11function md=LaunchQueueJobcosmos(md,executionpath,options)
    2 %LAUNCHQUEUEJOBCOSMOS - ...
     2%LAUNCHQUEUEJOBGEMINI - ...
    33%
    44%   Usage:
     
    1414end
    1515
    16 %Some special handling here! We could not get lsf to work through ssh, there is always something going badly
    17 %in terms of environment variables not being correctly setup. This is due to the fact the ssh does not use a loging
    18 %shell! What we therefore did, is figure out every variable setup in a login shell ( you can find it out by typing
    19 %export in a login bash shell). Instead of trying to figure out which path variable is not being correctly setup,
    20 %we just dump the export command result into a file, which we source before launching our job. This ensures we replicate
    21 %exactly the state of a login shell, through ssh.
    22 cosmosvariableslocation=which('cosmosvariables.sh');
    23 if isempty(cosmosvariableslocation),
    24         error('LaunchQueueJobcosmos error message: could not find environment variables for cosmos cluster!');
     16%jpload both files to cluster
     17if ~strcmpi(options.batch,'yes'),
     18        disp('uploading input file,  queueing script and variables script');
     19        if md.qmu_analysis,
     20                eval(['!scp ' md.name '.bin' ' ' md.name '.queue '  md.name '.qmu.in ' md.cluster ':' executionpath]);
     21        else
     22                eval(['!scp ' md.name '.bin' ' ' md.name '.queue '  md.cluster ':' executionpath]);
     23        end
     24else
     25        disp('batch mode requested: not launching job interactively');
    2526end
    2627
    27 %now upload both files to cluster
    28 disp('uploading input file,  queueing script and variables script');
    29 eval(['!scp ' md.name '.bin' ' ' md.name '.queue ' cosmosvariableslocation ' ' md.cluster ':' executionpath]);
    30 
    31 disp('launching solution sequence on remote cluster');
    32 %now call the queuing script to launch the job.
    33 system(['ssh  ' md.cluster ' ''cd ' executionpath ' && source ./cosmosvariables.sh && bsub <  ' md.name '.queue  && rm cosmosvariables.sh ''']);
     28%new cosmos cannot launch across cluster using ssh
     29disp(['launch solution sequence on remote cluster by logging into it and typing qsub < ' md.name '.queue']);
     30md.waitonlock=0;
  • issm/trunk/src/m/classes/public/plot/parse_options.m

    r1878 r2242  
    670670end
    671671
     672%histnorm_data
     673histnorm_data=findarg(optionstring,'histnorm_data');
     674if ~isempty(histnorm_data),
     675        options_struct.histnorm_data=histnorm_data.value;
     676else
     677        options_struct.histnorm_data=NaN;
     678end
    672679
    673680%designvariable
  • issm/trunk/src/m/classes/public/plot/plot_manager.m

    r2188 r2242  
    3030                        plot_segmentnumbering(md,options_structure,width,i);
    3131                        return;
    32                 case 'normplot',
    33                         plot_qmunormplot(md.dakotaresults.dresp_dat,width,i);
    34                         return;
    3532                case 'histnorm',
    36                         plot_qmuhistnorm(md.dakotaresults.dresp_dat);
     33                        plot_qmuhistnorm(md,options_structure,width,i);
    3734                        return;
    3835                case 'elements_type',
  • issm/trunk/src/m/classes/public/plot/plot_qmuhistnorm.m

    r345 r2242  
    11%
    2 %  plot a relative histogram along with the normal distribution.
    3 %
    4 %  []=plot_hist_norm(rfunc1   ,rfunc2  ,hmin,hmax,hnint)
    5 %  []=plot_hist_norm(data,desc,mu,sigma,hmin,hmax,hnint)
    6 %
    7 function []=plot_qmuhistnorm(varargin)
    8 
    9 if ~nargin
    10     help plot_hist_norm
    11     return
    12 end
     2%  plot a relative histogram and cdf optionally along with
     3%  a normal distribution.
     4%
     5%  []=plot_qmuhistnorm(dresp1   ,dresp2  ,hmin,hmax,hnint)
     6%  []=plot_qmuhistnorm(samp,desc,mu,sigma,hmin,hmax,hnint)
     7%
     8%  where the required input is:
     9%    dresp1        (structure array, responses)
     10%      or
     11%    samp          (double array, lists of samples)
     12%    desc          (cell array, list of descriptions)
     13%
     14%  and the optional input is:
     15%    dresp2        (structure array, responses)
     16%      or
     17%    mu            (double vector, means)
     18%    sigma         (double vector, standard deviations)
     19%
     20%    hmin          (numeric, minimum for histogram)
     21%    hmax          (numeric, maximum for histogram)
     22%    hnint         (numeric, number of intervals for histogram)
     23%
     24%  the required fields of dresp1 are:
     25%    descriptor    (char, description)
     26%    sample        (double vector, list of samples)
     27%
     28%  and the required fields of dresp2 are:
     29%    mean          (double, mean of sample)
     30%    stddev        (double, standard deviation of sample)
     31%
     32%  for each response in the input array, this function
     33%  calculates and plots a relative histogram and CDF of the list
     34%  of samples, and annotates it with the description.  in
     35%  addition, a mean and standard deviation may be supplied or
     36%  calculated so that a normal distribution and CDF may be
     37%  plotted.
     38%
     39%  dresp1 data would typically be contained in the dakota tabular
     40%  output file from a sampling analysis, and dresp2 data would
     41%  typically be contained in the dakota output file from a local
     42%  sensitivity analysis, both read by dakota_out_parse.
     43%
     44%  "Copyright 2009, by the California Institute of Technology.
     45%  ALL RIGHTS RESERVED. United States Government Sponsorship
     46%  acknowledged. Any commercial use must be negotiated with
     47%  the Office of Technology Transfer at the California Institute
     48%  of Technology.  (NTR 47078)
     49%
     50%  This software may be subject to U.S. export control laws.
     51%  By accepting this  software, the user agrees to comply with
     52%  all applicable U.S. export laws and regulations. User has the
     53%  responsibility to obtain export licenses, or other export
     54%  authority as may be required before exporting such information
     55%  to foreign countries or providing access to foreign persons."
     56%
     57
     58
     59function plot_qmuhistnorm(md,options_structure,width,i);
     60
     61%recover histnorm data
     62if isnans(options_structure.histnorm_data)
     63        error('plot_qmuhistnorm error message: option histnorm_data is required');
     64else
     65        varargin=options_structure.histnorm_data;
     66end
     67
     68nargin=length(varargin);
    1369
    1470%%  process input data and assemble into matrices as needed
    15 
    1671ivar=1;
    1772if isstruct(varargin{ivar})
    18     rfunc1=varargin{ivar};
     73    dresp1=varargin{ivar};
    1974    ivar=ivar+1;
    2075   
    21     desc=cell (1,length(rfunc1));
    22     ldata=zeros(1,length(rfunc1));
    23     for i=1:length(rfunc1)
    24         ldata(i)=length(rfunc1(i).sample);
    25     end
    26     data=zeros(max(ldata),length(rfunc1));
    27     data(:,:)=NaN;
    28 
    29     for i=1:length(rfunc1)
    30         desc(i)=cellstr(rfunc1(i).descriptor);
    31         data(1:ldata(i),i)=rfunc1(i).sample;
    32     end
    33 else
    34     data=varargin{ivar};
     76    desc=cell (1,length(dresp1));
     77    lsamp=zeros(1,length(dresp1));
     78    for i=1:length(dresp1)
     79        lsamp(i)=length(dresp1(i).sample);
     80    end
     81    samp=zeros(max(lsamp),length(dresp1));
     82    samp(:,:)=NaN;
     83
     84    for i=1:length(dresp1)
     85        desc(i)=cellstr(dresp1(i).descriptor);
     86        samp(1:lsamp(i),i)=dresp1(i).sample;
     87    end
     88else
     89    samp=varargin{ivar};
    3590    ivar=ivar+1;
    3691   
    37     ldata(1:size(data,2))=size(data,1);
     92    lsamp(1:size(samp,2))=size(samp,1);
    3893
    3994    if ivar <= nargin && iscell(varargin{ivar})
     
    46101
    47102if     ivar <= nargin && isstruct(varargin{ivar})
    48     rfunc2=varargin{ivar};
    49     ivar=ivar+1;
    50 
    51     mu   =zeros(1,length(rfunc2));
    52     sigma=zeros(1,length(rfunc2));
    53 
    54     for i=1:length(rfunc2)
    55         mu   (i)=rfunc2(i).mean;
    56         sigma(i)=rfunc2(i).stddev;
     103    dresp2=varargin{ivar};
     104    ivar=ivar+1;
     105
     106    mu   =zeros(1,length(dresp2));
     107    sigma=zeros(1,length(dresp2));
     108
     109    for i=1:length(dresp2)
     110        mu   (i)=dresp2(i).mean;
     111        sigma(i)=dresp2(i).stddev;
    57112    end
    58113elseif ivar+1 <= nargin
     
    61116            mu   =varargin{ivar};
    62117        else
    63             mu   =mean(data);
     118            mu   =mean(samp);
    64119            display('Using calculated means.')
    65120        end
     
    70125            sigma=varargin{ivar};
    71126        else
    72             sigma=std(data);
     127            sigma=std(samp);
    73128            display('Using calculated standard deviations.')
    74129        end
     
    82137    hmin=varargin{ivar};
    83138else
    84     hmin=min(min(data));
     139    hmin=min(min(samp));
    85140end
    86141ivar=ivar+1;
     
    88143    hmax=varargin{ivar};
    89144else
    90     hmax=max(max(data));
     145    hmax=max(max(samp));
    91146end
    92147ivar=ivar+1;
     
    107162%  Use -inf and inf in edges to include all non-NaN values.
    108163
    109 dhistc=histc(data,edges);
    110 for i=1:size(data,2)
    111     dbelow(i)  =length(find(data(:,i)<edges(  1)))/ldata(i);
    112     dhistc(:,i)=dhistc(:,i)                       /ldata(i);
    113     dabove(i)  =length(find(data(:,i)>edges(end)))/ldata(i);
     164dhistc=histc(samp,edges);
     165for i=1:size(samp,2)
     166    dbelow(i)  =length(find(samp(:,i)<edges(  1)))/lsamp(i);
     167    dhistc(:,i)=dhistc(:,i)                       /lsamp(i);
     168    dabove(i)  =length(find(samp(:,i)>edges(end)))/lsamp(i);
    114169end
    115170
    116171if exist('mu','var') && exist('sigma','var')
    117     ncol=size(data,2);
     172    ncol=size(samp,2);
    118173    for i=1:ncol
    119174        dbelow(ncol+i)=normcdf(edges(  1),mu(i),sigma(i));
     
    135190%  add the annotation
    136191
    137 title('Relative Frequency Histogram')
    138 xlabel('Interval Edge Value')
    139 ylabel('Relative Frequency')
     192if isnans(options_structure.title),
     193        options_structure.title='Relative Frequency Histogram';
     194end
     195if isnans(options_structure.xlabel),
     196        options_structure.xlabel='Interval Edge Value';
     197end
     198if isnans(options_structure.ylabel),
     199        options_structure.ylabel='Relative Frequency';
     200end
    140201
    141202if exist('desc','var')
     
    163224    end
    164225end
    165 
    166226
    167227%  draw the line plot
     
    207267%hold off
    208268
    209 end
     269if isnan(options_structure.colorbar)
     270        options_structure.colorbar=0;
     271end
     272
     273applyoptions(md,[],options_structure);
  • issm/trunk/src/m/classes/public/plot/plotdoc.m

    r2049 r2242  
    4343disp('                  - ''thermaltransient_results'': this will display all the time steps of a thermal transient run');
    4444disp('                  - ''normplot'': norm plot');
    45 disp('                  - ''histnorm'': histogram normal distribution');
     45disp('                  - ''histnorm'': histogram normal distribution. needs option histnorm_data');
    4646
    4747answer = lower(input(['more?(y/n) \n'],'s'));
     
    101101disp('       ''scaleruler'': add a scale ruler, ''on'' for default value or [x0 y0 length width numberofticks] where (x0,y0) are the coordinates of the lower left corner');
    102102disp('       ''wrapping'': repeat ''n'' times the colormap (''n'' must be an integer)');
    103 disp(' ');
     103disp('       ''histnorm_data'': data for histnorm plot.');
     104disp('                  {dresp1   ,dresp2  ,hmin,hmax,hnint} or {samp,desc,mu,sigma,hmin,hmax,hnint}');
     105disp('                  where dresp1 is a structure array of responses (where we need samp and desc), ');
     106disp('                  dresp2 is a structure array of responses (where we only need mu and sigma)');
     107disp('                  hmin,hmax and hnint are the minimum, maximum and number of intervals of the histogram (optional)');
    104108disp('       any options (except ''data'') can be followed by ''#i'' where ''i'' is the subplot number, or ''#all'' if applied to all plots');
    105109disp('  ');
  • issm/trunk/src/m/utils/Math/isnans.m

    r1712 r2242  
    99if isstruct(array),
    1010        returnvalue=0;
     11elseif iscell(array)
     12        returnvalue=0;
    1113else
    1214        returnvalue=isnan(array);
Note: See TracChangeset for help on using the changeset viewer.