Index: /issm/trunk/externalpackages/scotch/gmap_mex.c
===================================================================
--- /issm/trunk/externalpackages/scotch/gmap_mex.c	(revision 3649)
+++ /issm/trunk/externalpackages/scotch/gmap_mex.c	(revision 3650)
@@ -19,19 +19,4 @@
 
 void GmapUsage( void );
-
-
-/* Input Arguments */
-
-#define ADJMAT_IN  prhs[0]
-#define VERTLB_IN  prhs[1]
-#define VERTWT_IN  prhs[2]
-#define EDGEWT_IN  prhs[3]
-#define ARCHTYP_IN prhs[4]
-#define ARCHPAR_IN prhs[5]
-#define REQ_ARGS     6
-
-/* Output Arguments */
-
-#define MAPTAB_OUT plhs[0]
 
 
@@ -73,5 +58,5 @@
 	int     (*maptabi)[2]=NULL;
 	double* maptabd=NULL;
-	int     i,j,k,ierr;
+	int     i,j,k,imi=0,imo=0,isi=0,ierr;
 
 	/* Check for proper number of arguments */
@@ -89,115 +74,149 @@
 	and in the x-layer is inefficient, but it makes the x-layer more general)  */
 
-	if (!mxIsNumeric(ADJMAT_IN) || (!mxIsEmpty(ADJMAT_IN) && !mxIsSparse(ADJMAT_IN))) {
+	argvm = (char **) calloc(nrhs,sizeof(char *));
+
+	if (!(mxIsNumeric(prhs[imi]) &&
+		  (mxGetM(prhs[imi]) == 1 && mxGetN(prhs[imi]) == 1))) {
+		argvm[isi] = (char *) calloc(4+1,sizeof(char));
+		strcpy(argvm[isi],"gmap");
+		mexPrintf("%s -- Using \"%s\" entry point.\n",
+				  THISFUNCTION,argvm[isi]);
+		isi++;
+	}
+	else {
+		argvm[isi] = (char *) calloc(5+1,sizeof(char));
+		strcpy(argvm[isi],"gpart");
+		mexPrintf("%s -- Using \"%s\" entry point.\n",
+				  THISFUNCTION,argvm[isi]);
+		isi++;
+
+		argvm[isi] = (char *) calloc(17,sizeof(char));
+		sprintf(argvm[isi],"%d",(int)mxGetScalar(prhs[imi]));
+		mexPrintf("%s -- Number of parts is %s.\n",
+				  THISFUNCTION,argvm[isi]);
+		isi++;
+		imi++;
+	}
+
+	if (!mxIsNumeric(prhs[imi]) || (!mxIsEmpty(prhs[imi]) && !mxIsSparse(prhs[imi]))) {
 		mexPrintf("%s -- Adjacency matrix must be numeric and sparse.\n",THISFUNCTION);
 		mexErrMsgTxt(" ");
 	}
 	else {
-		nvert =mxGetM(ADJMAT_IN);
-		nedge2=mxGetNzmax(ADJMAT_IN);
-		if (mxGetNzmax(ADJMAT_IN)) {
-			ir    =mxGetIr(ADJMAT_IN);
-			adjir = (int *) malloc(mxGetNzmax(ADJMAT_IN)*sizeof(int));
-			for (i=0; i<mxGetNzmax(ADJMAT_IN); i++)
+		nvert =mxGetM(prhs[imi]);
+		nedge2=mxGetNzmax(prhs[imi]);
+		if (mxGetNzmax(prhs[imi])) {
+			ir    =mxGetIr(prhs[imi]);
+			adjir = (int *) malloc(mxGetNzmax(prhs[imi])*sizeof(int));
+			for (i=0; i<mxGetNzmax(prhs[imi]); i++)
 				adjir[i]=(int)ir[i];
 		}
-		if (mxGetN(ADJMAT_IN)) {
-			jc    =mxGetJc(ADJMAT_IN);
-			adjjc = (int *) malloc((mxGetN(ADJMAT_IN)+1)*sizeof(int));
-			for (i=0; i<(mxGetN(ADJMAT_IN)+1); i++)
+		if (mxGetN(prhs[imi])) {
+			jc    =mxGetJc(prhs[imi]);
+			adjjc = (int *) malloc((mxGetN(prhs[imi])+1)*sizeof(int));
+			for (i=0; i<(mxGetN(prhs[imi])+1); i++)
 				adjjc[i]=(int)jc[i];
 		}
 		mexPrintf("%s -- Adjacency matrix is of size %d by %d with %d non-zeroes.\n",
-				  THISFUNCTION,mxGetM(ADJMAT_IN),mxGetN(ADJMAT_IN),mxGetNzmax(ADJMAT_IN));
-	}
-
-	if (!mxIsNumeric(VERTLB_IN)) {
+				  THISFUNCTION,mxGetM(prhs[imi]),mxGetN(prhs[imi]),mxGetNzmax(prhs[imi]));
+	}
+	imi++;
+
+	if (!mxIsNumeric(prhs[imi])) {
 		mexPrintf("%s -- Vertex label vector must be numeric.\n",THISFUNCTION);
 		mexErrMsgTxt(" ");
 	}
 	else {
-		if (mxGetM(VERTLB_IN)*mxGetN(VERTLB_IN)) {
-			vld=mxGetPr(VERTLB_IN);
-			vli = (int *) malloc(mxGetM(VERTLB_IN)*mxGetN(VERTLB_IN)*sizeof(int));
-			for (i=0; i<mxGetM(VERTLB_IN)*mxGetN(VERTLB_IN); i++)
+		if (mxGetM(prhs[imi])*mxGetN(prhs[imi])) {
+			vld=mxGetPr(prhs[imi]);
+			vli = (int *) malloc(mxGetM(prhs[imi])*mxGetN(prhs[imi])*sizeof(int));
+			for (i=0; i<mxGetM(prhs[imi])*mxGetN(prhs[imi]); i++)
 				vli[i]=(int)vld[i];
 		}
 		mexPrintf("%s -- Vertex label vector is of size %d by %d.\n",
-				  THISFUNCTION,mxGetM(VERTLB_IN),mxGetN(VERTLB_IN));
-	}
-
-	if (!mxIsNumeric(VERTWT_IN)) {
+				  THISFUNCTION,mxGetM(prhs[imi]),mxGetN(prhs[imi]));
+	}
+	imi++;
+
+	if (!mxIsNumeric(prhs[imi])) {
 		mexPrintf("%s -- Vertex weight vector must be numeric.\n",THISFUNCTION);
 		mexErrMsgTxt(" ");
 	}
 	else {
-		if (mxGetM(VERTWT_IN)*mxGetN(VERTWT_IN)) {
-			vwd=mxGetPr(VERTWT_IN);
-			vwi = (int *) malloc(mxGetM(VERTWT_IN)*mxGetN(VERTWT_IN)*sizeof(int));
-			for (i=0; i<mxGetM(VERTWT_IN)*mxGetN(VERTWT_IN); i++)
+		if (mxGetM(prhs[imi])*mxGetN(prhs[imi])) {
+			vwd=mxGetPr(prhs[imi]);
+			vwi = (int *) malloc(mxGetM(prhs[imi])*mxGetN(prhs[imi])*sizeof(int));
+			for (i=0; i<mxGetM(prhs[imi])*mxGetN(prhs[imi]); i++)
 				vwi[i]=(int)vwd[i];
 		}
 		mexPrintf("%s -- Vertex weight vector is of size %d by %d.\n",
-				  THISFUNCTION,mxGetM(VERTWT_IN),mxGetN(VERTWT_IN));
-	}
-
-	if (!mxIsNumeric(EDGEWT_IN) || (!mxIsEmpty(EDGEWT_IN) && !mxIsSparse(EDGEWT_IN))) {
+				  THISFUNCTION,mxGetM(prhs[imi]),mxGetN(prhs[imi]));
+	}
+	imi++;
+
+	if (!mxIsNumeric(prhs[imi]) || (!mxIsEmpty(prhs[imi]) && !mxIsSparse(prhs[imi]))) {
 		mexPrintf("%s -- Edge weight matrix must be numeric and sparse.\n",THISFUNCTION);
 		mexErrMsgTxt(" ");
 	}
 	else {
-		if (mxGetM(EDGEWT_IN)) {
-			ewd=mxGetPr(EDGEWT_IN);
-			ewi = (int *) malloc(mxGetM(EDGEWT_IN)*sizeof(int));
-			for (i=0; i<mxGetNzmax(EDGEWT_IN); i++)
+		if (mxGetM(prhs[imi])) {
+			ewd=mxGetPr(prhs[imi]);
+			ewi = (int *) malloc(mxGetM(prhs[imi])*sizeof(int));
+			for (i=0; i<mxGetNzmax(prhs[imi]); i++)
 				ewi[i]=(int)ewd[i];
 		}
 		mexPrintf("%s -- Edge weight matrix is of size %d by %d with %d non-zeroes.\n",
-				  THISFUNCTION,mxGetM(EDGEWT_IN),mxGetN(EDGEWT_IN),mxGetNzmax(EDGEWT_IN));
-	}
-
-	if (!mxIsChar(ARCHTYP_IN)) {
-		mexPrintf("%s -- Architecture type must be character.\n",THISFUNCTION);
-		mexErrMsgTxt(" ");
-	}
-	else {
-		if (mxGetM(ARCHTYP_IN)*mxGetN(ARCHTYP_IN)) {
-			archtyp = (char *) calloc(mxGetM(ARCHTYP_IN)*mxGetN(ARCHTYP_IN)+1,sizeof(char));
-			mxGetString(ARCHTYP_IN,archtyp,mxGetM(ARCHTYP_IN)*mxGetN(ARCHTYP_IN)+1);
-		}
-		mexPrintf("%s -- Architecture type is \"%s\".\n",
-				  THISFUNCTION,archtyp);
-	}
-
-	if (!mxIsNumeric(ARCHPAR_IN)) {
-		mexPrintf("%s -- Architecture parameter vector must be numeric.\n",THISFUNCTION);
-		mexErrMsgTxt(" ");
-	}
-	else {
-		napar =mxGetM(ARCHPAR_IN)*mxGetN(ARCHPAR_IN);
-		if (mxGetM(ARCHPAR_IN)*mxGetN(ARCHPAR_IN)) {
-			apd=mxGetPr(ARCHPAR_IN);
-			api = (int *) malloc(mxGetM(ARCHPAR_IN)*mxGetN(ARCHPAR_IN)*sizeof(int));
-			for (i=0; i<mxGetM(ARCHPAR_IN)*mxGetN(ARCHPAR_IN); i++)
-				api[i]=(int)apd[i];
-		}
-		mexPrintf("%s -- Architecture parameter vector is of size %d by %d.\n",
-				  THISFUNCTION,mxGetM(ARCHPAR_IN),mxGetN(ARCHPAR_IN));
-	}
-
-	argcm=nrhs+1-REQ_ARGS;
+				  THISFUNCTION,mxGetM(prhs[imi]),mxGetN(prhs[imi]),mxGetNzmax(prhs[imi]));
+	}
+	imi++;
+
+	if (!((strlen (argvm[0]) >= 5) &&
+		  (strncmp (argvm[0] + strlen (argvm[0]) - 5, "gpart", 5) == 0))) {
+		if (!mxIsChar(prhs[imi])) {
+			mexPrintf("%s -- Architecture type must be character.\n",THISFUNCTION);
+			mexErrMsgTxt(" ");
+		}
+		else {
+			if (mxGetM(prhs[imi])*mxGetN(prhs[imi])) {
+				archtyp = (char *) calloc(mxGetM(prhs[imi])*mxGetN(prhs[imi])+1,sizeof(char));
+				mxGetString(prhs[imi],archtyp,mxGetM(prhs[imi])*mxGetN(prhs[imi])+1);
+			}
+			mexPrintf("%s -- Architecture type is \"%s\".\n",
+					  THISFUNCTION,archtyp);
+		}
+		imi++;
+
+		if (!mxIsNumeric(prhs[imi])) {
+			mexPrintf("%s -- Architecture parameter vector must be numeric.\n",THISFUNCTION);
+			mexErrMsgTxt(" ");
+		}
+		else {
+			napar =mxGetM(prhs[imi])*mxGetN(prhs[imi]);
+			if (mxGetM(prhs[imi])*mxGetN(prhs[imi])) {
+				apd=mxGetPr(prhs[imi]);
+				api = (int *) malloc(mxGetM(prhs[imi])*mxGetN(prhs[imi])*sizeof(int));
+				for (i=0; i<mxGetM(prhs[imi])*mxGetN(prhs[imi]); i++)
+					api[i]=(int)apd[i];
+			}
+			mexPrintf("%s -- Architecture parameter vector is of size %d by %d.\n",
+					  THISFUNCTION,mxGetM(prhs[imi]),mxGetN(prhs[imi]));
+		}
+		imi++;
+	}
+
+	while (imi < nrhs) {
+		if (!mxIsChar(prhs[imi])) {
+			mexPrintf("%s -- prhs[%d] must be character.\n",THISFUNCTION,imi);
+			mexErrMsgTxt(" ");
+		}
+		else {
+			argvm[isi] = (char *) calloc(mxGetM(prhs[imi])*mxGetN(prhs[imi])+1,sizeof(char));
+			mxGetString(prhs[imi],argvm[isi],mxGetM(prhs[imi])*mxGetN(prhs[imi])+1);
+		}
+		isi++;
+		imi++;
+	}
+	argcm=isi;
 	mexPrintf("argcm=%d\n",argcm);
-	argvm = (char **) malloc(argcm*sizeof(char *));
-	argvm[0] = (char *) calloc(4+1,sizeof(char));
-	strcpy(argvm[0],"gmap");
-	for (i=REQ_ARGS; i<nrhs; i++)
-		if (!mxIsChar(prhs[i])) {
-			mexPrintf("%s -- prhs[%d] must be character.\n",THISFUNCTION,i);
-			mexErrMsgTxt(" ");
-		}
-		else {
-			argvm[i+1-REQ_ARGS] = (char *) calloc(mxGetM(prhs[i])*mxGetN(prhs[i])+1,sizeof(char));
-			mxGetString(prhs[i],argvm[i+1-REQ_ARGS],mxGetM(prhs[i])*mxGetN(prhs[i])+1);
-		}
 	for (i=0; i<argcm; i++)
 		mexPrintf("argvm[%d]=\"%s\"\n",i,argvm[i]);
@@ -228,6 +247,6 @@
 
 	if (maptabi) {
-		MAPTAB_OUT=mxCreateDoubleMatrix(nvert, 2, mxREAL);
-		maptabd = mxGetPr(MAPTAB_OUT);
+		plhs[imo]=mxCreateDoubleMatrix(nvert, 2, mxREAL);
+		maptabd = mxGetPr(plhs[imo]);
 		k=0;
 		for (j=0; j<2; j++)
@@ -237,6 +256,7 @@
 	}
 	else {
-		MAPTAB_OUT=mxCreateDoubleMatrix(0, 2, mxREAL);
-	}
+		plhs[imo]=mxCreateDoubleMatrix(0, 2, mxREAL);
+	}
+	imo++;
 
 	if (argvm)
