Index: /issm/trunk/src/m/classes/@model/setdefaultparameters.m
===================================================================
--- /issm/trunk/src/m/classes/@model/setdefaultparameters.m	(revision 6037)
+++ /issm/trunk/src/m/classes/@model/setdefaultparameters.m	(revision 6038)
@@ -237,6 +237,5 @@
 %set petsc options for different analysis
 md.petscoptions=petscoptions;
-%md.petscoptions=addoptions(md.petscoptions,DiagnosticHorizAnalysisEnum,asmoptions);
-%md.petscoptions=addoptions(md.petscoptions,DiagnosticVertAnalysisEnum,mumpsoptions);
+md.petscoptions=addoptions(md.petscoptions,DiagnosticVertAnalysisEnum,mumpsoptions);
 
 %solution speed-up
Index: /issm/trunk/src/m/classes/@runsteps/savemodel.m
===================================================================
--- /issm/trunk/src/m/classes/@runsteps/savemodel.m	(revision 6037)
+++ /issm/trunk/src/m/classes/@runsteps/savemodel.m	(revision 6038)
@@ -45,4 +45,4 @@
 end
 
-save(name,'md');
+save(name,'md','-v7.3');
 disp(['model saved as: ' name]);
Index: sm/trunk/src/m/clusters/QueueRequirements.m
===================================================================
--- /issm/trunk/src/m/clusters/QueueRequirements.m	(revision 6037)
+++ 	(revision )
@@ -1,36 +1,0 @@
-function QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,queue,np,time)
-%QUEUEREQUIREMENTS queue requirements in time, number of cpus, by name of queue.
-%
-%
-% Usage: QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,np,time)
-%
-
-%Ok, go through requirements for current queue:
-index=ismemberi(queue,available_queues);
-if  ~index,
-	%ok, either we a generic cluster, with 'none' queue, or we could not find the queue reqruirements
-	if strcmpi(available_queues{1},'none'),
-		%reset index to 1, so we can fish the requirements
-		index=1;
-	else
-		string=available_queues{1};
-		for i=2:length(available_queues),
-			string=[string ' ' available_queues{i}];
-		end
-		error(['QueueRequirements error message: availables queues are ' string]);
-	end
-end
-
-%check on time requirements
-rtime=queue_requirements_time(index);
-if time<=0,
-	error('QueueRequirements: time should be a positive number');
-end
-if time>rtime,
-	error(['QueueRequirements: time should be < ' num2str(rtime) ' for queue: ' queue]);
-end
-
-%check on np requirements
-if np<=0,
-	error('QueueRequirements: np should be a positive number');
-end
Index: /issm/trunk/src/m/clusters/astrid.m
===================================================================
--- /issm/trunk/src/m/clusters/astrid.m	(revision 6037)
+++ /issm/trunk/src/m/clusters/astrid.m	(revision 6038)
@@ -77,6 +77,26 @@
 		 end
 		 %}}}
-		 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
-			 command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
+		 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']});
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
 		 end
 		 %}}}
Index: /issm/trunk/src/m/clusters/castor.m
===================================================================
--- /issm/trunk/src/m/clusters/castor.m	(revision 6037)
+++ /issm/trunk/src/m/clusters/castor.m	(revision 6038)
@@ -80,6 +80,26 @@
 		 end
 		 %}}}
-		 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
-			 command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
+		 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']});
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
 		 end
 		 %}}}
Index: /issm/trunk/src/m/clusters/cosmos.m
===================================================================
--- /issm/trunk/src/m/clusters/cosmos.m	(revision 6037)
+++ /issm/trunk/src/m/clusters/cosmos.m	(revision 6038)
@@ -79,6 +79,26 @@
 		 end
 		 %}}}
-		 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
-			 command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub -S/bin/sh ' modelname '.queue '];
+		 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']});
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
 		 end
 		 %}}}
Index: /issm/trunk/src/m/clusters/ericmac.m
===================================================================
--- /issm/trunk/src/m/clusters/ericmac.m	(revision 6037)
+++ /issm/trunk/src/m/clusters/ericmac.m	(revision 6038)
@@ -76,6 +76,26 @@
 		 end
 		 %}}}
-		 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
-			 command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
+		 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']});
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
 		 end
 		 %}}}
Index: /issm/trunk/src/m/clusters/gemini.m
===================================================================
--- /issm/trunk/src/m/clusters/gemini.m	(revision 6037)
+++ /issm/trunk/src/m/clusters/gemini.m	(revision 6038)
@@ -80,6 +80,26 @@
 		 end
 		 %}}}
-		 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
-			 command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
+		 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']});
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
 		 end
 		 %}}}
Index: /issm/trunk/src/m/clusters/larsen.m
===================================================================
--- /issm/trunk/src/m/clusters/larsen.m	(revision 6037)
+++ /issm/trunk/src/m/clusters/larsen.m	(revision 6038)
@@ -76,6 +76,26 @@
 		 end
 		 %}}}
-		 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
-			 command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
+		 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']});
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
 		 end
 		 %}}}
Index: /issm/trunk/src/m/clusters/pfe.m
===================================================================
--- /issm/trunk/src/m/clusters/pfe.m	(revision 6037)
+++ /issm/trunk/src/m/clusters/pfe.m	(revision 6038)
@@ -19,4 +19,5 @@
 		 codepath='/staff/elarour/trunk/bin';
 		 executionpath='/nobackupp10/elarour/Testing';
+		 interactive=0;
 	 end
 	 properties (SetAccess=private) 
@@ -110,8 +111,57 @@
 			 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 command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
