Changeset 2242
- Timestamp:
- 09/15/09 16:01:54 (16 years ago)
- Location:
- issm/trunk
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/etc/cluster.rc
r2188 r2242 23 23 24 24 cluster_name=cosmos 25 cluster_codepath=/ home/larour/tier2_ice/cluster_delivery26 cluster_executionpath=/ scratch/larour/Testing/AGU_200825 cluster_codepath=/work00/edw/larour/issm-2.0/bin 26 cluster_executionpath=/work00/edw/larour/Execution 27 27 28 28 cluster_name=mustang -
issm/trunk/src/c/parallel/steadystate_core.cpp
r2008 r2242 78 78 for(;;){ 79 79 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); 81 81 82 82 //first compute temperature at steady state. -
issm/trunk/src/m/classes/public/BuildQueueingScriptcosmos.m
r465 r2242 1 1 function 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 - ... 16 3 % 17 4 % Usage: … … 22 9 fid=fopen(scriptname,'w'); 23 10 if fid==-1, 24 error(['BuildQueueingScriptcosmos error message: could not open ' scriptname ' file for ascii writing']);11 error(['BuildQueueingScriptcosmos error message: could not open ' scriptname ' file for ascii writing']); 25 12 end 26 13 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: 15 available_queues={'debug','shortq','longq','specialq'}; 16 if ~ismemberi(md.queue,available_queues), 17 error('BuildQueueingScriptcosmos error message: availables queues are debug, shortq, longq and specialq'); 31 18 end 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: 21 if 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 39 28 end 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 e rror('BuildQueueingScriptcosmos error message: unsupported solution type!');29 30 if 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 48 37 end 38 39 if 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 46 end 47 48 if strcmpi(md.queue,'specialq'), 49 if md.np>10, 50 error('BuildQueueingScriptcosmos error message: longq queue only allows 10 cpus'); 51 end 52 end 53 54 55 56 fprintf(fid,'#!/bin/csh\n'); 57 fprintf(fid,'#PBS -l select=%i:ncpus=1\n',md.np); 58 fprintf(fid,'#PBS -l walltime=%i\n',md.time*60); %walltime is in seconds. 59 if ~isempty(md.queue), 60 fprintf(fid,'#PBS -q %s\n',md.queue); 61 end 62 fprintf(fid,'#PBS -o %s.outlog \n',md.name); 63 fprintf(fid,'#PBS -e %s.errlog \n',md.name); 64 65 fprintf(fid,'setenv PBS_O_WORKDIR %s\n',executionpath); 66 fprintf(fid,'cd $PBS_O_WORKDIR\n'); 67 fprintf(fid,'setenv OMP_NUM_THREADS 1\n'); 68 fprintf(fid,'limit stacksize unlimited\n'); 69 fprintf(fid,'limit coredumpsize 0\n'); 70 fprintf(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); 49 71 fclose(fid); -
issm/trunk/src/m/classes/public/BuildQueueingScriptgemini.m
r2215 r2242 24 24 fprintf(fid,'cd $PBS_O_WORKDIR\n'); 25 25 fprintf(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);26 fprintf(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); 27 27 28 28 fclose(fid); -
issm/trunk/src/m/classes/public/LaunchQueueJobcosmos.m
r1268 r2242 1 1 function md=LaunchQueueJobcosmos(md,executionpath,options) 2 %LAUNCHQUEUEJOB COSMOS- ...2 %LAUNCHQUEUEJOBGEMINI - ... 3 3 % 4 4 % Usage: … … 14 14 end 15 15 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 17 if ~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 24 else 25 disp('batch mode requested: not launching job interactively'); 25 26 end 26 27 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 29 disp(['launch solution sequence on remote cluster by logging into it and typing qsub < ' md.name '.queue']); 30 md.waitonlock=0; -
issm/trunk/src/m/classes/public/plot/parse_options.m
r1878 r2242 670 670 end 671 671 672 %histnorm_data 673 histnorm_data=findarg(optionstring,'histnorm_data'); 674 if ~isempty(histnorm_data), 675 options_struct.histnorm_data=histnorm_data.value; 676 else 677 options_struct.histnorm_data=NaN; 678 end 672 679 673 680 %designvariable -
issm/trunk/src/m/classes/public/plot/plot_manager.m
r2188 r2242 30 30 plot_segmentnumbering(md,options_structure,width,i); 31 31 return; 32 case 'normplot',33 plot_qmunormplot(md.dakotaresults.dresp_dat,width,i);34 return;35 32 case 'histnorm', 36 plot_qmuhistnorm(md .dakotaresults.dresp_dat);33 plot_qmuhistnorm(md,options_structure,width,i); 37 34 return; 38 35 case 'elements_type', -
issm/trunk/src/m/classes/public/plot/plot_qmuhistnorm.m
r345 r2242 1 1 % 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 59 function plot_qmuhistnorm(md,options_structure,width,i); 60 61 %recover histnorm data 62 if isnans(options_structure.histnorm_data) 63 error('plot_qmuhistnorm error message: option histnorm_data is required'); 64 else 65 varargin=options_structure.histnorm_data; 66 end 67 68 nargin=length(varargin); 13 69 14 70 %% process input data and assemble into matrices as needed 15 16 71 ivar=1; 17 72 if isstruct(varargin{ivar}) 18 rfunc1=varargin{ivar};73 dresp1=varargin{ivar}; 19 74 ivar=ivar+1; 20 75 21 desc=cell (1,length( rfunc1));22 l data=zeros(1,length(rfunc1));23 for i=1:length( rfunc1)24 l data(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 88 else 89 samp=varargin{ivar}; 35 90 ivar=ivar+1; 36 91 37 l data(1:size(data,2))=size(data,1);92 lsamp(1:size(samp,2))=size(samp,1); 38 93 39 94 if ivar <= nargin && iscell(varargin{ivar}) … … 46 101 47 102 if 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; 57 112 end 58 113 elseif ivar+1 <= nargin … … 61 116 mu =varargin{ivar}; 62 117 else 63 mu =mean( data);118 mu =mean(samp); 64 119 display('Using calculated means.') 65 120 end … … 70 125 sigma=varargin{ivar}; 71 126 else 72 sigma=std( data);127 sigma=std(samp); 73 128 display('Using calculated standard deviations.') 74 129 end … … 82 137 hmin=varargin{ivar}; 83 138 else 84 hmin=min(min( data));139 hmin=min(min(samp)); 85 140 end 86 141 ivar=ivar+1; … … 88 143 hmax=varargin{ivar}; 89 144 else 90 hmax=max(max( data));145 hmax=max(max(samp)); 91 146 end 92 147 ivar=ivar+1; … … 107 162 % Use -inf and inf in edges to include all non-NaN values. 108 163 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) /l data(i);113 dabove(i) =length(find( data(:,i)>edges(end)))/ldata(i);164 dhistc=histc(samp,edges); 165 for 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); 114 169 end 115 170 116 171 if exist('mu','var') && exist('sigma','var') 117 ncol=size( data,2);172 ncol=size(samp,2); 118 173 for i=1:ncol 119 174 dbelow(ncol+i)=normcdf(edges( 1),mu(i),sigma(i)); … … 135 190 % add the annotation 136 191 137 title('Relative Frequency Histogram') 138 xlabel('Interval Edge Value') 139 ylabel('Relative Frequency') 192 if isnans(options_structure.title), 193 options_structure.title='Relative Frequency Histogram'; 194 end 195 if isnans(options_structure.xlabel), 196 options_structure.xlabel='Interval Edge Value'; 197 end 198 if isnans(options_structure.ylabel), 199 options_structure.ylabel='Relative Frequency'; 200 end 140 201 141 202 if exist('desc','var') … … 163 224 end 164 225 end 165 166 226 167 227 % draw the line plot … … 207 267 %hold off 208 268 209 end 269 if isnan(options_structure.colorbar) 270 options_structure.colorbar=0; 271 end 272 273 applyoptions(md,[],options_structure); -
issm/trunk/src/m/classes/public/plot/plotdoc.m
r2049 r2242 43 43 disp(' - ''thermaltransient_results'': this will display all the time steps of a thermal transient run'); 44 44 disp(' - ''normplot'': norm plot'); 45 disp(' - ''histnorm'': histogram normal distribution ');45 disp(' - ''histnorm'': histogram normal distribution. needs option histnorm_data'); 46 46 47 47 answer = lower(input(['more?(y/n) \n'],'s')); … … 101 101 disp(' ''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'); 102 102 disp(' ''wrapping'': repeat ''n'' times the colormap (''n'' must be an integer)'); 103 disp(' '); 103 disp(' ''histnorm_data'': data for histnorm plot.'); 104 disp(' {dresp1 ,dresp2 ,hmin,hmax,hnint} or {samp,desc,mu,sigma,hmin,hmax,hnint}'); 105 disp(' where dresp1 is a structure array of responses (where we need samp and desc), '); 106 disp(' dresp2 is a structure array of responses (where we only need mu and sigma)'); 107 disp(' hmin,hmax and hnint are the minimum, maximum and number of intervals of the histogram (optional)'); 104 108 disp(' any options (except ''data'') can be followed by ''#i'' where ''i'' is the subplot number, or ''#all'' if applied to all plots'); 105 109 disp(' '); -
issm/trunk/src/m/utils/Math/isnans.m
r1712 r2242 9 9 if isstruct(array), 10 10 returnvalue=0; 11 elseif iscell(array) 12 returnvalue=0; 11 13 else 12 14 returnvalue=isnan(array);
Note:
See TracChangeset
for help on using the changeset viewer.