Index: /issm/trunk/externalpackages/scotch/gmapx.c
===================================================================
--- /issm/trunk/externalpackages/scotch/gmapx.c	(revision 3649)
+++ /issm/trunk/externalpackages/scotch/gmapx.c	(revision 3650)
@@ -220,4 +220,5 @@
     errorProg ("gmap");
 
+  intRandResetStatic ();
   intRandInit ();
 
Index: /issm/trunk/externalpackages/scotch/gpart.m
===================================================================
--- /issm/trunk/externalpackages/scotch/gpart.m	(revision 3650)
+++ /issm/trunk/externalpackages/scotch/gpart.m	(revision 3650)
@@ -0,0 +1,50 @@
+%
+%  function to call the gpart module of the scotch partitioner.
+%  (note that gpart is just a simplied entry into gmap.)
+%
+%  [maptab]=gpart(npart,adj_mat,vlist,vwgt,ewgt,...
+%                 options)
+%
+%  where the required input is:
+%    npart      (double, number of parts for 'cmplt' architecture)
+%    adj_mat    (double [sparse nv x nv], vertex adjacency matrix)
+%    vlist      (double [nv], vertex labels or [])
+%    vwgt       (double [nv], vertex weights (integers) or [])
+%    ewgt       (double [sparse nv x nv], edge weights (integers) or [])
+%
+%  the required output is:
+%    maptab     (double [nv x 2], vertex labels and partitions)
+%
+%  the optional input is:
+%    options    (character, options to gpart)
+%               "  -h         : Display this help"
+%               "  -m<strat>  : Set mapping strategy (see user's manual)"
+%               "  -s<obj>    : Force unity weights on <obj>:"
+%               "                 e  : edges"
+%               "                 v  : vertices"
+%               "  -V         : Print program version and copyright"
+%               "  -v<verb>   : Set verbose mode to <verb>:"
+%               "                 m  : mapping information"
+%               "                 s  : strategy information"
+%               "                 t  : timing information"
+%               ""
+%               "See default strategy with option '-vs'"
+%
+function [maptab]=gpart(npart,adj_mat,vlist,vwgt,ewgt,...
+                        varargin)
+
+if ~nargin
+    help gpart
+    return
+end
+
+%  gmap_mex uses static variables, so clear those out before every run
+clear gmap_mex
+
+[maptab]=gmap_mex(npart,adj_mat,vlist,vwgt,ewgt,...
+                  varargin{:});
+
+%  doesn't hurt to clear out after every run, too
+clear gmap_mex
+
+end
Index: /issm/trunk/externalpackages/scotch/scotch.patch
===================================================================
--- /issm/trunk/externalpackages/scotch/scotch.patch	(revision 3649)
+++ /issm/trunk/externalpackages/scotch/scotch.patch	(revision 3650)
@@ -1,8 +1,8 @@
-Only in new2: bin
-Only in new2: include
-Only in new2: lib
-diff -rc src/src/libscotch/arch.c new2/src/libscotch/arch.c
+Only in new3: bin
+Only in new3: include
+Only in new3: lib
+diff -rc src/src/libscotch/arch.c new3/src/libscotch/arch.c
 *** src/src/libscotch/arch.c	2008-09-27 07:48:01.000000000 -0700
