Index: /issm/trunk-jpl/src/m/classes/clusters/generic.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 22768)
+++ /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 22769)
@@ -111,8 +111,8 @@
 				else
 					%Add --gen-suppressions=all to get suppression lines
-					fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+					%fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
 					if ismac, 
 						if IssmConfig('_HAVE_MPI_'),
-							fprintf(fid,'mpiexec -np %i %s --leak-check=full --error-limit=no --dsymutil=yes --suppressions=%s %s/%s %s %s %s 2> %s.errlog >%s.outlog ',...
+							fprintf(fid,'mpiexec -np %i %s --leak-check=full --gen-suppressions=all --error-limit=no --dsymutil=yes --suppressions=%s %s/%s %s %s %s 2> %s.errlog >%s.outlog ',...
 							cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname], modelname,modelname,modelname);
 						else
@@ -122,5 +122,5 @@
 					else
 						if IssmConfig('_HAVE_MPI_'),
-							fprintf(fid,'mpiexec -np %i %s --leak-check=full --error-limit=no --suppressions=%s %s/%s %s %s %s 2> %s.errlog >%s.outlog ',...
+							fprintf(fid,'mpiexec -np %i %s --leak-check=full --gen-suppressions=all --error-limit=no --suppressions=%s %s/%s %s %s %s 2> %s.errlog >%s.outlog ',...
 							cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
 						else
Index: /issm/trunk-jpl/src/m/classes/clusters/pfe.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/pfe.m	(revision 22768)
+++ /issm/trunk-jpl/src/m/classes/clusters/pfe.m	(revision 22769)
@@ -11,5 +11,5 @@
 		 name           = 'pfe'
 		 login          = '';
-		 modules        = {'comp-intel/2016.2.181' 'mpi-sgi/mpt'};
+		 modules        = {'comp-intel/2018.0.128' 'mpi-sgi/mpt'};
 		 numnodes       = 20;
 		 cpuspernode    = 8;
@@ -163,8 +163,10 @@
 			 fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
 			 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
-			 fprintf(fid,'module load comp-intel/2016.2.181\n');
-			 fprintf(fid,'module load mpi-sgi/mpt\n');
+			 for i=1:numel(cluster.modules),
+				 fprintf(fid,['module load ' cluster.modules{i} '\n']);
+			 end
 			 fprintf(fid,'export PATH="$PATH:."\n\n');
 			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+			 fprintf(fid,'export MKL_NUM_THREADS=2\n\n');
 			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
 			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
@@ -226,6 +228,7 @@
 			 fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
 			 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
-			 fprintf(fid,'module load comp-intel/2016.2.181\n');
-			 fprintf(fid,'module load mpi-sgi/mpt\n');
+			 for i=1:numel(cluster.modules),
+				 fprintf(fid,['module load ' cluster.modules{i} '\n']);
+			 end
 			 fprintf(fid,'export PATH="$PATH:."\n\n');
 			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
@@ -353,4 +356,7 @@
 			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
 			 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
+			 %for i=1:numel(cluster.modules),
+			 %	 fprintf(fid,['module load ' cluster.modules{i} '\n']);
+			 %end
 			 fprintf(fid,'module load comp-intel/2016.2.181\n');
 			 fprintf(fid,'module load netcdf/4.4.1.1_mpt\n');
Index: /issm/trunk-jpl/src/m/inversions/marshallcostfunctions.m
===================================================================
--- /issm/trunk-jpl/src/m/inversions/marshallcostfunctions.m	(revision 22768)
+++ /issm/trunk-jpl/src/m/inversions/marshallcostfunctions.m	(revision 22769)
@@ -15,2 +15,4 @@
 	pos=find(cost_functions==510); data(pos) = {'ThicknessPositive'};
 	pos=find(cost_functions==601); data(pos) = {'SurfaceAbsMisfit'};
+	pos=find(cost_functions==602); data(pos) = {'OmegaAbsGradient'};
+	pos=find(cost_functions==603); data(pos) = {'EtaDiff'};
Index: /issm/trunk-jpl/src/m/inversions/supportedcontrols.m
===================================================================
--- /issm/trunk-jpl/src/m/inversions/supportedcontrols.m	(revision 22768)
+++ /issm/trunk-jpl/src/m/inversions/supportedcontrols.m	(revision 22769)
@@ -2,4 +2,5 @@
 
 	list = {...
+		'BalancethicknessSpcthickness',...
 		'BalancethicknessThickeningRate',...
 		'FrictionCoefficient',...
Index: /issm/trunk-jpl/src/m/mesh/labelconnectedregions.m
===================================================================
--- /issm/trunk-jpl/src/m/mesh/labelconnectedregions.m	(revision 22769)
+++ /issm/trunk-jpl/src/m/mesh/labelconnectedregions.m	(revision 22769)
@@ -0,0 +1,26 @@
+function labels = labelconnectedregions(md)
+%LABELCONNECTEDREGIONS - label connected components of a mesh
+%
+%   Usage:
+%      labels = labelconnectedregions(md)
+
+if size(md.mesh.elements,2)~=3,
+	error('not suppored yet (but easy to extend :)');
+end
+
+disp('Generate adjacency matrix');
+pairs = [
+md.mesh.elements(:,[1 2])
+md.mesh.elements(:,[2 1])
+md.mesh.elements(:,[2 3])
+md.mesh.elements(:,[3 2])
+md.mesh.elements(:,[3 1])
+md.mesh.elements(:,[1 3])
+];
+A = sparse(pairs(:,1), pairs(:,2), 1);
+
+disp('Construct graph');
+G = graph(A);
+
+disp('Label connected pieces');
+labels = conncomp(G);
Index: /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
===================================================================
--- /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 22768)
+++ /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 22769)
@@ -102,10 +102,21 @@
 	end
 
+	%Find path to gmsh
+	paths = {[issmdir() '/bin/gmsh'],[issmdir() '/externalpackages/gmsh/install/gmsh']};
+	gmshpath = '';
+	for i=paths
+		if exist(i{1},'file'),
+			gmshpath = i{1}
+		end
+	end
+	if isempty(gmshpath),
+		error('gmt not found, make sure it is properly installed');
+	end
+
 	%call gmsh
 	if  exist(options,'refine'),
-		eval(['!gmsh -tol 1e-8 -2 sphere.geo -bgm sphere.pos']);
+		system([gmshpath ' -tol 1e-8 -2 sphere.geo -bgm sphere.pos']);
 	else
-		%call gmsh
-		eval(['!gmsh -tol 1e-8 -2 sphere.geo']);
+		system([gmshpath ' -tol 1e-8 -2 sphere.geo']);
 	end
 
@@ -163,5 +174,5 @@
 
 	%erase files: 
-	eval(['!rm -rf sphere.geo sphere.msh sphere.pos']);
+	system('rm -rf sphere.geo sphere.msh sphere.pos');
 
 	%return mesh: 
Index: /issm/trunk-jpl/src/m/plot/subplotmodel.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/subplotmodel.m	(revision 22768)
+++ /issm/trunk-jpl/src/m/plot/subplotmodel.m	(revision 22769)
@@ -30,5 +30,5 @@
 		if(((i-1)*ncols+j)==num)
 			ha = axes('Units','normalized', ...
-				'Position',[xmin ymin width height],'XTickLabel','','YTickLabel','','Visible','off');
+				'Position',[xmin ymin width height]);%,'XTickLabel','','YTickLabel','','Visible','off');
 			return
 		end
Index: /issm/trunk-jpl/src/m/solvers/mumpsoptions.m
===================================================================
--- /issm/trunk-jpl/src/m/solvers/mumpsoptions.m	(revision 22768)
+++ /issm/trunk-jpl/src/m/solvers/mumpsoptions.m	(revision 22769)
@@ -27,8 +27,10 @@
 	mumps.pc_factor_mat_solver_package=getfieldvalue(options,'pc_factor_mat_solver_package','mumps');
 	mumps.mat_mumps_icntl_14=getfieldvalue(options,'mat_mumps_icntl_14',120);
+
+	%Seems like this one is not needed anymore
 	mumps.pc_factor_shift_positive_definite=getfieldvalue(options,'pc_factor_shift_positive_definite','true');
 
 	%These 2 lines make raijin break (ptwgts error during solver with PETSc 3.3)
-	mumps.mat_mumps_icntl_28=2; %1=serial, 2=parallel
-	mumps.mat_mumps_icntl_29=2; %parallel ordering 1 = ptscotch, 2 = parmetis
+	%mumps.mat_mumps_icntl_28=2; %1=serial, 2=parallel
+	%mumps.mat_mumps_icntl_29=2; %parallel ordering 1 = ptscotch, 2 = parmetis
 end
