Index: /issm/trunk/src/m/model/queue/BuildMultipleQueueingScript.m
===================================================================
--- /issm/trunk/src/m/model/queue/BuildMultipleQueueingScript.m	(revision 5948)
+++ /issm/trunk/src/m/model/queue/BuildMultipleQueueingScript.m	(revision 5948)
@@ -0,0 +1,23 @@
+function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)
+%BUILDMULTIPLEQUEUEINGSCRIPT - 
+%
+%   Usage:
+%      BuildMultipleQueueingScript(executionpath,codepath)
+
+disp('building queueing script');
+
+%First try and figure out if there is a special script for this particular cluster
+function_name=['BuildMultipleQueueingScript' cluster];
+
+%some specific treatment of identical cluster, gemini, castor and pollux
+if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
+	function_name='BuildMultipleQueueingScriptgemini';
+end
+
+if exist(function_name,'file'),
+	%Call this function:
+	eval([function_name '(name,executionpath,codepath);']);
+else
+	%Call the generic BuildQueueingScript:
+	BuildMultipleQueueingScriptGeneric(name,executionpath,codepath);
+end
Index: /issm/trunk/src/m/model/queue/BuildMultipleQueueingScriptGeneric.m
===================================================================
--- /issm/trunk/src/m/model/queue/BuildMultipleQueueingScriptGeneric.m	(revision 5948)
+++ /issm/trunk/src/m/model/queue/BuildMultipleQueueingScriptGeneric.m	(revision 5948)
@@ -0,0 +1,12 @@
+function BuildMultipleQueueingScriptGeneric(name,executionpath,codepath)
+%BUILDMULTIPLEQUEUEINGSCRIPTGENERIC - ...
+%
+%   Usage:
+%      BuildMultipleQueueingScriptGeneric(executionpath,codepath)
+
+global ISSM_DIR
+
+
+%not done yet
+error('BuildMultipleQueueingScriptGenericerror message: not supported yet!');
+
Index: /issm/trunk/src/m/model/queue/BuildMultipleQueueingScriptgemini.m
===================================================================
--- /issm/trunk/src/m/model/queue/BuildMultipleQueueingScriptgemini.m	(revision 5948)
+++ /issm/trunk/src/m/model/queue/BuildMultipleQueueingScriptgemini.m	(revision 5948)
@@ -0,0 +1,23 @@
+function BuildQueueingScriptgemini(name,executionpath,codepath)
+%BUILDQUEUEINGSCRIPTGEMINI - ...
+%
+%   Usage:
+%      BuildQueueingScriptgemini(md,executionpath,codepath)
+
+scriptname=[name '.queue'];
+
+fid=fopen(scriptname,'w');
+if fid==-1,
+	error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
+end
+
+fprintf(fid,'#!/bin/sh\n');
+fprintf(fid,'cd %s\n',executionpath);
+fprintf(fid,'mkdir %s\n',name);
+fprintf(fid,'cd %s\n',name);
+fprintf(fid,'mv ../ModelList.tar.gz ./\n');
+fprintf(fid,'tar -zxvf ModelList.tar.gz\n');
+fprintf(fid,'foreach i (%s-*vs*.queue)\n',name);
+fprintf(fid,'qsub $i\n');
+fprintf(fid,'end\n');
+fclose(fid);
Index: sm/trunk/src/m/model/queue/BuildQueueingScript.m
===================================================================
--- /issm/trunk/src/m/model/queue/BuildQueueingScript.m	(revision 5947)
+++ 	(revision )
@@ -1,22 +1,0 @@
-function BuildQueueingScript(md,executionpath,codepath)
-%BUILDQUEUEINGSCRIPT - Create queueing script
-%
-%   Usage:
-%      BuildQueueingScript(md,executionpath,codepath)
-
-disp('check queue requirements');
-QueueRequirements(md.cluster,md.queue,md.np,md.time);
-
-disp('write queueing script');
-
-%open file 
-fid=fopen([md.name '.queue'],'w');
-if fid==-1,
-	error(['BuildQueueingScript error message: could not open ' [md.name '.queue'] ' file for ascii writing']);
-end
-
-%hand down to cluster specific script
-ClusterScript(fid,md.cluster,md.name,md.queue,executionpath,codepath,md.analysis_type,md.np,md.time,md.mem_debug);
-
-%close file
-fclose(fid);
Index: sm/trunk/src/m/model/queue/ClusterLaunchCommand.m
===================================================================
--- /issm/trunk/src/m/model/queue/ClusterLaunchCommand.m	(revision 5947)
+++ 	(revision )
@@ -1,22 +1,0 @@
-function command=ClusterLaunchCommand(cluster,runtimename,name,executionpath)
-%CLUSTERLAUNCHCOMMAND: build command to launch job on cluster
-%
-%    Usage: command=ClusterLaunchCommand(cluster,executionpath)
-
-
-%if cluster is current hostname, just source queue file
-if strcmpi(oshostname(),cluster),
-	command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxf ' runtimename '.tar.gz  && source  ' name '.queue '];
-elseif strcmpi(cluster,'cosmos'),
-	command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxf ' runtimename '.tar.gz  && qsub -S/bin/sh ' name '.queue '];
-elseif strcmpi(cluster,'gemini'),
-	command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxf ' runtimename '.tar.gz  && qsub ' name '.queue '];
-elseif strcmpi(cluster,'pollux'),
-	command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxf ' runtimename '.tar.gz  && qsub ' name '.queue '];
-elseif strcmpi(cluster,'castor'),
-	command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxf ' runtimename '.tar.gz  && qsub ' name '.queue '];
-elseif strcmpi(cluster,'pfe'),
-	command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxf ' runtimename '.tar.gz  && qsub ' name '.queue '];
-else
-	error('ClusterLaunchCommand error message: unknown cluster command');
-end
Index: sm/trunk/src/m/model/queue/ClusterParameters.m
===================================================================
--- /issm/trunk/src/m/model/queue/ClusterParameters.m	(revision 5947)
+++ 	(revision )
@@ -1,115 +1,0 @@
-function [cluster_codepath cluster_executionpath cluster_login cluster_port]=ClusterParameters(cluster_name,cluster_rc_location)
-%CLUSTERPARAMETERS - from cluster_name, find out cluster parameters in cluster.rc file
-%
-%   This function reads through the cluster_rc_location file  for cluster settings (name,  
-%   code location, execution directory) used to run parallel solution sequences
-%
-%   Usage:
-%      [cluster_codepath cluster_executionpath cluster_login ]=ClusterParameters(cluster_name,cluster_rc_location)
-
-lines_per_cluster=5;
-
-%open cluster.rc file
-
-fid=fopen(cluster_rc_location);
-if fid==-1,
-	error('Could not find cluster.rc file in delivery directory');
-end
-
-found=0;
-
-%Read first line and check it starts with begin. 
-line=fgetl(fid);
-if ~strcmp(line,'begin'),
-	error('cluster.rc file in delivery directory should always start with the begin statement');
-end
-
-%Read until we find the end statement. 
-while 1
-	line=fgetl(fid);
-	
-	%Check for 'end' statement
-	if strcmp(line,'end'),
-		break;
-	end 
-	%Check for end of file
-	if ~ischar(line),
-		error('cluster.rc file in delivery directory should end with an end statement');
-	end
-	%Ignore empty lines
-	if length(line)==0,
-		continue;
-	end
-	%Ignore comments
-	if strcmp(line(1),'#'),
-		continue
-	end
-
-	%Handle cluster name: 
-	if length(line)>12,
-		if strcmp(line(1:12),'cluster_name'),
-			%ok, the next 3 lines deal with one cluster settings.
-			%check if this is the cluster we are looking for.
-			splittedstring=strsplit(line,'=');
-			this_cluster_name=splittedstring{2};
-			if strcmp(this_cluster_name,cluster_name),
-
-				%Get next line for cluster code path
-				line=fgetl(fid);
-				splittedstring=strsplit(line,'=');
-				descriptor=splittedstring{1};
-				value=splittedstring{2};
-				if ~strcmp(descriptor,'cluster_codepath'),
-					error('cluster settings in cluster.rc don''t follow the correct syntax');
-				end
-				cluster_codepath=value;
-				found=1;
-				
-				
-				%Get next line for cluster execution path
-				line=fgetl(fid);
-				splittedstring=strsplit(line,'=');
-				descriptor=splittedstring{1};
-				value=splittedstring{2};
-				if ~strcmp(descriptor,'cluster_executionpath'),
-					error('cluster settings in cluster.rc don''t follow the correct syntax');
-				end
-				cluster_executionpath=value;
-
-				%Get next line for cluster loging name
-				line=fgetl(fid);
-				splittedstring=strsplit(line,'=');
-				descriptor=splittedstring{1};
-				value=splittedstring{2};
-				if ~strcmp(descriptor,'cluster_login'),
-					error('cluster settings in cluster.rc don''t follow the correct syntax');
-				end
-				cluster_login=value;
-
-				%Get next line for cluster port
-				line=fgetl(fid);
-				splittedstring=strsplit(line,'=');
-				descriptor=splittedstring{1};
-				value=splittedstring{2};
-				if ~strcmp(descriptor,'cluster_port'),
-					error('cluster settings in cluster.rc don''t follow the correct syntax');
-				end
-				cluster_port=str2num(value);
-			else
-				%Wrong cluster name, skip next lines_per_cluster lines and continue;
-				for i=1:lines_per_cluster,
-					line=fgetl(fid);
-				end
-				continue;
-			end
-		end
-	end
-end
-
-fclose(fid);
-
-if found==0,
-	error(['ClusterParameters error message: could not find setting for cluster ' cluster_name ' in cluster.rc file']);
-end
-
-end %close of function
Index: sm/trunk/src/m/model/queue/ClusterScript.m
===================================================================
--- /issm/trunk/src/m/model/queue/ClusterScript.m	(revision 5947)
+++ 	(revision )
@@ -1,94 +1,0 @@
-function ClusterScript(fid,cluster,name,queue,executionpath,codepath,analysis_type,np,time,mem_debug);
-%CLUSTERSCRIPT cluster specific queuing script
-%
-% Usage:
-%      ClusterScript(fid,name,queue,executionpath,codepath,analysis_type,np,time);
-%
-global ISSM_DIR;
-
-if strcmpi(cluster,'cosmos'), % {{{1
-
-	fprintf(fid,'#!/bin/bash\n');
-	fprintf(fid,'#PBS -l select=%i:ncpus=1\n',np);
-	fprintf(fid,'#PBS -N %s\n',name);
-	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',name);
-	fprintf(fid,'#PBS -e %s.errlog \n',name);
-	fprintf(fid,'export PBS_O_WORKDIR=%s\n',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.outbin %s.lock',np,codepath,EnumToString(analysis_type),executionpath,name,name,name);
-
-	% }}}
-elseif (strcmpi(cluster,'astrid') | strcmpi(cluster,'larsen') | strcmpi(cluster,'wilkes')), % {{{
-
-	fprintf(fid,'#!/bin/sh\n');
-	if mem_debug==0,
-		fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',np,codepath,EnumToString(analysis_type),executionpath,name,name,name,name,name);
-	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.outbin %s.lock  2> %s.errlog >%s.outlog & ',[ISSM_DIR '/externalpackages/valgrind/install/lib/libmpidebug.so'],np,[ISSM_DIR '/externalpackages/valgrind/install/bin/valgrind'],[ISSM_DIR '/externalpackages/valgrind/issm.supp'], codepath,EnumToString(analysis_type),executionpath,name,name,name,name,name);
-		fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',[ISSM_DIR '/externalpackages/valgrind/install/lib/libmpidebug.so'],np,[ISSM_DIR '/externalpackages/valgrind/install/bin/valgrind'],[ISSM_DIR '/externalpackages/valgrind/issm.supp'], codepath,EnumToString(analysis_type),executionpath,name,name,name,name,name);
-	end
-
-	% }}}
-elseif (strcmpi(cluster,'eric-mac')), %{{{
-
-	fprintf(fid,'#!/bin/sh\n');
-	if mem_debug==0,
-		fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',np,codepath,EnumToString(analysis_type),executionpath,name,name,name,name,name);
-	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.outbin %s.lock  2> %s.errlog >%s.outlog & ',[ISSM_DIR '/externalpackages/valgrind/install/lib/libmpidebug.so'],np,[ISSM_DIR '/externalpackages/valgrind/install/bin/valgrind'],[ISSM_DIR '/externalpackages/valgrind/issm.supp'], codepath,EnumToString(analysis_type),executionpath,name,name,name,name,name);
-		fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',[ISSM_DIR '/externalpackages/valgrind/install/lib/libmpidebug.so'],np,[ISSM_DIR '/externalpackages/valgrind/install/bin/valgrind'],[ISSM_DIR '/externalpackages/valgrind/issm.supp'], codepath,EnumToString(analysis_type),executionpath,name,name,name,name,name);
-	end
-
-	% }}}
-elseif (strcmpi(cluster,'gemini') | strcmpi(cluster,'pollux') | strcmpi(cluster,'castor')), % {{{1
-
-	fprintf(fid,'#!/bin/sh\n');
-	fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
-	fprintf(fid,'#PBS -N %s\n',name);
-	fprintf(fid,'#PBS -l ncpus=%i\n',np);
-	if ~isempty(queue),
-		fprintf(fid,'#PBS -q %s\n',queue);
-	end
-	fprintf(fid,'#PBS -o %s.outlog \n',name);
-	fprintf(fid,'#PBS -e %s.errlog \n',name);
-
-	fprintf(fid,'export PBS_O_WORKDIR=%s\n',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.outbin %s.lock',np-1,np,codepath,EnumToString(analysis_type),executionpath,name,name,name);
-
-	% }}}
-elseif strcmpi(cluster,'pfe'), % {{{1
-
-	fprintf(fid,'#PBS -S /bin/bash\n');
-	fprintf(fid,'#PBS -N %s\n',name);
-	fprintf(fid,'#PBS -l select=%i:ncpus=8:model=neh\n',np/8);
-	fprintf(fid,'#PBS -l walltime=%i\n',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',name);
-	fprintf(fid,'#PBS -e %s.errlog \n\n',name);
-
-	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.outbin %s.lock',np,codepath,EnumToString(analysis_type),name,name,name);
-
-	% }}}
-else % {{{1
-	error(['ClusterScript error message: could not find settings for cluster ' cluster]);
-end
-% }}}
Index: /issm/trunk/src/m/model/queue/LaunchMultipleQueueJob.m
===================================================================
--- /issm/trunk/src/m/model/queue/LaunchMultipleQueueJob.m	(revision 5948)
+++ /issm/trunk/src/m/model/queue/LaunchMultipleQueueJob.m	(revision 5948)
@@ -0,0 +1,21 @@
+function LaunchMultipleQueueJob(cluster,name,executionpath)
+%LAUNCHMULTIPLEQUEUEJOB - ...
+%
+%   Usage:
+%      LaunchMultipleQueueJob(executionpath)
+
+%First try and figure out if there is a special script for thie particular cluster
+function_name=['LaunchMultipleQueueJob' cluster];
+
+%some specific treatment of identical cluster, gemini, castor and pollux
+if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
+	function_name='LaunchMultipleQueueJobgemini';
+end
+
+if exist(function_name,'file'),
+	%Call this function:
+	eval([function_name '(cluster,name,executionpath);']);
+else
+	%Call the generic LaunchMultipleQueueJob:
+	LaunchMultipleQueueJobGeneric(cluster,name,executionpath);
+end
Index: /issm/trunk/src/m/model/queue/LaunchMultipleQueueJobGeneric.m
===================================================================
--- /issm/trunk/src/m/model/queue/LaunchMultipleQueueJobGeneric.m	(revision 5948)
+++ /issm/trunk/src/m/model/queue/LaunchMultipleQueueJobGeneric.m	(revision 5948)
@@ -0,0 +1,7 @@
+function LaunchMultipleQueueJobGeneric(cluster,name,executionpath)
+%LAUNCHMULTIPLEQUEUEJOBGENERIC - Generic routine to launch multiple queueing job
+%
+%   Usage:
+%      LaunchMultipleQueueJobGeneric(cluster,name,executionpath)
+
+error('LaunchMultipleQueueJobGeneric error message: not supported yet!');
Index: /issm/trunk/src/m/model/queue/LaunchMultipleQueueJobgemini.m
===================================================================
--- /issm/trunk/src/m/model/queue/LaunchMultipleQueueJobgemini.m	(revision 5948)
+++ /issm/trunk/src/m/model/queue/LaunchMultipleQueueJobgemini.m	(revision 5948)
@@ -0,0 +1,22 @@
+function md=LaunchMultipleQueueJobgemini(cluster,name,executionpath)
+%LAUNCHMULTIPLEQUEUEJOBGEMINI - Launch multiple queueing script on Gemini cluster
+%
+%   Usage:
+%      LaunchMultipleQueueJobgemini(cluster,name,executionpath)
+
+
+%first, check we have the binary file and the queueing script
+if ~exist([ name '.queue'],'file'),
+	error('LaunchMultipleQueueJobgemini error message: queueing script issing, cannot go forward');
+end
+
+if ~exist('ModelList.tar.gz','file'),
+	error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward');
+end
+
+%upload both files to cluster
+disp('uploading input file,  queueing script and variables script');
+eval(['!scp ModelList.tar.gz ' name '.queue '  cluster ':' executionpath]);
+
+disp('launching solution sequence on remote cluster');
+issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']);
Index: sm/trunk/src/m/model/queue/LaunchQueueJob.m
===================================================================
--- /issm/trunk/src/m/model/queue/LaunchQueueJob.m	(revision 5947)
+++ 	(revision )
@@ -1,39 +1,0 @@
-function md=LaunchQueueJob(md,executionpath,login,port,options)
-%LAUNCHQUEUEJOB- Launch queue script for cluster
-%
-%   Usage:
-%      md=LaunchQueueJob(md,executionpath,launchcommand,login,port,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 petsc.rc '];
-	if md.qmu_analysis,
-		compressstring=[compressstring md.name '.qmu.in'];
-	end
-	system(compressstring);
-	
-	disp('uploading input file and queueing script');
-	issmscpout(md.cluster,executionpath,login,port,{[md.runtimename '.tar.gz']});
-
-	disp('launching solution sequence on remote cluster');
-	issmssh(md.cluster.name,md.cluster.login,md.cluster.port,LaunchCommand(md.cluster,md.runtimename,md.name));
-
-else
-	disp('batch mode requested: not launching job interactively');
-	disp('launch solution sequence on remote cluster by hand');
-end
Index: sm/trunk/src/m/model/queue/QueueRequirements.m
===================================================================
--- /issm/trunk/src/m/model/queue/QueueRequirements.m	(revision 5947)
+++ 	(revision )
@@ -1,126 +1,0 @@
-function QueueRequirements(cluster,queue,np,time)
-%QUEUEREQUIREMENTS queue requirements in time, number of cpus, by name of queue.
-%
-%
-% Usage: QueueRequirements(cluster,queue,np,time)
-%
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%cluster settings%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-if strcmpi(cluster,'cosmos'),
-
-	available_queues={'debug','shortq','longq','specialq'};
-	queue_requirements_time=[60*1 60*3 60*17 1440];
-	queue_requirements_np=[32 128 256 256];
-	queue_requirements_modulo=[1 1 1 1];
-
-elseif strcmpi(cluster,'gemini'),
-
-	available_queues={'debug','shortg','longg'};
-	queue_requirements_time=[60 180 720];
-	queue_requirements_np=[50 50 50];
-	queue_requirements_modulo=[1 1 1 ];
-
-elseif strcmpi(cluster,'castor'),
-
-	available_queues={'shortc','longc'};
-	queue_requirements_time=[180 720];
-	queue_requirements_np=[128 128];
-	queue_requirements_modulo=[1 1 ];
-
-elseif strcmpi(cluster,'pollux'),
-
-	available_queues={'shortp','longp'};
-	queue_requirements_time=[180 720];
-	queue_requirements_np=[128 128];
-	queue_requirements_modulo=[1 1 ];
-
-elseif strcmpi(cluster,'astrid'),
-
-	available_queues={'none'};
-	queue_requirements_time=[Inf];
-	queue_requirements_np=[16];
-	queue_requirements_modulo=[1 ];
-
-elseif strcmpi(cluster,'eric-mac'),
-
-	available_queues={'none'};
-	queue_requirements_time=[Inf];
-	queue_requirements_np=[4];
-	queue_requirements_modulo=[1 ];
-
-elseif strcmpi(cluster,'larsen'),
-
-	available_queues={'none'};
-	queue_requirements_time=[Inf];
-	queue_requirements_np=[8];
-	queue_requirements_modulo=[1 ];
-
-elseif strcmpi(cluster,'wilkes'),
-
-	available_queues={'none'};
-	queue_requirements_time=[Inf];
-	queue_requirements_np=[16];
-	queue_requirements_modulo=[1 ];
-
-elseif strcmpi(cluster,'pfe'),
-
-	available_queues={'long'};
-	queue_requirements_time=[7200];
-	queue_requirements_np=[2048];
-	queue_requirements_modulo=[8 ];
-
-else
-	error(['BuildQueueingScript error message: cannot find requirements for ' cluster ]);
-end
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%end settings%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%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
-rnp=queue_requirements_np(index);
-rmod=queue_requirements_modulo(index);
-
-if np<=0,
-	error('QueueRequirements: np should be a positive number');
-end
-
-if np>rnp,
-	error(['QueueRequirements: np should be < ' num2str(rnp) ' for queue: ' queue]);
-end
-
-%check np is a multiple of the queue multiple 
-if mod(np,rmod),
-	error(['QueueRequirements: np should be a multiple of ' num2str(rmod) ' for queue: ' queue]);
-end