---- new2/src/libscotch/arch.c	2010-04-26 10:35:09.779996545 -0700
+--- new3/src/libscotch/arch.c	2010-04-30 10:28:22.088131040 -0700
 ***************
 *** 173,187 ****
@@ -68,7 +68,7 @@
         memset     (archptr, 0, sizeof (Arch));     /* Initialize architecture body */
         return     (1);
-diff -rc src/src/libscotch/arch_cmplt.c new2/src/libscotch/arch_cmplt.c
+diff -rc src/src/libscotch/arch_cmplt.c new3/src/libscotch/arch_cmplt.c
 *** src/src/libscotch/arch_cmplt.c	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_cmplt.c	2010-04-26 10:35:09.786996551 -0700
+--- new3/src/libscotch/arch_cmplt.c	2010-04-30 10:28:22.093131042 -0700
 ***************
 *** 90,99 ****
@@ -120,7 +120,7 @@
       return     (1);
     }
-diff -rc src/src/libscotch/arch_cmplt.h new2/src/libscotch/arch_cmplt.h
+diff -rc src/src/libscotch/arch_cmplt.h new3/src/libscotch/arch_cmplt.h
 *** src/src/libscotch/arch_cmplt.h	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_cmplt.h	2010-04-26 10:35:09.794996558 -0700
