Index: /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 24394)
+++ /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 24395)
@@ -7,12 +7,11 @@
 #include "../../../shared/shared.h"
 
-void METIS_PartMeshNodalPatch(int* pnumberofelements,int* pnumberofnodes, int* index, int* petype, int* pnumflag, int* pnum_procs, int* pedgecut, int* epart, int* npart){
+void METIS_PartMeshNodalPatch(int* pnumberofelements,int* pnumberofnodes,int* index,int* petype,int* pnumflag,int* pnum_procs,int* pedgecut,int* epart,int* npart){
 
 	#if _METIS_VERSION_ == 4
 	/*Our interface originates in the Metis 4.0 version, hence identical calls*/
 	METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, index, petype, pnumflag, pnum_procs, pedgecut, epart, npart); 
+
 	#elif _METIS_VERSION_ == 5
-
-	/*This interface is heavily changed. More options, different ways of meshing, etc ...: */ 
 
 	/*Create options*/
@@ -21,5 +20,5 @@
 
 	options[METIS_OPTION_PTYPE]   = METIS_PTYPE_KWAY;     /* partitioning method  */
-	options[METIS_OPTION_OBJTYPE] = METIS_OBJTYPE_VOL;    /* type of objective */
+	options[METIS_OPTION_OBJTYPE] = METIS_OBJTYPE_CUT;    /* type of objective */
 	options[METIS_OPTION_CTYPE]   = METIS_CTYPE_SHEM;     /* matching scheme to be used during coarsening.*/
 	options[METIS_OPTION_IPTYPE]  = METIS_IPTYPE_METISRB; /* algorithm used during initial partitioning*/
@@ -33,5 +32,5 @@
 	options[METIS_OPTION_NCUTS]   = 1;                    /* number of different partitionings that it will compute*/
 
-	/*create eptr: */
+	/*create eptr*/
 	idx_t  k=0;
 	idx_t* eptr=xNew<idx_t>((*pnumberofelements+1));
@@ -42,16 +41,19 @@
 	}
 
-	/*create tpwgts: */
+	/*create tpwgts (Weight per processor)*/
 	real_t* tpwgts=xNew<real_t>(*pnum_procs);
-	for(int i=0;i<*pnum_procs;i++){
-		tpwgts[i]=1.0/(*pnum_procs);
-	}
+	for(int i=0;i<*pnum_procs;i++) tpwgts[i]=1.0/(*pnum_procs);
+
+	/*create vwgt (Weight per node)*/
+	idx_t* vwgts=xNew<idx_t>(*pnumberofnodes);
+	for(int i=0;i<*pnumberofnodes;i++) vwgts[i]=1;
 
 	/*Call METIS*/
 	idx_t objval;
-	METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, eptr, index,
-			NULL, NULL, pnum_procs, tpwgts, options, &objval,epart, npart);
+	int output = METIS_PartMeshNodal(pnumberofelements,pnumberofnodes,eptr,index,vwgts,NULL,pnum_procs,tpwgts,options,&objval,epart,npart);
+	if(output!=METIS_OK) _error_("Could not partition mesh");
 
 	/*clean-up*/
+	xDelete<idx_t>(vwgts);
 	xDelete<idx_t>(eptr);
 	xDelete<real_t>(tpwgts);
