Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py
===================================================================
--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12752)
+++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.py	(revision 12753)
@@ -1,37 +1,184 @@
-#GENERIC cluster class definition
-#
-#   Usage:
-#      cluster=generic('name','astrid',);
-#      cluster=generic('name','astrid','np',3);
-#      cluster=generic('name',oshostname(),'np',3,'login','username');
+"""
+GENERIC cluster class definition
+ 
+    Usage:
+       cluster=generic('name','astrid','np',3);
+       cluster=generic('name',oshostname(),'np',3,'login','username');
+"""
 
+import socket
+import os
+import math
+import platform
+import subprocess
+from issmdir import *
+from pairoptions import *
+from issmssh import *
+from issmscpin import *
+from issmscpout import *
 
-class generic:
-	#properties
-	def __init__(self):
-		# {{{ Properties
+class generic(object):
+	def __init__(self,*args):    # {{{
+
 		self.name=''
 		self.login=''
 		self.np=1
 		self.port=0
 		self.interactive=1
-		self.codepath=issmdir() + '/bin'
-		self.executionpath=issmdir() + '/execution'
-		self.valgrind=issmdir() + '/externalpackages/valgrind/install/bin/valgrind'
-		self.valgrindlib=issmdir() + '/externalpackages/valgrind/install/lib/libmpidebug.so'
-		self.valgrindsup=issmdir() + '/externalpackages/valgrind/issm.supp'
-		#}}}
-	def __repr__(obj):
-		# {{{ Display
-		
-		string="class 'generic' object:"
-		string="%s\n\n%s"%(string,"%s%s"%('    name: ',obj.name))
-		string="%s\n%s"%(string,"%s%i"%('    np: ',obj.np))
-		string="%s\n%s"%(string,"%s%i"%('    port: ',obj.port))
-		string="%s\n%s"%(string,"%s%s"%('    codepath: ',obj.codepath))
-		string="%s\n%s"%(string,"%s%s"%('    executionpath: ',obj.executionpath))
-		string="%s\n%s"%(string,"%s%s"%('    valgrind: ',obj.valgrind))
-		string="%s\n%s"%(string,"%s%s"%('    valgrindlib: ',obj.valgrindlib))
-		string="%s\n%s"%(string,"%s%s"%('    valgrindsup: ',obj.valgrindsup))
-		return string
-		#}}}
+		self.codepath=issmdir()+'/bin'
+		self.executionpath=issmdir()+'/execution'
+		self.valgrind=issmdir()+'/externalpackages/valgrind/install/bin/valgrind'
+		self.valgrindlib=issmdir()+'/externalpackages/valgrind/install/lib/libmpidebug.so'
+		self.valgrindsup=issmdir()+'/externalpackages/valgrind/issm.supp'
+
+		#use provided options to change fields
+		options=pairoptions(*args)
+
+		#get name
+		self.name=options.getfieldvalue('name',socket.gethostname().lower().split('.')[0])
+
+		#initialize cluster using user settings if provided
+		if os.path.exists(self.name+'_settings.py'):
+			execfile(self.name+'_settings.py',globals())
+
+		#OK get other fields
+		cluster=options.AssignObjectFields(cluster)
+	# }}}
+
+	def __repr__(self):    # {{{
+		#  display the object
+		print "class '%s' object '%s' = " % (type(self),'self')
+		print "    name: %s" % self.name
+		print "    login: %s" % self.login
+		print "    np: %i" % self.np
+		print "    port: %i" % self.port
+		print "    codepath: %s" % self.codepath
+		print "    executionpath: %s" % self.executionpath
+		print "    valgrind: %s" % self.valgrind
+		print "    valgrindlib: %s" % self.valgrindlib
+		print "    valgrindsup: %s" % self.valgrindsup
+	# }}}
+
+	def checkconsistency(self,md,solution,analyses):    # {{{
+		if self.np<1:
+			md = checkmessage(md,'number of processors should be at least 1')
+		if math.isnan(self.np):
+			md = checkmessage(md,'number of processors should not be NaN!')
+
+		return md
+	# }}}
+
+	def BuildQueueScript(self,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
+
+		#write queuing script 
+		if not 'Windows' in platform.system():
+
+			fid=open(modelname+'.queue','w')
+			fid.write('#!/bin/sh\n')
+			if not isvalgrind:
+				if self.interactive:
+					fid.write('mpiexec -np %i %s/issm.exe %s %s %s ' % (self.np,self.codepath,EnumToString(solution),self.executionpath,modelname))
+				else:
+					fid.write('mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
+			elif isgprof:
+				fid.write('\n gprof %s/issm.exe gmon.out > %s.performance' % (self.codepath,modelname))
+			else:
+				#Add --gen-suppressions=all to get suppression lines
+				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
+				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % \
+					(self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
+			if not io_gather:    #concatenate the output files:
+				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
+			fid.close()
+
+		else:    # Windows
+
+			fid=open(modelname+'.bat','w')
+			fid.write('@echo off\n')
+			if self.interactive:
+				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution),self.executionpath,modelname))
+			else:
+				fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \
+					(self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
+			fid.close()
+
+		#in interactive mode, create a run file, and errlog and outlog file
+		if self.interactive:
+			fid=open(modelname+'.errlog','w')
+			fid.close()
+			fid=open(modelname+'.outlog','w')
+			fid.close()
+	# }}}
+
+	def BuildKrigingQueueScript(self,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
+
+		#write queuing script 
+		if not 'Windows' in platform.system():
+
+			fid=open(modelname+'.queue','w')
+			fid.write('#!/bin/sh\n')
+			if not isvalgrind:
+				if self.interactive:
+					fid.write('mpiexec -np %i %s/kriging.exe %s %s ' % (self.np,self.codepath,self.executionpath,modelname))
+				else:
+					fid.write('mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,self.executionpath,modelname,modelname,modelname))
+			elif isgprof:
+				fid.write('\n gprof %s/kriging.exe gmon.out > %s.performance' & (self.codepath,modelname))
+			else:
+				#Add --gen-suppressions=all to get suppression lines
+				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
+				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ' % \
+					(self.np,self.valgrind,self.valgrindsup,self.codepath,self.executionpath,modelname,modelname,modelname))
+			if not io_gather:    #concatenate the output files:
+				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
+			fid.close()
+
+		else:    # Windows
+
+			fid=open(modelname+'.bat','w')
+			fid.write('@echo off\n')
+			if self.interactive:
+				fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution),self.executionpath,modelname))
+			else:
+				fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \
+					(self.codepath,EnumToString(solution),self.executionpath,modelname,modelname,modelname))
+			fid.close()
+
+		#in interactive mode, create a run file, and errlog and outlog file
+		if self.interactive:
+			fid=open(modelname+'.errlog','w')
+			fid.close()
+			fid=open(modelname+'.outlog','w')
+			fid.close()
+	# }}}
+
+	def LaunchQueueJob(self,modelname,dirname,filelist):    # {{{
+
+		#compress the files into one zip.
+		compressstring='tar -zcf %s.tar.gz ' % dirname
+		for file in filelist:
+			compressstring += ' %s' % file
+		if self.interactive:
+			compressstring += ' %s.errlog %s.outlog ' % (modelname,modelname)
+		subprocess.call(compressstring,shell=True)
+
+		print 'uploading input file and queueing script'
+		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
+
+		print 'launching solution sequence on remote cluster'
+		launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && source  %s.queue ' % \
+			(self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname)
+		issmssh(self.name,self.login,self.port,launchcommand)
+	# }}}
+
+	def Download(self,dirname,filelist):     # {{{
+
+		if 'Windows' in platform.system():
+			#do nothing
+			return
+
+		#copy files from cluster to current directory
+		directory='%s/%s/' % (self.executionpath,dirname)
+		issmscpin(self.name,self.login,self.port,directory,filelist)
+	# }}}
+
Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m
===================================================================
--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12752)
+++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/clusters/generic.m	(revision 12753)
@@ -5,172 +5,172 @@
 %      cluster=generic('name',oshostname(),'np',3,'login','username');
 
 classdef generic