+--- new3/src/libscotch/arch_cmplt.h	2010-04-30 10:28:22.098131044 -0700
 ***************
 *** 87,93 ****
@@ -137,7 +137,7 @@
   #define archCmpltArchFree           NULL
   ArchDomNum                  archCmpltDomNum     (const ArchCmplt * const, const ArchCmpltDom * const);
-diff -rc src/src/libscotch/arch_cmpltw.c new2/src/libscotch/arch_cmpltw.c
+diff -rc src/src/libscotch/arch_cmpltw.c new3/src/libscotch/arch_cmpltw.c
 *** src/src/libscotch/arch_cmpltw.c	2008-08-27 14:22:22.000000000 -0700
---- new2/src/libscotch/arch_cmpltw.c	2010-04-26 10:35:09.801996564 -0700
+--- new3/src/libscotch/arch_cmpltw.c	2010-04-30 10:28:22.103131046 -0700
 ***************
 *** 200,211 ****
@@ -209,7 +209,7 @@
         return     (1);
       }
-diff -rc src/src/libscotch/arch_cmpltw.h new2/src/libscotch/arch_cmpltw.h
+diff -rc src/src/libscotch/arch_cmpltw.h new3/src/libscotch/arch_cmpltw.h
 *** src/src/libscotch/arch_cmpltw.h	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_cmpltw.h	2010-04-26 10:35:09.809996571 -0700
+--- new3/src/libscotch/arch_cmpltw.h	2010-04-30 10:28:22.108131048 -0700
 ***************
 *** 86,92 ****
@@ -226,7 +226,7 @@
   int                         archCmpltwArchFree  (ArchCmpltw * restrict const);
   ArchDomNum                  archCmpltwDomNum    (const ArchCmpltw * const, const ArchCmpltwDom * const);
-diff -rc src/src/libscotch/arch_deco.c new2/src/libscotch/arch_deco.c
+diff -rc src/src/libscotch/arch_deco.c new3/src/libscotch/arch_deco.c
 *** src/src/libscotch/arch_deco.c	2008-09-28 06:35:27.000000000 -0700
---- new2/src/libscotch/arch_deco.c	2010-04-26 10:35:09.816996577 -0700
+--- new3/src/libscotch/arch_deco.c	2010-04-30 10:28:22.153131068 -0700
 ***************
 *** 211,217 ****
@@ -267,7 +267,7 @@
     if ((sizeof (ArchDeco)    > sizeof (ArchDummy)) ||
         (sizeof (ArchDecoDom) > sizeof (ArchDomDummy))) {
-diff -rc src/src/libscotch/arch_deco.h new2/src/libscotch/arch_deco.h
+diff -rc src/src/libscotch/arch_deco.h new3/src/libscotch/arch_deco.h
 *** src/src/libscotch/arch_deco.h	2008-09-27 07:49:46.000000000 -0700
---- new2/src/libscotch/arch_deco.h	2010-04-26 10:35:09.823996583 -0700
+--- new3/src/libscotch/arch_deco.h	2010-04-30 10:28:22.158131070 -0700
 ***************
 *** 113,119 ****
@@ -284,7 +284,7 @@
   int                         archDecoArchFree    (ArchDeco * const);
   Anum                        archDecoArchSize    (ArchDeco * const, const Anum);
-diff -rc src/src/libscotch/arch.h new2/src/libscotch/arch.h
+diff -rc src/src/libscotch/arch.h new3/src/libscotch/arch.h
 *** src/src/libscotch/arch.h	2009-04-28 08:11:27.000000000 -0700
---- new2/src/libscotch/arch.h	2010-04-26 10:35:09.831996590 -0700
+--- new3/src/libscotch/arch.h	2010-04-30 10:28:22.163131072 -0700
 ***************
 *** 175,181 ****
@@ -301,7 +301,7 @@
   char *                      archName            (const Arch * const);
   const ArchClass *           archClass           (const char * const);
-diff -rc src/src/libscotch/arch_hcub.c new2/src/libscotch/arch_hcub.c
+diff -rc src/src/libscotch/arch_hcub.c new3/src/libscotch/arch_hcub.c
 *** src/src/libscotch/arch_hcub.c	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_hcub.c	2010-04-26 10:35:09.838996596 -0700
+--- new3/src/libscotch/arch_hcub.c	2010-04-30 10:28:22.169131075 -0700
 ***************
 *** 88,95 ****
@@ -349,7 +349,7 @@
       errorPrint ("archHcubArchLoad: bad input");
       return     (1);
-diff -rc src/src/libscotch/arch_hcub.h new2/src/libscotch/arch_hcub.h
+diff -rc src/src/libscotch/arch_hcub.h new3/src/libscotch/arch_hcub.h
 *** src/src/libscotch/arch_hcub.h	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_hcub.h	2010-04-26 10:35:09.845996602 -0700
+--- new3/src/libscotch/arch_hcub.h	2010-04-30 10:28:22.174131077 -0700
 ***************
 *** 85,91 ****
@@ -366,7 +366,7 @@
   #define archHcubArchFree            NULL
   ArchDomNum                  archHcubDomNum      (const ArchHcub * const, const ArchHcubDom * const);
-diff -rc src/src/libscotch/arch_mesh.c new2/src/libscotch/arch_mesh.c
+diff -rc src/src/libscotch/arch_mesh.c new3/src/libscotch/arch_mesh.c
 *** src/src/libscotch/arch_mesh.c	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_mesh.c	2010-04-26 10:35:09.853996609 -0700
+--- new3/src/libscotch/arch_mesh.c	2010-04-30 10:28:22.179131079 -0700
 ***************
 *** 96,103 ****
@@ -465,7 +465,7 @@
       return     (1);
     }