-			 command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
+		 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 ' modelname '.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(md.cluster.name,md.cluster.executionpath,md.cluster.login,md.cluster.port,{[md.runtimename '.tar.gz']});
+				else
+					issmscpout(md.cluster.name,[md.cluster.executionpath '/Interactive'],md.cluster.login,md.cluster.port,{[md.runtimename '.tar.gz']});
+				end
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(md.cluster.name,md.cluster.login,md.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
 		 %}}}
Index: /issm/trunk/src/m/clusters/pollux.m
===================================================================
--- /issm/trunk/src/m/clusters/pollux.m	(revision 6037)
+++ /issm/trunk/src/m/clusters/pollux.m	(revision 6038)
@@ -80,6 +80,26 @@
 		 end
 		 %}}}
-		 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
-			 command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
+		 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']});
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
 		 end
 		 %}}}
Index: /issm/trunk/src/m/clusters/wilkes.m
===================================================================
--- /issm/trunk/src/m/clusters/wilkes.m	(revision 6037)
+++ /issm/trunk/src/m/clusters/wilkes.m	(revision 6038)
@@ -76,6 +76,26 @@
 		 end
 		 %}}}
-		 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
-			 command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
+		 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']});
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+
 		 end
 		 %}}}
Index: sm/trunk/src/m/model/LaunchQueueJob.m
===================================================================
--- /issm/trunk/src/m/model/LaunchQueueJob.m	(revision 6037)
+++ 	(revision )
@@ -1,40 +1,0 @@
-function LaunchQueueJob(md,options)
-%LAUNCHQUEUEJOB- Launch job on cluster
-%
-%   Usage:
-%      LaunchQueueJob(model,options)
-
-%first, check we have the binary file and the queueing script
-if ~exist([ md.name '.bin'],'file'),
-	error('LaunchQueueJobcosmos error message: Binary input file missing, cannot go forward');
-end
-
-if ~exist([ md.name '.queue'],'file'),
-	error('LaunchQueueJobcosmos error message: queueing script missing, cannot go forward');
-end
-
-if md.qmu_analysis & ~exist([ md.name '.qmu.in'],'file'),
-	error('LaunchQueueJobcosmos error message: missing dakota input file, cannot go forward');
-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
-	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']});
-
-	if strcmpi(options.upload,'off'),
-		disp('launching solution sequence on remote cluster');
-		issmssh(md.cluster.name,md.cluster.login,md.cluster.port,LaunchCommand(md.cluster,md.runtimename,md.name));
-	end
-
-else
-	disp('batch mode requested: not launching job interactively');
-	disp('launch solution sequence on remote cluster by hand');
-end
Index: /issm/trunk/src/m/model/solveparallel.m
===================================================================
--- /issm/trunk/src/m/model/solveparallel.m	(revision 6037)
+++ /issm/trunk/src/m/model/solveparallel.m	(revision 6038)
@@ -5,8 +5,10 @@
 %      md=solveparallel(md);
 
+%retrieve cluster: otherwise, we can't call its methods (subsref bug)
+cluster=md.cluster;
+
 %First, build a runtime name that is unique, that we will use to create 
 %directories, name jobs, etc ...
-c=clock;
-md.runtimename=sprintf('%s-%i-%i-%i-%i-%i-%i-%i',md.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),GetPId());
+c=clock; md.runtimename=sprintf('%s-%i-%i-%i-%i-%i-%i-%i',md.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),GetPId());
 
 %Marshall model data into a binary file.
@@ -19,8 +21,8 @@
 
 %Now, we need to build the queuing script, used by the cluster to launch the job.
-BuildQueueScript(md.cluster,md.name,md.analysis_type,md.mem_debug);
+cluster.BuildQueueScript(md.name,md.analysis_type,md.mem_debug);
 
 %Now, launch the queueing script
-LaunchQueueJob(md,options);
+cluster.LaunchQueueJob(md,options);
 
 if ~strcmpi(options.upload,'on'), %did we even try to run? if so, wait on lock
@@ -44,5 +46,5 @@
 		system(['rm -rf qmu' num2str(GetPId)]);
 	end
+else
+	error('solveparallel done uploading test decks');
 end
-
-
Index: /issm/trunk/src/m/utils/Cluster/QueueRequirements.m
===================================================================
--- /issm/trunk/src/m/utils/Cluster/QueueRequirements.m	(revision 6038)
+++ /issm/trunk/src/m/utils/Cluster/QueueRequirements.m	(revision 6038)
@@ -0,0 +1,36 @@
+function QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,queue,np,time)
+%QUEUEREQUIREMENTS queue requirements in time, number of cpus, by name of queue.
+%
+%
+% Usage: QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,np,time)
+%
+
+%Ok, go through requirements for current queue:
+index=ismemberi(queue,available_queues);
+if  ~index,
+	%ok, either we a generic cluster, with 'none' queue, or we could not find the queue reqruirements
+	if strcmpi(available_queues{1},'none'),
+		%reset index to 1, so we can fish the requirements
+		index=1;
+	else
+		string=available_queues{1};
+		for i=2:length(available_queues),
+			string=[string ' ' available_queues{i}];
+		end
+		error(['QueueRequirements error message: availables queues are ' string]);
+	end
+end
+
+%check on time requirements
+rtime=queue_requirements_time(index);
+if time<=0,
+	error('QueueRequirements: time should be a positive number');
+end
+if time>rtime,
+	error(['QueueRequirements: time should be < ' num2str(rtime) ' for queue: ' queue]);
+end
+
+%check on np requirements
+if np<=0,
+	error('QueueRequirements: np should be a positive number');
+end
