Index: /issm/trunk/src/c/MeshPartitionx/MeshPartitionx.cpp
===================================================================
--- /issm/trunk/src/c/MeshPartitionx/MeshPartitionx.cpp	(revision 3864)
+++ /issm/trunk/src/c/MeshPartitionx/MeshPartitionx.cpp	(revision 3865)
@@ -41,5 +41,13 @@
 
 		/*Partition using Metis:*/
-		METIS_PartMeshNodal(&numberofelements,&numberofgrids, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
+		if (num_procs>1){
+			METIS_PartMeshNodal(&numberofelements,&numberofgrids, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
+		}
+		else if (num_procs==1){
+			/*METIS does not know how to deal with one cpu only!*/
+			for (i=0;i<numberofelements;i++) epart[i]=0;
+			for (i=0;i<numberofgrids;i++)    npart[i]=0;
+		}
+		else ISSMERROR("At least one processor is required");
 	}
 	else{
@@ -57,5 +65,14 @@
 		}
 
-		METIS_PartMeshNodal(&numberofelements2d,&numberofgrids2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
+		/*Partition using Metis:*/
+		if (num_procs>1){
+			METIS_PartMeshNodal(&numberofelements2d,&numberofgrids2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
+		}
+		else if (num_procs==1){
+			/*METIS does not know how to deal with one cpu only!*/
+			for (i=0;i<numberofelements2d;i++) epart2d[i]=0;
+			for (i=0;i<numberofgrids2d;i++)    npart2d[i]=0;
+		}
+		else ISSMERROR("At least one processor is required");
 
 		/*Extrude epart2d to epart, using numlayers: */