-diff -rc src/src/libscotch/arch_mesh.h new2/src/libscotch/arch_mesh.h
+diff -rc src/src/libscotch/arch_mesh.h new3/src/libscotch/arch_mesh.h
 *** src/src/libscotch/arch_mesh.h	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_mesh.h	2010-04-26 10:35:09.860996615 -0700
+--- new3/src/libscotch/arch_mesh.h	2010-04-30 10:28:22.184131082 -0700
 ***************
 *** 96,102 ****
@@ -496,7 +496,7 @@
   #define archMesh3ArchFree           NULL
   ArchDomNum                  archMesh3DomNum     (const ArchMesh3 * const, const ArchMesh3Dom * const);
-diff -rc src/src/libscotch/arch_tleaf.c new2/src/libscotch/arch_tleaf.c
+diff -rc src/src/libscotch/arch_tleaf.c new3/src/libscotch/arch_tleaf.c
 *** src/src/libscotch/arch_tleaf.c	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_tleaf.c	2010-04-26 10:35:09.867996621 -0700
+--- new3/src/libscotch/arch_tleaf.c	2010-04-30 10:28:22.189131084 -0700
 ***************
 *** 92,99 ****
@@ -554,7 +554,7 @@
       return     (1);
     }
-diff -rc src/src/libscotch/arch_tleaf.h new2/src/libscotch/arch_tleaf.h
+diff -rc src/src/libscotch/arch_tleaf.h new3/src/libscotch/arch_tleaf.h
 *** src/src/libscotch/arch_tleaf.h	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_tleaf.h	2010-04-26 10:35:09.875996627 -0700
+--- new3/src/libscotch/arch_tleaf.h	2010-04-30 10:28:22.194131086 -0700
 ***************
 *** 89,95 ****
@@ -571,7 +571,7 @@
   #define archTleafArchFree           NULL
   ArchDomNum                  archTleafDomNum     (const ArchTleaf * const, const ArchTleafDom * const);
-diff -rc src/src/libscotch/arch_torus.c new2/src/libscotch/arch_torus.c
+diff -rc src/src/libscotch/arch_torus.c new3/src/libscotch/arch_torus.c
 *** src/src/libscotch/arch_torus.c	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_torus.c	2010-04-26 10:35:09.883996634 -0700
+--- new3/src/libscotch/arch_torus.c	2010-04-30 10:28:22.199131088 -0700
 ***************
 *** 90,97 ****
@@ -670,7 +670,7 @@
       return     (1);
     }
-diff -rc src/src/libscotch/arch_torus.h new2/src/libscotch/arch_torus.h
+diff -rc src/src/libscotch/arch_torus.h new3/src/libscotch/arch_torus.h
 *** src/src/libscotch/arch_torus.h	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/arch_torus.h	2010-04-26 10:35:09.890996640 -0700
+--- new3/src/libscotch/arch_torus.h	2010-04-30 10:28:22.204131090 -0700
 ***************
 *** 96,102 ****
@@ -701,7 +701,7 @@
   #define archTorus3ArchFree          NULL
   ArchDomNum                  archTorus3DomNum    (const ArchTorus3 * const, const ArchTorus3Dom * const);
-diff -rc src/src/libscotch/common.c new2/src/libscotch/common.c
+diff -rc src/src/libscotch/common.c new3/src/libscotch/common.c
 *** src/src/libscotch/common.c	2008-05-22 06:44:41.000000000 -0700
---- new2/src/libscotch/common.c	2010-04-26 10:35:09.897996646 -0700
+--- new3/src/libscotch/common.c	2010-04-30 10:28:22.209131092 -0700
 ***************
 *** 100,106 ****
@@ -720,7 +720,7 @@
 + #endif /* MATLAB */
   }
-diff -rc src/src/libscotch/common.h new2/src/libscotch/common.h
+diff -rc src/src/libscotch/common.h new3/src/libscotch/common.h
 *** src/src/libscotch/common.h	2009-02-06 14:20:55.000000000 -0800
---- new2/src/libscotch/common.h	2010-04-06 15:51:57.604253000 -0700
+--- new3/src/libscotch/common.h	2010-05-03 14:22:16.763394855 -0700
 ***************
 *** 66,71 ****
@@ -756,10 +756,38 @@
   **  Working definitions.
   */
-diff -rc src/src/libscotch/common_integer.c new2/src/libscotch/common_integer.c
+***************
+*** 209,214 ****
+--- 224,230 ----
+  int                         intSave             (FILE * const, const INT);
+  void                        intAscn             (INT * const, const INT, const INT);
+  void                        intPerm             (INT * const, const INT);
++ void                        intRandResetStatic  (void);
+  void                        intRandReset        (void);
+  void                        intRandInit         (void);
+  INT                         intRandVal          (INT);
+diff -rc src/src/libscotch/common_integer.c new3/src/libscotch/common_integer.c
 *** src/src/libscotch/common_integer.c	2009-01-21 01:32:32.000000000 -0800
