Index: /issm/trunk/src/m/classes/clusters/README
===================================================================
--- /issm/trunk/src/m/classes/clusters/README	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/README	(revision 6074)
@@ -0,0 +1,12 @@
+This directory holds classes corresponding to every cluster 
+that can be used. 
+
+Why classes? 
+Because handling the specificity of every cluster is hard in a general 
+code. Having classes with generic methods, such as: BuildQueueScript, 
+LaunchQueueJob,  and internal data corresponding to every cluster's specificity 
+is much more manageable and powerful.
+
+How to add your cluster? 
+use an existing cluster script, such as pleiades.m, and rename it to your cluster name.
+update the methods.
Index: /issm/trunk/src/m/classes/clusters/astrid.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/astrid.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/astrid.m	(revision 6074)
@@ -0,0 +1,133 @@
+%ASTRID class definition
+%
+%   Usage:
+%      cluster=astrid();
+%      cluster=astrid('np',3);
+%      cluster=astrid('np',3,'login','username');
+
+classdef astrid
+    properties (SetAccess=public) 
+		 % {{{1
+		 name='astrid';
+		 login='larour';
+		 np=15;
+		 port=0;
+		 codepath=[issmdir() '/bin'];
+		 executionpath=[issmdir() '/../execution'];
+		 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
+		 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
+		 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
+
+		 %}}}
+	 end
+	 methods
+		 function cluster=astrid(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(astrid)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster astrid']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    np: %i',cluster.np));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+			 disp(sprintf('    valgrind: %s',cluster.valgrind));
+			 disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
+			 disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+			 if cluster.np>16,
+				 error('IsConsistent error message: number of processors should be lest than 16!');
+			 end
+			 if isnan(cluster.np),
+				 error('IsConsistent error message: number of processors should not be NaN!');
+			 end
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 %write instructions for launching a job on the cluster
+			 fprintf(fid,'#!/bin/sh\n');
+			 if mem_debug==0,
+				 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+			 else
+				 %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+				 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+			 end
+
+			 %close file
+			 fclose(fid);
+
+		 end
+		 %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
+			                ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && source  ' md.name '.queue '];
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
+				if md.qmu_analysis,
+					compressstring=[compressstring md.name '.qmu.in'];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.runtimename '.tar.gz']});
+
+				disp('launching solution sequence on remote cluster');
+				issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
+		 end %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.runtimename),
+				error('pfe Download error message: supply runtime name for results to be loaded!');
+			end
+
+			%Figure out the  directory where all the files are in: 
+			directory=[cluster.executionpath '/' md.runtimename '/'];
+
+			%What packages are we picking up from remote cluster
+			packages={[md.name '.outlog'],[md.name '.errlog']};
+			if md.qmu_analysis,
+				packages{end+1}=[md.name '.qmu.err'];
+				packages{end+1}=[md.name '.qmu.out'];
+				if isfield(md.qmu_params,'tabular_graphics_data'),
+					if md.qmu_params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/castor.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/castor.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/castor.m	(revision 6074)
@@ -0,0 +1,138 @@
+%CASTOR class definition
+%
+%   Usage:
+%      cluster=castor();
+%      cluster=castor('np',3);
+%      cluster=castor('np',3,'login','username');
+
+classdef castor
+    properties (SetAccess=public) 
+		 % {{{1
+		 name='castor'
+		 login='larour';
+		 np   =128; %number of processors
+		 port=0;
+		 queue='shortc';
+		 time=180;
+		 codepath='/workp/edw/larour/issm-2.0/bin'
+		 executionpath='/workp/edw/larour/Testing/Execution'
+		 %}}}
+	 end
+	 methods
+		 function cluster=castor(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(castor)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster castor']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    np: %i',cluster.np));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    queue: %s',cluster.queue));
+			 disp(sprintf('    time: %i',cluster.time));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+
+			 available_queues={'shortc','longc'};
+			 queue_requirements_time=[180 720];
+			 queue_requirements_np=[128 128];
+
+			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 fprintf(fid,'#!/bin/sh\n');
+			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			 fprintf(fid,'#PBS -N %s\n',modelname);
+			 fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
+			 if ~isempty(queue),
+				 fprintf(fid,'#PBS -q %s\n',cluster.queue);
+			 end
+			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+
+			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
+			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
+			 fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',cluster.np-1,cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname);
+
+			 %close file
+			 fclose(fid);
+
+		 end
+		 %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
+			                ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && qsub ' modelname '.queue '];
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
+				if md.qmu_analysis,
+					compressstring=[compressstring md.name '.qmu.in'];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				issmscpout(md.cluster.name,md.cluster.executionpath,md.cluster.login,md.cluster.port,{[md.runtimename '.tar.gz']});
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(md.cluster.name,md.cluster.login,md.cluster.port,launchcommand);
+
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
+		 end
+		 %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.runtimename),
+				error('pfe Download error message: supply runtime name for results to be loaded!');
+			end
+
+			%Figure out the  directory where all the files are in: 
+			directory=[cluster.executionpath '/' md.runtimename '/'];
+
+			%What packages are we picking up from remote cluster
+			packages={[md.name '.outlog'],[md.name '.errlog']};
+			if md.qmu_analysis,
+				packages{end+1}=[md.name '.qmu.err'];
+				packages{end+1}=[md.name '.qmu.out'];
+				if isfield(md.qmu_params,'tabular_graphics_data'),
+					if md.qmu_params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/cosmos.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/cosmos.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/cosmos.m	(revision 6074)
@@ -0,0 +1,137 @@
+%COSMOS class definition
+%
+%   Usage:
+%      cluster=cosmos();
+%      cluster=cosmos('np',3);
+%      cluster=cosmos('np',3,'login','username');
+
+classdef cosmos
+    properties (SetAccess=public) 
+		 % {{{1
+		 name='cosmos'
+		 login='larour';
+		 np=128;
+		 port=0;
+		 queue='shortq';
+		 time=3*60;
+		 codepath='/work00/edw/larour/issm-2.0/bin';
+		 executionpath='/work00/edw/larour/Execution';
+		 %}}}
+	 end
+	 methods
+		 function cluster=cosmos(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(cosmos)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster cosmos']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    np: %i',cluster.np));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    queue: %s',cluster.queue));
+			 disp(sprintf('    time: %i',cluster.time));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+
+			 available_queues={'debug','shortq','longq'};
+			 queue_requirements_time=[60*1 60*3 60*17];
+			 queue_requirements_np=[32 128 256];
+
+			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 fprintf(fid,'#!/bin/bash\n');
+			 fprintf(fid,'#PBS -l select=%i:ncpus=1\n',cluster.np);
+			 fprintf(fid,'#PBS -N %s\n',modelname);
+			 fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
+			 fprintf(fid,'#PBS -q %s\n',queue);
+			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
+			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
+			 fprintf(fid,'ulimit -s unlimited\n');
+			 fprintf(fid,'ulimit -c 0\n');
+			 fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname);
+
+			 %close file
+			 fclose(fid);
+
+		 end
+		 %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
+			                ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && qsub -S/bin/sh ' modelname '.queue '];
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
+				if md.qmu_analysis,
+					compressstring=[compressstring md.name '.qmu.in'];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				issmscpout(md.cluster.name,md.cluster.executionpath,md.cluster.login,md.cluster.port,{[md.runtimename '.tar.gz']});
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(md.cluster.name,md.cluster.login,md.cluster.port,launchcommand);
+
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
+		 end
+		 %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.runtimename),
+				error('pfe Download error message: supply runtime name for results to be loaded!');
+			end
+
+			%Figure out the  directory where all the files are in: 
+			directory=[cluster.executionpath '/' md.runtimename '/'];
+
+			%What packages are we picking up from remote cluster
+			packages={[md.name '.outlog'],[md.name '.errlog']};
+			if md.qmu_analysis,
+				packages{end+1}=[md.name '.qmu.err'];
+				packages{end+1}=[md.name '.qmu.out'];
+				if isfield(md.qmu_params,'tabular_graphics_data'),
+					if md.qmu_params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/ericmac.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/ericmac.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/ericmac.m	(revision 6074)
@@ -0,0 +1,134 @@
+%ERICMAC class definition
+%
+%   Usage:
+%      cluster=ericmac();
+%      cluster=ericmac('np',3);
+%      cluster=ericmac('np',3,'login','username');
+
+classdef ericmac
+    properties (SetAccess=public) 
+		 % {{{1
+		 name='ericmac'
+		 login='larour';
+		 np=3;
+		 port=0;
+		 codepath=[issmdir() '/bin'];
+		 executionpath=[issmdir() '/../execution'];
+		 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
+		 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
+		 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
+		 %}}}
+    end
+    methods
+		 function cluster=ericmac(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(ericmac)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster ericmac']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    np: %i',cluster.np));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+			 disp(sprintf('    valgrind: %s',cluster.valgrind));
+			 disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
+			 disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+			 if cluster.np>4,
+				 error('IsConsistent error message: number of processors should be lest than 16!');
+			 end
+			 if isnan(cluster.np),
+				 error('IsConsistent error message: number of processors should not be NaN!');
+			 end
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 %write instructions for launching a job on the cluster
+			 fprintf(fid,'#!/bin/sh\n');
+			 if mem_debug==0,
+				 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+			 else
+				 %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+				 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+			 end
+
+			 %close file
+			 fclose(fid);
+
+		 end
+		 %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
+			                ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && source  ' md.name '.queue '];
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
+				if md.qmu_analysis,
+					compressstring=[compressstring md.name '.qmu.in'];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				issmscpout(md.cluster.name,md.cluster.executionpath,md.cluster.login,md.cluster.port,{[md.runtimename '.tar.gz']});
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(md.cluster.name,md.cluster.login,md.cluster.port,launchcommand);
+
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
+		 end
+		 %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.runtimename),
+				error('pfe Download error message: supply runtime name for results to be loaded!');
+			end
+
+			%Figure out the  directory where all the files are in: 
+			directory=[cluster.executionpath '/' md.runtimename '/'];
+
+			%What packages are we picking up from remote cluster
+			packages={[md.name '.outlog'],[md.name '.errlog']};
+			if md.qmu_analysis,
+				packages{end+1}=[md.name '.qmu.err'];
+				packages{end+1}=[md.name '.qmu.out'];
+				if isfield(md.qmu_params,'tabular_graphics_data'),
+					if md.qmu_params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/gemini.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/gemini.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/gemini.m	(revision 6074)
@@ -0,0 +1,138 @@
+%GEMINI class definition
+%
+%   Usage:
+%      cluster=gemini();
+%      cluster=gemini('np',3);
+%      cluster=gemini('np',3,'login','username');
+
+classdef gemini
+    properties (SetAccess=public) 
+	% {{{1
+		name='gemini'
+		login='larour';
+		np=50;
+		port=0;
+		queue='debug';
+		time=60;
+		codepath='/workg/edw/larour/issm-2.0/bin'
+		executionpath='/workg/edw/larour/Testing/Execution'
+	%}}}
+    end
+    methods
+		 function cluster=gemini(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(gemini)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster gemini']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    np: %i',cluster.np));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    queue: %s',cluster.queue));
+			 disp(sprintf('    time: %i',cluster.time));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+
+			 available_queues={'debug','shortg','longg'};
+			 queue_requirements_time=[60 180 720];
+			 queue_requirements_np=[50 50 50];
+
+			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 fprintf(fid,'#!/bin/sh\n');
+			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			 fprintf(fid,'#PBS -N %s\n',modelname);
+			 fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
+			 if ~isempty(queue),
+				 fprintf(fid,'#PBS -q %s\n',cluster.queue);
+			 end
+			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+
+			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
+			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
+			 fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',cluster.np-1,cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname);
+
+			 %close file
+			 fclose(fid);
+
+		 end
+		 %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
+			                ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && qsub ' modelname '.queue '];
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
+				if md.qmu_analysis,
+					compressstring=[compressstring md.name '.qmu.in'];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				issmscpout(md.cluster.name,md.cluster.executionpath,md.cluster.login,md.cluster.port,{[md.runtimename '.tar.gz']});
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(md.cluster.name,md.cluster.login,md.cluster.port,launchcommand);
+
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
+		 end
+		 %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.runtimename),
+				error('pfe Download error message: supply runtime name for results to be loaded!');
+			end
+
+			%Figure out the  directory where all the files are in: 
+			directory=[cluster.executionpath '/' md.runtimename '/'];
+
+			%What packages are we picking up from remote cluster
+			packages={[md.name '.outlog'],[md.name '.errlog']};
+			if md.qmu_analysis,
+				packages{end+1}=[md.name '.qmu.err'];
+				packages{end+1}=[md.name '.qmu.out'];
+				if isfield(md.qmu_params,'tabular_graphics_data'),
+					if md.qmu_params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/larsen.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/larsen.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/larsen.m	(revision 6074)
@@ -0,0 +1,134 @@
+%LARSEN class definition
+%
+%   Usage:
+%      cluster=larsen();
+%      cluster=larsen('np',3);
+%      cluster=larsen('np',3,'login','username');
+
+classdef larsen
+    properties (SetAccess=public) 
+		 % {{{1
+		 name='larsen'
+		 login='larour';
+		 np=7;
+		 port=0;
+		 codepath=[issmdir() '/bin'];
+		 executionpath=[issmdir() '/../execution'];
+		 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
+		 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
+		 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
+		 %}}}
+	 end
+	 methods
+		 function cluster=larsen(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(larsen)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster larsen']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    np: %i',cluster.np));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+			 disp(sprintf('    valgrind: %s',cluster.valgrind));
+			 disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
+			 disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+			 if cluster.np>8,
+				 error('IsConsistent error message: number of processors should be lest than 16!');
+			 end
+			 if isnan(cluster.np),
+				 error('IsConsistent error message: number of processors should not be NaN!');
+			 end
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 %write instructions for launching a job on the cluster
+			 fprintf(fid,'#!/bin/sh\n');
+			 if mem_debug==0,
+				 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+			 else
+				 %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+				 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+			 end
+
+			 %close file
+			 fclose(fid);
+
+		 end
+		 %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
+			                ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && source  ' md.name '.queue '];
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
+				if md.qmu_analysis,
+					compressstring=[compressstring md.name '.qmu.in'];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				issmscpout(md.cluster.name,md.cluster.executionpath,md.cluster.login,md.cluster.port,{[md.runtimename '.tar.gz']});
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(md.cluster.name,md.cluster.login,md.cluster.port,launchcommand);
+
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
+		 end
+		 %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.runtimename),
+				error('pfe Download error message: supply runtime name for results to be loaded!');
+			end
+
+			%Figure out the  directory where all the files are in: 
+			directory=[cluster.executionpath '/' md.runtimename '/'];
+
+			%What packages are we picking up from remote cluster
+			packages={[md.name '.outlog'],[md.name '.errlog']};
+			if md.qmu_analysis,
+				packages{end+1}=[md.name '.qmu.err'];
+				packages{end+1}=[md.name '.qmu.out'];
+				if isfield(md.qmu_params,'tabular_graphics_data'),
+					if md.qmu_params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/none.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/none.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/none.m	(revision 6074)
@@ -0,0 +1,40 @@
+%NONE class definition
+%
+%   Usage:
+%      cluster=none();
+%      cluster=none('np',3);
+%      cluster=none('np',3,'login','username');
+
+classdef none
+    properties (SetAccess=public)
+		name='none'
+    end
+    methods
+		 function cluster=none(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(none)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster none']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('cluster class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+			 error('none.BuildQueueScript error message: serial cluster cannot build queue script');
+		 end
+		 %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/pfe.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/pfe.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/pfe.m	(revision 6074)
@@ -0,0 +1,201 @@
+%PFE class definition
+%
+%   Usage:
+%      cluster=pfe();
+%      cluster=pfe('np',3);
+%      cluster=pfe('np',3,'login','username');
+
+classdef pfe
+    properties (SetAccess=public)  
+		 % {{{1
+		 name='pfe'
+		 login='elarour';
+		 numnodes=20;
+		 cpuspernode=8; 
+		 port=1025;
+		 queue='long';
+		 time=12*60;
+		 processor='neh';
+		 codepath='/staff/elarour/trunk/bin';
+		 executionpath='/nobackupp10/elarour/Testing';
+		 interactive=0;
+	 end
+	 properties (SetAccess=private) 
+		 np=20*8;
+		 % }}}
+	 end
+	 methods
+		 function cluster=pfe(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(pfe)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster pfe']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+			 disp(sprintf('    queue: %s',cluster.queue));
+			 disp(sprintf('    time: %i',cluster.time));
+			 disp(sprintf('    processor: %s',cluster.processor));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+
+			 available_queues={'long'};
+			 queue_requirements_time=[7200];
+			 queue_requirements_np=[2048];
+
+			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+
+			 %now, check cluster.cpuspernode according to processor type
+			 if (strcmpi(cluster.processor,'har') | strcmpi(cluster.processor,'neh')),
+				 if ((cluster.cpuspernode>8 ) | (cluster.cpuspernode<1)),
+					 error('IsConsistent error message: cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors');
+				 end
+			 elseif strcmpi(cluster.processor,'wes'),
+				 if ((cluster.cpuspernode>12 ) | (cluster.cpuspernode<1)),
+					 error('IsConsistent error message: cpuspernode should be between 1 and 12 for ''wes'' processors');
+				 end
+			 else
+				 error('IsConsistent error message: unknown processor type, should be ''neh'',''wes'' or ''har''');
+			 end
+
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+
+			 %compute number of processors
+			 cluster.np=cluster.numnodes*cluster.cpuspernode;
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 fprintf(fid,'#PBS -S /bin/bash\n');
+			 fprintf(fid,'#PBS -N %s\n',modelname);
+			 fprintf(fid,'#PBS -l select=%i:ncpus=%i:model=%s\n',cluster.numnodes,cluster.cpuspernode,cluster.processor);
+			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			 fprintf(fid,'#PBS -W group_list=s1010\n');
+			 fprintf(fid,'#PBS -m e\n');
+			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+
+			 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
+
+			 fprintf(fid,'module load comp-intel/11.1.046\n');
+			 fprintf(fid,'module load mpi/mpt.1.25\n');
+			 fprintf(fid,'module load math/intel_mkl_64_10.0.011\n\n');
+
+			 fprintf(fid,'export PATH="$PATH:."\n\n');
+			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+
+			 fprintf(fid,'cd $PBS_O_WORKDIR\n\n');
+
+			 fprintf(fid,'mpiexec -verbose -np %i %s/issm.exe %s $PBS_O_WORKDIR %s.bin %s.petsc %s.outbin %s.lock',cluster.np,cluster.codepath,EnumToString(analysis_type),modelname,modelname,modelname,modelname);
+
+			 %close file
+			 fclose(fid);
+
+
+			 %in interactive mode, create a run file, and errlog and outlog file
+			 if cluster.interactive,
+				 fid=fopen([modelname '.run'],'w');
+				 fprintf(fid,'mpiexec -verbose -np %i %s/issm.exe %s $PBS_O_WORKDIR %s.bin %s.petsc %s.outbin %s.lock',cluster.np,cluster.codepath,EnumToString(analysis_type),modelname,modelname,modelname,modelname);
+				 fclose(fid);
+				 fid=fopen([modelname '.errlog'],'w');
+				 fclose(fid);
+				 fid=fopen([modelname '.outlog'],'w');
+				 fclose(fid);
+			 end
+		 end %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 if ~cluster.interactive, 
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
+			                ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && qsub ' md.name '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath '/Interactive && tar -zxf ' md.runtimename '.tar.gz'];
+			end
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
+				if md.qmu_analysis,
+					compressstring=[compressstring md.name '.qmu.in '];
+				end
+				if cluster.interactive,
+					compressstring=[compressstring md.name '.run ' md.name '.errlog ' md.name '.outlog '];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				if ~cluster.interactive,
+					issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.runtimename '.tar.gz']});
+				else
+					issmscpout(cluster.name,[cluster.executionpath '/Interactive'],cluster.login,cluster.port,{[md.runtimename '.tar.gz']});
+				end
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+					
+				if cluster.interactive,
+					error('done uploading files to interactive directory on remote cluster');
+				end
+
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+		 end
+		 %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.runtimename),
+				if ~cluster.interactive,
+					error('pfe Download error message: supply runtime name for results to be loaded!');
+				end
+			end
+
+			%Figure out the  directory where all the files are in: 
+			if ~cluster.interactive,
+				directory=[cluster.executionpath '/' md.runtimename '/'];
+			else
+				directory=[cluster.executionpath '/Interactive/'];
+			end
+
+			%What packages are we picking up from remote cluster
+			packages={[md.name '.outlog'],[md.name '.errlog']};
+			if md.qmu_analysis,
+				packages{end+1}=[md.name '.qmu.err'];
+				packages{end+1}=[md.name '.qmu.out'];
+				if isfield(md.qmu_params,'tabular_graphics_data'),
+					if md.qmu_params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/pollux.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/pollux.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/pollux.m	(revision 6074)
@@ -0,0 +1,138 @@
+%POLLUX class definition
+%
+%   Usage:
+%      cluster=pollux();
+%      cluster=pollux('np',3);
+%      cluster=pollux('np',3,'login','username');
+
+classdef pollux
+    properties (SetAccess=public) 
+		 % {{{1
+		 name='pollux'
+		 login='larour';
+		 np=128;
+		 port=0;
+		 queue='shortp';
+		 time=180;
+		 codepath='/workc/edw/larour/issm-2.0/bin'
+		 executionpath='/workc/edw/larour/Testing/Execution'
+		 %}}}
+	 end
+	 methods
+		 function cluster=pollux(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(pollux)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster pollux']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    np: %i',cluster.np));
+			 disp(sprintf('    queue: %s',cluster.queue));
+			 disp(sprintf('    time: %i',cluster.time));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+
+			 available_queues={'shortp','longp'};
+			 queue_requirements_time=[180 720];
+			 queue_requirements_np=[128 128];
+
+			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 fprintf(fid,'#!/bin/sh\n');
+			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			 fprintf(fid,'#PBS -N %s\n',modelname);
+			 fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
+			 if ~isempty(queue),
+				 fprintf(fid,'#PBS -q %s\n',cluster.queue);
+			 end
+			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+
+			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
+			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
+			 fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',cluster.np-1,cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname);
+
+			 %close file
+			 fclose(fid);
+
+		 end
+		 %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
+			                ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && qsub ' modelname '.queue '];
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
+				if md.qmu_analysis,
+					compressstring=[compressstring md.name '.qmu.in'];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				issmscpout(md.cluster.name,md.cluster.executionpath,md.cluster.login,md.cluster.port,{[md.runtimename '.tar.gz']});
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(md.cluster.name,md.cluster.login,md.cluster.port,launchcommand);
+
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
+		 end
+		 %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.runtimename),
+				error('pfe Download error message: supply runtime name for results to be loaded!');
+			end
+
+			%Figure out the  directory where all the files are in: 
+			directory=[cluster.executionpath '/' md.runtimename '/'];
+
+			%What packages are we picking up from remote cluster
+			packages={[md.name '.outlog'],[md.name '.errlog']};
+			if md.qmu_analysis,
+				packages{end+1}=[md.name '.qmu.err'];
+				packages{end+1}=[md.name '.qmu.out'];
+				if isfield(md.qmu_params,'tabular_graphics_data'),
+					if md.qmu_params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/wilkes.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/wilkes.m	(revision 6074)
+++ /issm/trunk/src/m/classes/clusters/wilkes.m	(revision 6074)
@@ -0,0 +1,134 @@
+%WILKES class definition
+%
+%   Usage:
+%      cluster=wilkes();
+%      cluster=wilkes('np',3);
+%      cluster=wilkes('np',3,'login','username');
+
+classdef wilkes
+    properties (SetAccess=public) 
+	% {{{1
+		name='wilkes'
+		login='larour';
+		np=7;
+		port=0;
+		codepath=[issmdir() '/bin'];
+		executionpath=[issmdir() '/../execution'];
+		valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
+		valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
+		valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
+	%}}}
+    end
+    methods
+		 function cluster=wilkes(varargin) % {{{1
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties(wilkes)),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster wilkes']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    np: %i',cluster.np));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+			 disp(sprintf('    valgrind: %s',cluster.valgrind));
+			 disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
+			 disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
+		 end
+		 %}}}
+		 function IsConsistent(cluster) % {{{1
+			 if cluster.np>8,
+				 error('IsConsistent error message: number of processors should be lest than 16!');
+			 end
+			 if isnan(cluster.np),
+				 error('IsConsistent error message: number of processors should not be NaN!');
+			 end
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 %write instructions for launching a job on the cluster
+			 fprintf(fid,'#!/bin/sh\n');
+			 if mem_debug==0,
+				 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+			 else
+				 %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+				 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
+			 end
+
+			 %close file
+			 fclose(fid);
+
+		 end
+		 %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.runtimename ' && mkdir ' md.runtimename ...
+			                ' && cd ' md.runtimename ' && mv ../' md.runtimename '.tar.gz ./ && tar -zxf ' md.runtimename '.tar.gz  && source  ' md.name '.queue '];
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '  md.name '.petsc '];
+				if md.qmu_analysis,
+					compressstring=[compressstring md.name '.qmu.in'];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				issmscpout(md.cluster.name,md.cluster.executionpath,md.cluster.login,md.cluster.port,{[md.runtimename '.tar.gz']});
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(md.cluster.name,md.cluster.login,md.cluster.port,launchcommand);
+
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
+		 end
+		 %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.runtimename),
+				error('pfe Download error message: supply runtime name for results to be loaded!');
+			end
+
+			%Figure out the  directory where all the files are in: 
+			directory=[cluster.executionpath '/' md.runtimename '/'];
+
+			%What packages are we picking up from remote cluster
+			packages={[md.name '.outlog'],[md.name '.errlog']};
+			if md.qmu_analysis,
+				packages{end+1}=[md.name '.qmu.err'];
+				packages{end+1}=[md.name '.qmu.out'];
+				if isfield(md.qmu_params,'tabular_graphics_data'),
+					if md.qmu_params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+	end
+end