-    properties (SetAccess=public) 
-		 % {{{
-		 name='';
-		 login='';
-		 np=1;
-		 port=0;
-		 interactive=1;
-		 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=generic(varargin) % {{{
+	properties (SetAccess=public) 
+		% {{{
+		name='';
+		login='';
+		np=1;
+		port=0;
+		interactive=1;
+		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=generic(varargin) % {{{
 
-			 %use provided options to change fields
-			 options=pairoptions(varargin{:});
+			%use provided options to change fields
+			options=pairoptions(varargin{:});
 
-			 %get name
-			 cluster.name=getfieldvalue(options,'name',oshostname());
+			%get name
+			cluster.name=getfieldvalue(options,'name',oshostname());
 
-			 %initialize cluster using user settings if provided
-			 if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end
+			%initialize cluster using user settings if provided
+			if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end
 
-			 %OK get other fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  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 md = checkconsistency(cluster,md,solution,analyses) % {{{
-			 if cluster.np<1
-				 md = checkmessage(md,['number of processors should be at least 1']);
-			 end
-			 if isnan(cluster.np),
-				 checkessage('number of processors should not be NaN!');
-			 end
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+			%OK get other fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  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 md = checkconsistency(cluster,md,solution,analyses) % {{{
+			if cluster.np<1
+				md = checkmessage(md,['number of processors should be at least 1']);
+			end
+			if isnan(cluster.np),
+				checkessage('number of processors should not be NaN!');
+			end
+		end
+		%}}}
+		function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 %write queuing script 
-			 if ~ispc,
+			%write queuing script 
+			if ~ispc,
 
-				 fid=fopen([modelname '.queue'],'w');
-				 fprintf(fid,'#!/bin/sh\n');
-				 if ~isvalgrind,
-					 if cluster.interactive
-						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-					 else
-						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
-					 end
-				 elseif isgprof,
-					 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
-				 else
-					 %Add --gen-suppressions=all to get suppression lines
-					 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
-					 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
-						 cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
-				 end
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
+				fid=fopen([modelname '.queue'],'w');
+				fprintf(fid,'#!/bin/sh\n');
+				if ~isvalgrind,
+					if cluster.interactive
+						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+					else
+						fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+					end
+				elseif isgprof,
+					fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
+				else
+					%Add --gen-suppressions=all to get suppression lines
+					fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+					fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+				end
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
 
-			 else % Windows
+			else % Windows
 
-				 fid=fopen([modelname '.bat'],'w');
-				 fprintf(fid,'@echo off\n');
-				 if cluster.interactive
-					 fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-				 else
-					 fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
-						 cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
-				 end
-				 fclose(fid);
-			 end
+				fid=fopen([modelname '.bat'],'w');
+				fprintf(fid,'@echo off\n');
+				if cluster.interactive
+					fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+				else
+					fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
+						cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+				end
+				fclose(fid);
+			end
 
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.errlog'],'w'); fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w'); fclose(fid);
-			 end
-		 end
-		 %}}}
-		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.errlog'],'w'); fclose(fid);
+				fid=fopen([modelname '.outlog'],'w'); fclose(fid);
+			end
+		end
+		%}}}
+		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 %write queuing script 
-			 if ~ispc,
+			%write queuing script 
+			if ~ispc,
 
-				 fid=fopen([modelname '.queue'],'w');
-				 fprintf(fid,'#!/bin/sh\n');
-				 if ~isvalgrind,
-					 if cluster.interactive
-						 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s ',cluster.np,cluster.codepath,cluster.executionpath,modelname);
-					 else
-						 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
-					 end
-				 elseif isgprof,
-					 fprintf(fid,'\n gprof %s/kriging.exe gmon.out > %s.performance',cluster.codepath,modelname);
-				 else
-					 %Add --gen-suppressions=all to get suppression lines
-					 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
-					 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',...
-						 cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
-				 end
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
+				fid=fopen([modelname '.queue'],'w');
+				fprintf(fid,'#!/bin/sh\n');
+				if ~isvalgrind,
+					if cluster.interactive
+						fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s ',cluster.np,cluster.codepath,cluster.executionpath,modelname);
+					else
+						fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
+					end
+				elseif isgprof,
+					fprintf(fid,'\n gprof %s/kriging.exe gmon.out > %s.performance',cluster.codepath,modelname);
+				else
+					%Add --gen-suppressions=all to get suppression lines
+					fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+					fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',...
+						cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
+				end
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
 
-			 else % Windows
+			else % Windows
 
-				 fid=fopen([modelname '.bat'],'w');
-				 fprintf(fid,'@echo off\n');
-				 if cluster.interactive
-					 fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-				 else
-					 fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
-						 cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
-				 end
-				 fclose(fid);
-			 end
+				fid=fopen([modelname '.bat'],'w');
+				fprintf(fid,'@echo off\n');
+				if cluster.interactive
+					fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+				else
+					fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog',...
+						cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+				end
+				fclose(fid);
+			end
 
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.errlog'],'w'); fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w'); fclose(fid);
-			 end
-		 end
-		 %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.errlog'],'w'); fclose(fid);
+				fid=fopen([modelname '.outlog'],'w'); fclose(fid);
+			end
+		end
+		%}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-			 disp('launching solution sequence on remote cluster');
-			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-				 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+				' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist)% {{{
 
 			if ispc,
 				%do nothing