---- new2/src/libscotch/common_integer.c	2010-04-27 11:27:22.228561248 -0700
+--- new3/src/libscotch/common_integer.c	2010-05-03 14:21:44.014369358 -0700
+***************
+*** 191,196 ****
+--- 191,205 ----
+  static volatile int intrandflag = 0;              /*+ Flag set if generator already initialized +*/
+  static unsigned int intrandseed = 1;              /*+ Random seed                               +*/
+  
++ void
++ intRandResetStatic (void)
++ {
++   printf("intRandResetStatic begin -- intrandflag=%d,intrandseed=%d\n",intrandflag,intrandseed);
++   intrandflag = 0;              /*+ Flag set if generator already initialized +*/
++   intrandseed = 1;              /*+ Random seed                               +*/
++   printf("intRandResetStatic end   -- intrandflag=%d,intrandseed=%d\n",intrandflag,intrandseed);
++ }
++ 
+  /* This routine initializes the pseudo-random
+  ** generator if necessary. In order for multi-sequential
+  ** programs to have exactly the same behavior on any
 ***************
 *** 205,210 ****
---- 205,211 ----
+--- 214,220 ----
   void
   intRandInit (void)
@@ -771,5 +799,5 @@
 ***************
 *** 216,221 ****
---- 217,223 ----
+--- 226,232 ----
   #endif /* COMMON_RANDOM_RAND */
       intrandflag = 1;                              /* Generator has been initialized */
@@ -781,5 +809,5 @@
 ***************
 *** 228,233 ****
---- 230,236 ----
+--- 239,245 ----
   void
   intRandReset (void)
@@ -791,5 +819,5 @@
 ***************
 *** 237,242 ****
---- 240,246 ----
+--- 249,255 ----
     }
     else
@@ -799,8 +827,7 @@
   
   /*********************/
-Only in new2/src/libscotch: common_integer_old.c
-diff -rc src/src/libscotch/common_memory.c new2/src/libscotch/common_memory.c
+diff -rc src/src/libscotch/common_memory.c new3/src/libscotch/common_memory.c
 *** src/src/libscotch/common_memory.c	2009-01-03 02:16:11.000000000 -0800
---- new2/src/libscotch/common_memory.c	2010-04-29 14:32:20.883655193 -0700
+--- new3/src/libscotch/common_memory.c	2010-04-30 10:28:22.224131099 -0700
 ***************
 *** 87,93 ****
@@ -908,8 +935,7 @@
   }
   #endif /* COMMON_MEMORY_TRACE */
-Only in new2/src/libscotch: common_memory_old.c
-diff -rc src/src/libscotch/dummysizes.c new2/src/libscotch/dummysizes.c
+diff -rc src/src/libscotch/dummysizes.c new3/src/libscotch/dummysizes.c
 *** src/src/libscotch/dummysizes.c	2009-05-09 16:08:02.000000000 -0700
---- new2/src/libscotch/dummysizes.c	2010-04-26 10:35:09.912996659 -0700
+--- new3/src/libscotch/dummysizes.c	2010-04-30 10:28:22.229131101 -0700
 ***************
 *** 267,271 ****
@@ -922,7 +948,7 @@
 + #endif /* MATLAB */
   }
-diff -rc src/src/libscotch/graph.c new2/src/libscotch/graph.c
+diff -rc src/src/libscotch/graph.c new3/src/libscotch/graph.c
 *** src/src/libscotch/graph.c	2008-05-22 06:44:42.000000000 -0700
---- new2/src/libscotch/graph.c	2010-04-26 10:35:09.920996666 -0700
+--- new3/src/libscotch/graph.c	2010-04-30 10:28:22.234131103 -0700
 ***************
 *** 135,141 ****
@@ -945,7 +971,7 @@
       if ((grafptr->edlotax != NULL) &&
           ((grafptr->flagval & GRAPHEDGEGROUP) == 0))
-diff -rc src/src/libscotch/graph.h new2/src/libscotch/graph.h
+diff -rc src/src/libscotch/graph.h new3/src/libscotch/graph.h
 *** src/src/libscotch/graph.h	2008-06-01 02:49:11.000000000 -0700
---- new2/src/libscotch/graph.h	2010-04-26 10:35:09.927996672 -0700
+--- new3/src/libscotch/graph.h	2010-04-30 10:28:22.240131106 -0700
 ***************
 *** 159,165 ****
@@ -962,7 +988,7 @@
   int                         graphSave           (const Graph * const, FILE * const);
   Gnum                        graphBase           (Graph * const, const Gnum);
-diff -rc src/src/libscotch/graph_io.c new2/src/libscotch/graph_io.c
+diff -rc src/src/libscotch/graph_io.c new3/src/libscotch/graph_io.c
 *** src/src/libscotch/graph_io.c	2008-05-22 06:44:42.000000000 -0700
---- new2/src/libscotch/graph_io.c	2010-04-26 10:35:09.936996680 -0700
+--- new3/src/libscotch/graph_io.c	2010-04-30 10:28:22.245131108 -0700
 ***************
 *** 86,92 ****
@@ -1200,7 +1226,7 @@
     }
   
-diff -rc src/src/libscotch/graph_io_scot.c new2/src/libscotch/graph_io_scot.c
+diff -rc src/src/libscotch/graph_io_scot.c new3/src/libscotch/graph_io_scot.c
 *** src/src/libscotch/graph_io_scot.c	2008-05-22 06:44:42.000000000 -0700
---- new2/src/libscotch/graph_io_scot.c	2010-04-26 10:35:09.944996687 -0700
+--- new3/src/libscotch/graph_io_scot.c	2010-04-30 10:28:22.251131111 -0700
 ***************
 *** 89,95 ****
@@ -1217,7 +1243,7 @@
     }
   
-diff -rc src/src/libscotch/library_arch.c new2/src/libscotch/library_arch.c
+diff -rc src/src/libscotch/library_arch.c new3/src/libscotch/library_arch.c
 *** src/src/libscotch/library_arch.c	2008-05-22 06:44:42.000000000 -0700
---- new2/src/libscotch/library_arch.c	2010-04-26 10:35:09.952996693 -0700
+--- new3/src/libscotch/library_arch.c	2010-04-30 10:28:22.256131113 -0700
 ***************
 *** 120,128 ****
@@ -1252,7 +1278,7 @@
   
   /*+ This routine saves the given opaque
-diff -rc src/src/libscotch/library_arch_f.c new2/src/libscotch/library_arch_f.c
+diff -rc src/src/libscotch/library_arch_f.c new3/src/libscotch/library_arch_f.c
 *** src/src/libscotch/library_arch_f.c	2008-05-22 06:44:42.000000000 -0700
---- new2/src/libscotch/library_arch_f.c	2010-04-26 10:35:09.959996699 -0700
+--- new3/src/libscotch/library_arch_f.c	2010-04-30 10:28:22.260131115 -0700
 ***************
 *** 121,127 ****
@@ -1269,7 +1295,7 @@
     fclose (stream);                                /* This closes filenum too */
   
-diff -rc src/src/libscotch/library_error_exit.c new2/src/libscotch/library_error_exit.c
+diff -rc src/src/libscotch/library_error_exit.c new3/src/libscotch/library_error_exit.c
 *** src/src/libscotch/library_error_exit.c	2009-01-20 00:36:33.000000000 -0800
---- new2/src/libscotch/library_error_exit.c	2010-04-26 10:35:09.966996705 -0700
+--- new3/src/libscotch/library_error_exit.c	2010-04-30 10:28:22.265131117 -0700
 ***************
 *** 114,119 ****
@@ -1344,7 +1370,7 @@
 + #endif /* MATLAB */
   }
-diff -rc src/src/libscotch/library_graph.c new2/src/libscotch/library_graph.c
+diff -rc src/src/libscotch/library_graph.c new3/src/libscotch/library_graph.c
 *** src/src/libscotch/library_graph.c	2008-05-22 07:28:12.000000000 -0700
---- new2/src/libscotch/library_graph.c	2010-04-26 10:35:09.973996711 -0700
+--- new3/src/libscotch/library_graph.c	2010-04-30 10:28:22.270131119 -0700
 ***************
 *** 137,143 ****
@@ -1389,7 +1415,7 @@
   
   /*+ This routine saves the contents of the given
-diff -rc src/src/libscotch/library_graph_f.c new2/src/libscotch/library_graph_f.c
+diff -rc src/src/libscotch/library_graph_f.c new3/src/libscotch/library_graph_f.c
 *** src/src/libscotch/library_graph_f.c	2008-05-22 06:44:43.000000000 -0700
---- new2/src/libscotch/library_graph_f.c	2010-04-26 10:35:09.981996718 -0700
+--- new3/src/libscotch/library_graph_f.c	2010-04-30 10:28:22.275131121 -0700
 ***************
 *** 136,142 ****
@@ -1406,7 +1432,7 @@
     fclose (stream);                                /* This closes filenum too */
   
-diff -rc src/src/libscotch/library_graph_map.c new2/src/libscotch/library_graph_map.c
+diff -rc src/src/libscotch/library_graph_map.c new3/src/libscotch/library_graph_map.c
 *** src/src/libscotch/library_graph_map.c	2008-09-28 04:04:05.000000000 -0700
---- new2/src/libscotch/library_graph_map.c	2010-04-06 15:51:57.678253000 -0700
+--- new3/src/libscotch/library_graph_map.c	2010-04-30 10:28:22.280131123 -0700
 ***************
 *** 182,192 ****
@@ -1431,7 +1457,7 @@
   
   /*+ This routine computes a mapping
-diff -rc src/src/libscotch/library_graph_map_f.c new2/src/libscotch/library_graph_map_f.c
+diff -rc src/src/libscotch/library_graph_map_f.c new3/src/libscotch/library_graph_map_f.c
 *** src/src/libscotch/library_graph_map_f.c	2008-06-28 03:44:26.000000000 -0700
---- new2/src/libscotch/library_graph_map_f.c	2010-04-26 10:35:09.995996730 -0700
+--- new3/src/libscotch/library_graph_map_f.c	2010-04-30 10:28:22.285131126 -0700
 ***************
 *** 183,189 ****
@@ -1448,8 +1474,7 @@
     fclose (stream);                                /* This closes filenum too */
   
-Only in new2/src/libscotch: library_graph_map_save.c
-diff -rc src/src/libscotch/library.h new2/src/libscotch/library.h
+diff -rc src/src/libscotch/library.h new3/src/libscotch/library.h
 *** src/src/libscotch/library.h	2009-05-09 16:08:03.000000000 -0700
---- new2/src/libscotch/library.h	2010-04-26 10:35:10.002996736 -0700
+--- new3/src/libscotch/library.h	2010-04-30 10:28:22.291131128 -0700
 ***************
 *** 134,140 ****
@@ -1494,7 +1519,7 @@
   int                         SCOTCH_graphMapCompute (const SCOTCH_Graph * const, SCOTCH_Mapping * const, const SCOTCH_Strat * const);
   int                         SCOTCH_graphMap     (const SCOTCH_Graph * const, const SCOTCH_Arch * const, const SCOTCH_Strat * const, SCOTCH_Num * const);
-diff -rc src/src/libscotch/Makefile new2/src/libscotch/Makefile
+diff -rc src/src/libscotch/Makefile new3/src/libscotch/Makefile
 *** src/src/libscotch/Makefile	2009-05-09 16:08:04.000000000 -0700
---- new2/src/libscotch/Makefile	2010-04-26 10:35:10.011996000 -0700
+--- new3/src/libscotch/Makefile	2010-04-30 10:28:22.297131131 -0700
 ***************
 *** 49,55 ****
@@ -1533,8 +1558,7 @@
   					-$(CP) scotch.h scotchf.h $(includedir)
   					-$(CP) libscotch$(LIB) libscotcherr*$(LIB) $(libdir)
-Only in new2/src/libscotch: Makefile_save
-diff -rc src/src/libscotch/mapping.h new2/src/libscotch/mapping.h
+diff -rc src/src/libscotch/mapping.h new3/src/libscotch/mapping.h
 *** src/src/libscotch/mapping.h	2008-10-27 08:27:47.000000000 -0700
---- new2/src/libscotch/mapping.h	2010-04-26 10:35:10.019996751 -0700
+--- new3/src/libscotch/mapping.h	2010-04-30 10:28:22.302131133 -0700
 ***************
 *** 106,112 ****
@@ -1551,7 +1575,7 @@
   
   #undef static
-diff -rc src/src/libscotch/mapping_io.c new2/src/libscotch/mapping_io.c
+diff -rc src/src/libscotch/mapping_io.c new3/src/libscotch/mapping_io.c
 *** src/src/libscotch/mapping_io.c	2008-05-22 06:44:43.000000000 -0700
---- new2/src/libscotch/mapping_io.c	2010-04-26 10:35:10.026996757 -0700
+--- new3/src/libscotch/mapping_io.c	2010-04-30 10:28:22.307131135 -0700
 ***************
 *** 199,204 ****
@@ -1640,7 +1664,7 @@
     return (0);
   }
-diff -rc src/src/libscotch/mesh_io_scot.c new2/src/libscotch/mesh_io_scot.c
+diff -rc src/src/libscotch/mesh_io_scot.c new3/src/libscotch/mesh_io_scot.c
 *** src/src/libscotch/mesh_io_scot.c	2008-05-22 06:44:43.000000000 -0700
---- new2/src/libscotch/mesh_io_scot.c	2010-04-26 10:35:10.033996763 -0700
+--- new3/src/libscotch/mesh_io_scot.c	2010-04-30 10:28:22.312131137 -0700
 ***************
 *** 85,91 ****
@@ -1657,7 +1681,20 @@
     }
   
-diff -rc src/src/libscotch/parser_ll.l new2/src/libscotch/parser_ll.l
+diff -rc src/src/libscotch/module.h new3/src/libscotch/module.h
+*** src/src/libscotch/module.h	2009-04-26 23:07:14.000000000 -0700
+--- new3/src/libscotch/module.h	2010-05-03 14:48:29.655638124 -0700
+***************
+*** 156,161 ****
+--- 156,162 ----
+  #define intSave                     _SCOTCHintSave
+  #define intAscn                     _SCOTCHintAscn
+  #define intPerm                     _SCOTCHintPerm
++ #define intRandResetStatic          _SCOTCHintRandResetStatic
+  #define intRandReset                _SCOTCHintRandReset
+  #define intRandInit                 _SCOTCHintRandInit
+  /* #define intRandVal               _SCOTCHintRandVal Already a macro */
+diff -rc src/src/libscotch/parser_ll.l new3/src/libscotch/parser_ll.l
 *** src/src/libscotch/parser_ll.l	2008-05-22 06:44:43.000000000 -0700
---- new2/src/libscotch/parser_ll.l	2010-04-29 14:45:27.766400063 -0700
+--- new3/src/libscotch/parser_ll.l	2010-04-30 10:28:22.318131140 -0700
 ***************
 *** 192,197 ****
@@ -1686,9 +1723,7 @@
     yyrestart (yyin);                               /* (Re-)initialize the parser */
   #endif /* FLEX_SCANNER */
-Only in new2/src/libscotch: parser_ll_save.c
-Only in new2/src/libscotch: parser_yy_save.c
-diff -rc src/src/libscotch/parser_yy.y new2/src/libscotch/parser_yy.y
+diff -rc src/src/libscotch/parser_yy.y new3/src/libscotch/parser_yy.y
 *** src/src/libscotch/parser_yy.y	2008-10-22 15:12:48.000000000 -0700
---- new2/src/libscotch/parser_yy.y	2010-04-29 11:48:09.378829347 -0700
+--- new3/src/libscotch/parser_yy.y	2010-04-30 10:28:22.363131160 -0700
 ***************
 *** 774,779 ****
@@ -1701,7 +1736,7 @@
     if (stratParserParse2 () != 0) {                /* Parse the strategy string */
       if (parserstratcurr != NULL)
-diff -rc src/src/libscotch/vgraph_separate_vw.c new2/src/libscotch/vgraph_separate_vw.c
+diff -rc src/src/libscotch/vgraph_separate_vw.c new3/src/libscotch/vgraph_separate_vw.c
 *** src/src/libscotch/vgraph_separate_vw.c	2008-05-22 06:44:43.000000000 -0700
---- new2/src/libscotch/vgraph_separate_vw.c	2010-04-27 11:34:15.756132566 -0700
+--- new3/src/libscotch/vgraph_separate_vw.c	2010-04-30 10:28:22.368131162 -0700
 ***************
 *** 83,88 ****
@@ -1723,9 +1758,7 @@
     return (0);
   }
-Only in new2/src/libscotch: .vgraph_separate_vw.c.swp
-Only in new2/src/libscotch: vgraph_separate_vw_old.c
-diff -rc src/src/Makefile new2/src/Makefile
+diff -rc src/src/Makefile new3/src/Makefile
 *** src/src/Makefile	2008-09-15 05:50:51.000000000 -0700
---- new2/src/Makefile	2010-04-26 10:35:10.040996769 -0700
+--- new3/src/Makefile	2010-04-30 10:28:22.373131164 -0700
 ***************
 *** 97,102 ****
@@ -1741,10 +1774,10 @@
   					-$(CP) -f ../bin/[agm]*$(EXE) $(bindir)
   					-$(CP) -f ../include/*scotch*.h $(includedir)
-Only in new2/src: Makefile.inc
-Only in new2/src/scotch: gmap_mex.c
-Only in new2/src/scotch: gmapx.c
-diff -rc src/src/scotch/Makefile new2/src/scotch/Makefile
+Only in new3/src: Makefile.inc
+Only in new3/src/scotch: gmap_mex.c
+Only in new3/src/scotch: gmapx.c
+diff -rc src/src/scotch/Makefile new3/src/scotch/Makefile
 *** src/src/scotch/Makefile	2009-04-27 02:19:43.000000000 -0700
---- new2/src/scotch/Makefile	2010-04-26 10:35:10.048996776 -0700
+--- new3/src/scotch/Makefile	2010-04-30 10:28:22.379131167 -0700
 ***************
 *** 49,59 ****
Index: /issm/trunk/externalpackages/scotch/scotch_jes_notes.txt
===================================================================
--- /issm/trunk/externalpackages/scotch/scotch_jes_notes.txt	(revision 3649)
+++ /issm/trunk/externalpackages/scotch/scotch_jes_notes.txt	(revision 3650)
@@ -297,2 +297,7 @@
 - inserted print statements into common_integer.c/intRand*, common_memory.c/mem*, and vgraph_separate_vw.c/vgraphSeparateVw to monitor static variables in case those have to be reset.
 
+5/03/10:
+
+- implemented gpart functionality in gmap_mex.c, gmapx.c, and new gpart.m.
+- implemented common_integer.c/intRandResetStatic to reset static variables from previous runs.
+
