Index: /issm/trunk/externalpackages/scotch/install.sh
===================================================================
--- /issm/trunk/externalpackages/scotch/install.sh	(revision 4628)
+++ /issm/trunk/externalpackages/scotch/install.sh	(revision 4629)
@@ -39,7 +39,9 @@
 cp -pr src/doc install
 cp -pr src/man install
+mkdir install/lib
+mv src/lib/* install/lib
 mkdir install/bin
 mv src/bin/* install/bin
-cp -p gmap.m install/bin
-cp -p gpart.m install/bin
+#cp -p gmap.m install/bin
+#cp -p gpart.m install/bin
 
Index: /issm/trunk/externalpackages/scotch/mex/Gmap.c
===================================================================
--- /issm/trunk/externalpackages/scotch/mex/Gmap.c	(revision 4629)
+++ /issm/trunk/externalpackages/scotch/mex/Gmap.c	(revision 4629)
@@ -0,0 +1,286 @@
+
+#define THISFUNCTION "Gmap"
+
+/*  Gmap structures and prototypes  */
+
+#ifdef MATLAB
+		#include "mat.h"
+		#include "mex.h"
+		#include "matrix.h"
+
+		#define printf mexPrintf
+		#define fprintf(file,...) (file == stdout || file == stderr ? mexPrintf(__VA_ARGS__) : fprintf(file,__VA_ARGS__))
+		#define malloc mxMalloc
+		#define calloc mxCalloc
+		#define realloc mxRealloc
+		#define free mxFree
+		#define exit(status) mexErrMsgTxt("exit=" #status)
+#endif
+
+void GmapUsage( void );
+
+
+int
+Gmapx (
+	int                 (**pmaptabi)[2],
+	int                 argcm,
+	char                *argvm[],
+	int                 nvi,
+	int                 ne2i,
+	int                 *ir,
+	int                 *jc,
+	int                 *vli,
+	int                 *vwi,
+	int                 *ewi,
+	char                archtyp[],
+	int                 nai,
+	int                 *api);
+
+/******************************/
+/*                            */
+/* This is the main function. */
+/*                            */
+/******************************/
+
+void mexFunction( int nlhs,
+				  mxArray *plhs[],
+				  int nrhs,
+				  const mxArray *prhs[] )
+{
+	int     argcm;
+	char    **argvm=NULL;
+	int     nvert =0,nedge2=0,napar =0;
+	mwIndex *ir=NULL,*jc=NULL;
+	int     *adjir=NULL,*adjjc=NULL;
+	double  *vld=NULL,*vwd=NULL,*ewd=NULL,*apd=NULL;
+	int     *vli=NULL,*vwi=NULL,*ewi=NULL,*api=NULL;
+	char    *archtyp=NULL;
+	int     (*maptabi)[2]=NULL;
+	double* maptabd=NULL;
+	int     i,j,k,imi=0,imo=0,isi=0,ierr;
+
+	/* Check for proper number of arguments */
+   
+	if      (nrhs == 0 && nlhs == 0) {
+		GmapUsage();
+		return;
+	}
+	else if (nrhs <  6 || nlhs >  1) {
+		GmapUsage();
+		mexErrMsgTxt(" ");
+	}
+
+/*  load matlab argument list and convert to integer (note that converting here
+	and in the x-layer is inefficient, but it makes the x-layer more general)  */
+
+	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(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(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(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(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(prhs[imi]),mxGetN(prhs[imi]));
+	}
+	imi++;
+
+	if (!mxIsNumeric(prhs[imi])) {
+		mexPrintf("%s -- Vertex weight vector must be numeric.\n",THISFUNCTION);
+		mexErrMsgTxt(" ");
+	}
+	else {
+		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(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(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(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);
+	for (i=0; i<argcm; i++)
+		mexPrintf("argvm[%d]=\"%s\"\n",i,argvm[i]);
+
+	/* Do the actual computations in a subroutine */
+
+	mexPrintf("Gmapx:\n");
+	ierr=Gmapx(&maptabi,
+			   argcm,
+			   argvm,
+			   nvert,
+			   nedge2,
+			   adjir,
+			   adjjc,
+			   vli,
+			   vwi,
+			   ewi,
+			   archtyp,
+			   napar,
+			   api);
+	mexPrintf("%s -- Error %d from Gmapx.\n",THISFUNCTION,ierr);
+
+/*  for (i=0; i<nvert; i++)
+		mexPrintf("maptabi[%d][0]=%d, maptabi[%d][1]=%d\n",
+			 	  i,maptabi[i][0],i,maptabi[i][1]); */
+
+	/* Create matrices for the return arguments */
+
+	if (maptabi) {
+		plhs[imo]=mxCreateDoubleMatrix(nvert, 2, mxREAL);
+		maptabd = mxGetPr(plhs[imo]);
+		k=0;
+		for (j=0; j<2; j++)
+			for (i=0; i<nvert; i++)
+				maptabd[k++]=(double)maptabi[i][j];
+		free(maptabi);
+	}
+	else {
+		plhs[imo]=mxCreateDoubleMatrix(0, 2, mxREAL);
+	}
+	imo++;
+
+	if (argvm)
+		for (i=argcm-1; i>=0; i--)
+			free(argvm[i]);
+	if (api)     free(api);
+	if (archtyp) free(archtyp);
+	if (ewi)     free(ewi);
+	if (vwi)     free(vwi);
+	if (vli)     free(vli);
+	if (adjjc)   free(adjjc);
+	if (adjir)   free(adjir);
+
+	return;
+}
+
+void GmapUsage( void )
+{
+
+    mexPrintf("\n");
+    mexPrintf("Usage: [maptab]=Gmap(adjmat,vertlb,vertwt,edgewt,archtyp,archpar,\n");
+    mexPrintf("                         Scotch-specific parameters);\n");
+    mexPrintf("\n");
+
+    return;
+}
+
Index: /issm/trunk/externalpackages/scotch/mex/Gmapx.c
===================================================================
--- /issm/trunk/externalpackages/scotch/mex/Gmapx.c	(revision 4629)
+++ /issm/trunk/externalpackages/scotch/mex/Gmapx.c	(revision 4629)
@@ -0,0 +1,385 @@
+/* Copyright 2004,2007,2008 ENSEIRB, INRIA & CNRS
+**
+** This file is part of the Scotch software package for static mapping,
+** graph partitioning and sparse matrix ordering.
+**
+** This software is governed by the CeCILL-C license under French law
+** and abiding by the rules of distribution of free software. You can
+** use, modify and/or redistribute the software under the terms of the
+** CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
+** URL: "http://www.cecill.info".
+** 
+** As a counterpart to the access to the source code and rights to copy,
+** modify and redistribute granted by the license, users are provided
+** only with a limited warranty and the software's author, the holder of
+** the economic rights, and the successive licensors have only limited
+** liability.
+** 
+** In this respect, the user's attention is drawn to the risks associated
+** with loading, using, modifying and/or developing or reproducing the
+** software by the user in light of its specific status of free software,
+** that may mean that it is complicated to manipulate, and that also
+** therefore means that it is reserved for developers and experienced
+** professionals having in-depth computer knowledge. Users are therefore
+** encouraged to load and test the software's suitability as regards
+** their requirements in conditions enabling the security of their
+** systems and/or data to be ensured and, more generally, to use and
+** operate it in the same conditions as regards security.
+** 
+** The fact that you are presently reading this means that you have had
+** knowledge of the CeCILL-C license and that you accept its terms.
+*/
+/************************************************************/
+/**                                                        **/
+/**   NAME       : gmap.c                                  **/
+/**                                                        **/
+/**   AUTHOR     : Francois PELLEGRINI                     **/
+/**                                                        **/
+/**   FUNCTION   : Part of a graph mapping software.       **/
+/**                This module contains the main function. **/
+/**                                                        **/
+/**   DATES      : # Version 0.0  : from : 05 jan 1993     **/
+/**                                 to     12 may 1993     **/
+/**                # Version 1.1  : from : 15 oct 1993     **/
+/**                                 to     15 oct 1993     **/
+/**                # Version 1.3  : from : 06 apr 1994     **/
+/**                                 to     18 may 1994     **/
+/**                # Version 2.0  : from : 06 jun 1994     **/
+/**                                 to     17 nov 1994     **/
+/**                # Version 2.1  : from : 07 apr 1995     **/
+/**                                 to     18 jun 1995     **/
+/**                # Version 3.0  : from : 01 jul 1995     **/
+/**                                 to     02 oct 1995     **/
+/**                # Version 3.1  : from : 07 nov 1995     **/
+/**                                 to     25 apr 1996     **/
+/**                # Version 3.2  : from : 24 sep 1996     **/
+/**                                 to     26 may 1998     **/
+/**                # Version 3.3  : from : 19 oct 1998     **/
+/**                                 to   : 30 mar 1999     **/
+/**                # Version 3.4  : from : 03 feb 2000     **/
+/**                                 to   : 03 feb 2000     **/
+/**                # Version 4.0  : from : 16 jan 2004     **/
+/**                                 to   : 27 dec 2004     **/
+/**                # Version 5.0  : from : 23 dec 2007     **/
+/**                                 to   : 18 jun 2008     **/
+/**                                                        **/
+/************************************************************/
+
+/*
+**  The defines and includes.
+*/
+
+#define GMAP
+
+#include "module.h"
+#include "common.h"
+#include "scotch.h"
+#include "gmap.h"
+
+/*
+**  The static variables.
+*/
+
+static int                  C_partNbr = 2;        /* Default number of parts     */
+static int                  C_paraNum = 0;        /* Number of parameters        */
+static int                  C_paraNbr = 0;        /* No parameters for mapping   */
+static int                  C_fileNum = 0;        /* Number of file in arg list  */
+static int                  C_fileNbr = 4;        /* Number of files for mapping */
+static File                 C_fileTab[C_FILENBR] = { /* File array               */
+                              { "-", NULL, "r" },
+                              { "-", NULL, "r" },
+                              { "-", NULL, "w" },
+                              { "-", NULL, "w" } };
+
+static const char *         C_usageList[] = {     /* Usage */
+  "gmap [<input source file> [<input target file> [<output mapping file> [<output log file>]]]] <options>",
+  "gpart [<nparts>] [<input source file> [<output mapping file> [<output log file>]]] <options>",
+  "  -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'",
+  NULL };
+
+/******************************/
+/*                            */
+/* This is the main function. */
+/*                            */
+/******************************/
+
+int
+Gmapx (
+  int                 (**pmaptabi)[2],
+  int                 argcm,
+  char                *argvm[],
+  int                 nvi,
+  int                 ne2i,
+  int                 *ir,
+  int                 *jc,
+  int                 *vli,
+  int                 *vwi,
+  int                 *ewi,
+  char                archtyp[],
+  int                 nai,
+  int                 *api)
+{
+  SCOTCH_Graph        grafdat;                    /* Source graph            */
+  SCOTCH_Num          grafflag;                   /* Source graph properties */
+  SCOTCH_Arch         archdat;                    /* Target architecture     */
+  SCOTCH_Strat        stradat;                    /* Mapping strategy        */
+  SCOTCH_Mapping      mapdat;                     /* Mapping data            */
+  Clock               runtime[2];                 /* Timing variables        */
+  SCOTCH_Num          nvert =0;
+  SCOTCH_Num          nedge2=0;
+  SCOTCH_Num*         adjir  =NULL;
+  SCOTCH_Num*         adjjc  =NULL;
+  SCOTCH_Num*         vertlab=NULL;
+  SCOTCH_Num*         vertwgt=NULL;
+  SCOTCH_Num*         edgewgt=NULL;
+  SCOTCH_Num          napar =0;
+  SCOTCH_Num*         archpar=NULL;
+  SCOTCH_Num          (*maptab)[2]=NULL;
+  int                 (*maptabi)[2]=NULL;
+  int                 flagval;
+  int                 i,j,k;
+
+/*  reset static variables from previous runs (jes, 4/27/10)  */
+
+  C_partNbr = 2;        /* Default number of parts     */
+  C_paraNum = 0;        /* Number of parameters        */
+  C_paraNbr = 0;        /* No parameters for mapping   */
+  C_fileNum = 0;        /* Number of file in arg list  */
+  C_fileNbr = 4;        /* Number of files for mapping */
+  for (i=0; i<C_FILENBR; i++) {
+    C_fileTab[i].name = "-";
+    C_fileTab[i].pntr = NULL;
+    if (i < 2)
+      C_fileTab[i].mode = "r";
+    else
+      C_fileTab[i].mode = "w";
+  }
+
+/*  convert input arguments to scotch data types  */
+
+  nvert =(SCOTCH_Num)nvi;
+  nedge2=(SCOTCH_Num)ne2i;
+
+  if (ir && jc) {
+    adjir = (SCOTCH_Num *) malloc(nedge2*sizeof(SCOTCH_Num));
+    for (i=0; i<nedge2; i++)
+      adjir[i]=(SCOTCH_Num)ir[i];
+    adjjc = (SCOTCH_Num *) malloc((nvert+1)*sizeof(SCOTCH_Num));
+    for (i=0; i<(nvert+1); i++)
+      adjjc[i]=(SCOTCH_Num)jc[i];
+  }
+
+  if (vli) {
+    vertlab = (SCOTCH_Num *) malloc(nvert*sizeof(SCOTCH_Num));
+    for (i=0; i<nvert; i++)
+      vertlab[i]=(SCOTCH_Num)vli[i];
+  }
+
+  if (vwi) {
+    vertwgt = (SCOTCH_Num *) malloc(nvert*sizeof(SCOTCH_Num));
+    for (i=0; i<nvert; i++)
+      vertwgt[i]=(SCOTCH_Num)vwi[i];
+  }
+
+  if (ewi) {
+    edgewgt = (SCOTCH_Num *) malloc(nedge2*sizeof(SCOTCH_Num));
+    for (i=0; i<nedge2; i++)
+      edgewgt[i]=(SCOTCH_Num)ewi[i];
+  }
+
+  napar =(SCOTCH_Num)nai;
+
+  if (api) {
+    archpar = (SCOTCH_Num *) malloc(nai*sizeof(SCOTCH_Num));
+    for (i=0; i<nai; i++)
+      archpar[i]=(SCOTCH_Num)api[i];
+  }
+
+/*  start scotch processing  */
+
+  flagval = C_FLAGNONE;                           /* Default behavior */
+  i = strlen (argvm[0]);
+  if ((i >= 5) && (strncmp (argvm[0] + i - 5, "Gpart", 5) == 0)) {
+    flagval |= C_FLAGPART;
+    C_paraNbr = 1;                                /* One more parameter       */
+    C_fileNbr = 3;                                /* One less file to provide */
+    errorProg ("Gpart");
+  }
+  else
+    errorProg ("Gmap");
+
+  intRandResetStatic ();
+  intRandInit ();
+
+  if ((argcm >= 2) && (argvm[1][0] == '?')) {       /* If need for help */
+    usagePrint (stdout, C_usageList);
+    return     (0);
+  }
+
+  grafflag = 0;                                   /* Use vertex and edge weights  */
+  SCOTCH_stratInit (&stradat);                    /* Set default mapping strategy */
+
+  for (i = 0; i < C_FILENBR; i ++)                /* Set default stream pointers */
+    C_fileTab[i].pntr = (C_fileTab[i].mode[0] == 'r') ? stdin : stdout;
+  for (i = 1; i < argcm; i ++) {                   /* Loop for all option codes                        */
+    if ((argvm[i][0] != '-') || (argvm[i][1] == '\0') || (argvm[i][1] == '.')) { /* If found a file name */
+      if (C_paraNum < C_paraNbr) {                /* If number of parameters not reached              */
+        if ((C_partNbr = atoi (argvm[i])) < 1)     /* Get the number of parts                          */
+          errorPrint ("main: invalid number of parts (\"%s\")", argvm[i]);
+        C_paraNum ++;
+        continue;                                 /* Process the other parameters */
+      }
+      if (C_fileNum < C_fileNbr)                  /* A file name has been given */
+        C_fileTab[C_fileNum ++].name = argvm[i];
+      else
+        errorPrint ("main: too many file names given");
+    }
+    else {                                        /* If found an option name */
+      switch (argvm[i][1]) {
+        case 'H' :                                /* Give the usage message */
+        case 'h' :
+          usagePrint (stdout, C_usageList);
+          return     (0);
+        case 'M' :
+        case 'm' :
+          SCOTCH_stratExit (&stradat);
+          SCOTCH_stratInit (&stradat);
+          SCOTCH_stratGraphMap (&stradat, &argvm[i][2]);
+          break;
+        case 'S' :
+        case 's' :                                /* Source graph parameters */
+          for (j = 2; argvm[i][j] != '\0'; j ++) {
+            switch (argvm[i][j]) {
+              case 'E' :
+              case 'e' :
+                grafflag |= 2;                    /* Do not load edge weights */
+                break;
+              case 'V' :
+              case 'v' :
+                grafflag |= 1;                    /* Do not load vertex weights */
+                break;
+              default :
+                errorPrint ("main: invalid source graph option (\"%c\")", argvm[i][j]);
+            }
+          }
+          break;
+        case 'V' :
+          fprintf (stderr, "Gmap/Gpart, version %s - F. Pellegrini\n", SCOTCH_VERSION);
+          fprintf (stderr, "Copyright 2004,2007,2008 ENSEIRB, INRIA & CNRS, France\n");
+          fprintf (stderr, "This software is libre/free software under CeCILL-C -- see the user's manual for more information\n");
+          return  (0);
+        case 'v' :                                /* Output control info */
+          for (j = 2; argvm[i][j] != '\0'; j ++) {
+            switch (argvm[i][j]) {
+              case 'M' :
+              case 'm' :
+                flagval |= C_FLAGVERBMAP;
+                break;
+              case 'S' :
+              case 's' :
+                flagval |= C_FLAGVERBSTR;
+                break;
+              case 'T' :
+              case 't' :
+                flagval |= C_FLAGVERBTIM;
+                break;
+              default :
+                errorPrint ("main: unprocessed parameter \"%c\" in \"%s\"", argvm[i][j], argvm[i]);
+            }
+          }
+          break;
+        default :
+          errorPrint ("main: unprocessed option (\"%s\")", argvm[i]);
+      }
+    }
+  }
+  if ((flagval & C_FLAGPART) != 0) {              /* If program run as the partitioner            */
+    C_fileTab[3].name = C_fileTab[2].name;        /* Put provided file names at their right place */
+    C_fileTab[2].name = C_fileTab[1].name;
+    C_fileTab[1].name = "-";
+  }
+
+  fileBlockOpen (C_fileTab, C_FILENBR);           /* Open all files */
+
+  clockInit  (&runtime[0]);
+  clockStart (&runtime[0]);
+
+  SCOTCH_graphInit (&grafdat);                    /* Create graph structure         */
+  SCOTCH_graphLoad (&grafdat, C_filepntrsrcinp, -1, grafflag, nvert, nedge2, adjir, adjjc, vertlab, vertwgt, edgewgt); /* Read source graph */
+
+  SCOTCH_archInit (&archdat);                     /* Create architecture structure          */
+  if ((flagval & C_FLAGPART) != 0)                /* If program run as the partitioner      */
+    SCOTCH_archCmplt (&archdat, C_partNbr);       /* Create a complete graph of proper size */
+  else
+    SCOTCH_archLoad (&archdat, C_filepntrtgtinp, archtyp, napar, archpar); /* Read target architecture */
+
+  clockStop  (&runtime[0]);                       /* Get input time */
+  clockInit  (&runtime[1]);
+  clockStart (&runtime[1]);
+
+  SCOTCH_graphMapInit    (&grafdat, &mapdat, &archdat, NULL);
+  SCOTCH_graphMapCompute (&grafdat, &mapdat, &stradat); /* Perform mapping */
+
+  clockStop  (&runtime[1]);                       /* Get computation time */
+  clockStart (&runtime[0]);
+
+  SCOTCH_graphMapSave (&nvert, &maptab, &grafdat, &mapdat, C_filepntrmapout); /* Write mapping */
+
+/*  convert output arguments from scotch data types  */
+
+  if (maptab) {
+    *pmaptabi = (int (*)[2]) malloc(nvert*2*sizeof(int));
+    maptabi  = *pmaptabi;
+    for (j=0; j<2; j++)
+      for (i=0; i<nvert; i++)
+          maptabi[i][j]=(int)maptab[i][j];
+    free(maptab);
+  }
+
+  clockStop (&runtime[0]);                        /* Get output time */
+
+  if (flagval & C_FLAGVERBSTR) {
+    fprintf (C_filepntrlogout, "S\tStrat=");
+    SCOTCH_stratSave (&stradat, C_filepntrlogout);
+    putc ('\n', C_filepntrlogout);
+  }
+  if (flagval & C_FLAGVERBTIM) {
+    fprintf (C_filepntrlogout, "T\tMapping\t\t%g\nT\tI/O\t\t%g\nT\tTotal\t\t%g\n",
+             (double) clockVal (&runtime[1]),
+             (double) clockVal (&runtime[0]),
+             (double) clockVal (&runtime[0]) +
+             (double) clockVal (&runtime[1]));
+  }
+  if (flagval & C_FLAGVERBMAP)
+    SCOTCH_graphMapView (&grafdat, &mapdat, C_filepntrlogout);
+
+  fileBlockClose (C_fileTab, C_FILENBR);          /* Always close explicitely to end eventual (un)compression tasks */
+
+  SCOTCH_graphMapExit (&grafdat, &mapdat);
+  SCOTCH_graphExit    (&grafdat);
+  SCOTCH_stratExit    (&stradat);
+  SCOTCH_archExit     (&archdat);
+
+  if (archpar) free(archpar);
+  if (edgewgt) free(edgewgt);
+  if (vertwgt) free(vertwgt);
+  if (vertlab) free(vertlab);
+  if (adjjc) free(adjjc);
+  if (adjir) free(adjir);
+
+#ifdef COMMON_PTHREAD
+  pthread_exit ((void *) 0);                      /* Allow potential (un)compression tasks to complete */
+#endif /* COMMON_PTHREAD */
+  return (0);
+}
Index: /issm/trunk/externalpackages/scotch/mex/Makefile
===================================================================
--- /issm/trunk/externalpackages/scotch/mex/Makefile	(revision 4629)
+++ /issm/trunk/externalpackages/scotch/mex/Makefile	(revision 4629)
@@ -0,0 +1,99 @@
+## Copyright 2004,2007-2009 ENSEIRB, INRIA & CNRS
+##
+## This file is part of the Scotch software package for static mapping,
+## graph partitioning and sparse matrix ordering.
+##
+## This software is governed by the CeCILL-C license under French law
+## and abiding by the rules of distribution of free software. You can
+## use, modify and/or redistribute the software under the terms of the
+## CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
+## URL: "http://www.cecill.info".
+## 
+## As a counterpart to the access to the source code and rights to copy,
+## modify and redistribute granted by the license, users are provided
+## only with a limited warranty and the software's author, the holder of
+## the economic rights, and the successive licensors have only limited
+## liability.
+## 
+## In this respect, the user's attention is drawn to the risks associated
+## with loading, using, modifying and/or developing or reproducing the
+## software by the user in light of its specific status of free software,
+## that may mean that it is complicated to manipulate, and that also
+## therefore means that it is reserved for developers and experienced
+## professionals having in-depth computer knowledge. Users are therefore
+## encouraged to load and test the software's suitability as regards
+## their requirements in conditions enabling the security of their
+## systems and/or data to be ensured and, more generally, to use and
+## operate it in the same conditions as regards security.
+## 
+## The fact that you are presently reading this means that you have had
+## knowledge of the CeCILL-C license and that you accept its terms.
+##
+
+#bindir		= ../../bin
+#includedir	= ../../include
+#libdir		= ../../lib
+bindir		= ${SCOTCH_DIR}/../src/bin
+includedir	= ${SCOTCH_DIR}/../src/include
+libdir		= ${SCOTCH_DIR}/../src/lib
+
+##
+##  General inference rules.
+##
+
+#include ../Makefile.inc
+include ${SCOTCH_DIR}/../src/src/Makefile.inc
+
+%$(OBJ)	:	%.c
+				$(CC) $(CFLAGS) -I${SCOTCH_DIR}/../src/src/scotch -I$(includedir) -I${SCOTCH_DIR}/../src/src/libscotch -DSCOTCH_VERSION=\"$(VERSION)\" -c $(<) -o $(@)
+
+%$(MEX)	:	%.c
+		 		$(CCM) $(MFLAGS) -I${SCOTCH_DIR}/../src/src/scotch -I$(includedir) -I${SCOTCH_DIR}/../src/src/libscotch -DSCOTCH_VERSION=\"$(VERSION)\" $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -l$(SCOTCHLIB)errexit $(LDFLAGS)
+
+##
+##  Project rules.
+##
+
+.PHONY				:	mexscotch	mexinstall	clean	realclean
+
+mexscotch			:	clean
+					$(MAKE) CFLAGS="$(CFLAGS) -DMATLAB -I${MATLAB_DIR}/extern/include" CC="$(CCS)" CCD="$(CCS)" LDFLAGS="$(LDFLAGS) -Wl,-rpath-link,${MATLAB_DIR}/bin/glnxa64 -L${MATLAB_DIR}/bin/glnxa64 -lmex -lmat" SCOTCHLIB=scotch \
+                    Gmapx$(OBJ)
+					$(MAKE) CFLAGS="$(CFLAGS) -DMATLAB -I${MATLAB_DIR}/extern/include" CC="$(CCS)" LDFLAGS="$(LDFLAGS) -Wl,-rpath-link,${MATLAB_DIR}/bin/glnxa64 -L${MATLAB_DIR}/bin/glnxa64 -lmex -lmat Gmapx$(OBJ)" SCOTCHLIB=scotch	\
+					Gmap$(MEX)
+
+mexinstall			:
+					-$(CP) Gmap$(MEX) $(bindir)
+					-$(RM) $(bindir)/Gpart$(MEX)
+					-$(LN) $(bindir)/Gmap$(MEX) $(bindir)/Gpart$(MEX)
+
+clean				:
+					-$(RM) *~ *$(OBJ)
+					-$(RM) Gmap$(MEX)
+
+realclean			:	clean
+
+##
+##  Todo list.
+##
+
+Gmapx$(OBJ)			:	Gmapx.c					\
+					${SCOTCH_DIR}/../src/src/libscotch/module.h			\
+					${SCOTCH_DIR}/../src/src/libscotch/common.h			\
+					$(includedir)/scotch.h			\
+					$(libdir)/libscotch$(LIB)		\
+					$(libdir)/libscotcherrexit$(LIB)	\
+					${SCOTCH_DIR}/../src/src/scotch/gmap.h
+
+Gmap$(MEX)		:	Gmap.c					\
+					${SCOTCH_DIR}/../src/src/libscotch/module.h			\
+					${SCOTCH_DIR}/../src/src/libscotch/common.h			\
+					$(includedir)/scotch.h			\
+					$(libdir)/libscotch$(LIB)		\
+					$(libdir)/libscotcherrexit$(LIB)	\
+					${SCOTCH_DIR}/../src/src/scotch/gmap.h
+
+Gpart$(MEX)		:	Gmap$(MEX)
+					-$(RM) Gpart$(MEX)
+					-$(LN) Gmap$(MEX) Gpart$(MEX)
+
Index: /issm/trunk/externalpackages/scotch/scotch.patch
===================================================================
--- /issm/trunk/externalpackages/scotch/scotch.patch	(revision 4628)
+++ /issm/trunk/externalpackages/scotch/scotch.patch	(revision 4629)
@@ -1,8 +1,8 @@
-Only in new3: bin
-Only in new3: include
-Only in new3: lib
-diff -rc src/src/libscotch/arch.c new3/src/libscotch/arch.c
+Only in new4: bin
+Only in new4: include
+Only in new4: lib
+diff -rc src/src/libscotch/arch.c new4/src/libscotch/arch.c
 *** src/src/libscotch/arch.c	2008-09-27 07:48:01.000000000 -0700
---- new3/src/libscotch/arch.c	2010-04-30 10:28:22.088131040 -0700
+--- new4/src/libscotch/arch.c	2010-05-03 15:37:55.104089848 -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 new3/src/libscotch/arch_cmplt.c
+diff -rc src/src/libscotch/arch_cmplt.c new4/src/libscotch/arch_cmplt.c
 *** src/src/libscotch/arch_cmplt.c	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_cmplt.c	2010-04-30 10:28:22.093131042 -0700
+--- new4/src/libscotch/arch_cmplt.c	2010-05-03 15:37:55.111089854 -0700
 ***************
 *** 90,99 ****
@@ -120,7 +120,7 @@
       return     (1);
     }
-diff -rc src/src/libscotch/arch_cmplt.h new3/src/libscotch/arch_cmplt.h
+diff -rc src/src/libscotch/arch_cmplt.h new4/src/libscotch/arch_cmplt.h
 *** src/src/libscotch/arch_cmplt.h	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_cmplt.h	2010-04-30 10:28:22.098131044 -0700
+--- new4/src/libscotch/arch_cmplt.h	2010-05-03 15:37:55.118089860 -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 new3/src/libscotch/arch_cmpltw.c
+diff -rc src/src/libscotch/arch_cmpltw.c new4/src/libscotch/arch_cmpltw.c
 *** src/src/libscotch/arch_cmpltw.c	2008-08-27 14:22:22.000000000 -0700
---- new3/src/libscotch/arch_cmpltw.c	2010-04-30 10:28:22.103131046 -0700
+--- new4/src/libscotch/arch_cmpltw.c	2010-05-03 15:37:55.126089866 -0700
 ***************
 *** 200,211 ****
@@ -209,7 +209,7 @@
         return     (1);
       }
-diff -rc src/src/libscotch/arch_cmpltw.h new3/src/libscotch/arch_cmpltw.h
+diff -rc src/src/libscotch/arch_cmpltw.h new4/src/libscotch/arch_cmpltw.h
 *** src/src/libscotch/arch_cmpltw.h	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_cmpltw.h	2010-04-30 10:28:22.108131048 -0700
+--- new4/src/libscotch/arch_cmpltw.h	2010-05-03 15:37:55.133089872 -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 new3/src/libscotch/arch_deco.c
+diff -rc src/src/libscotch/arch_deco.c new4/src/libscotch/arch_deco.c
 *** src/src/libscotch/arch_deco.c	2008-09-28 06:35:27.000000000 -0700
---- new3/src/libscotch/arch_deco.c	2010-04-30 10:28:22.153131068 -0700
+--- new4/src/libscotch/arch_deco.c	2010-05-03 15:37:55.180089911 -0700
 ***************
 *** 211,217 ****
@@ -267,7 +267,7 @@
     if ((sizeof (ArchDeco)    > sizeof (ArchDummy)) ||
         (sizeof (ArchDecoDom) > sizeof (ArchDomDummy))) {
-diff -rc src/src/libscotch/arch_deco.h new3/src/libscotch/arch_deco.h
+diff -rc src/src/libscotch/arch_deco.h new4/src/libscotch/arch_deco.h
 *** src/src/libscotch/arch_deco.h	2008-09-27 07:49:46.000000000 -0700
---- new3/src/libscotch/arch_deco.h	2010-04-30 10:28:22.158131070 -0700
+--- new4/src/libscotch/arch_deco.h	2010-05-03 15:37:55.187089917 -0700
 ***************
 *** 113,119 ****
@@ -284,7 +284,7 @@
   int                         archDecoArchFree    (ArchDeco * const);
   Anum                        archDecoArchSize    (ArchDeco * const, const Anum);
-diff -rc src/src/libscotch/arch.h new3/src/libscotch/arch.h
+diff -rc src/src/libscotch/arch.h new4/src/libscotch/arch.h
 *** src/src/libscotch/arch.h	2009-04-28 08:11:27.000000000 -0700
---- new3/src/libscotch/arch.h	2010-04-30 10:28:22.163131072 -0700
+--- new4/src/libscotch/arch.h	2010-05-03 15:37:55.194089922 -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 new3/src/libscotch/arch_hcub.c
+diff -rc src/src/libscotch/arch_hcub.c new4/src/libscotch/arch_hcub.c
 *** src/src/libscotch/arch_hcub.c	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_hcub.c	2010-04-30 10:28:22.169131075 -0700
+--- new4/src/libscotch/arch_hcub.c	2010-05-03 15:37:55.201089928 -0700
 ***************
 *** 88,95 ****
@@ -349,7 +349,7 @@
       errorPrint ("archHcubArchLoad: bad input");
       return     (1);
-diff -rc src/src/libscotch/arch_hcub.h new3/src/libscotch/arch_hcub.h
+diff -rc src/src/libscotch/arch_hcub.h new4/src/libscotch/arch_hcub.h
 *** src/src/libscotch/arch_hcub.h	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_hcub.h	2010-04-30 10:28:22.174131077 -0700
+--- new4/src/libscotch/arch_hcub.h	2010-05-03 15:37:55.208089934 -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 new3/src/libscotch/arch_mesh.c
+diff -rc src/src/libscotch/arch_mesh.c new4/src/libscotch/arch_mesh.c
 *** src/src/libscotch/arch_mesh.c	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_mesh.c	2010-04-30 10:28:22.179131079 -0700
+--- new4/src/libscotch/arch_mesh.c	2010-05-03 15:37:55.215089940 -0700
 ***************
 *** 96,103 ****
@@ -465,7 +465,7 @@
       return     (1);
     }
-diff -rc src/src/libscotch/arch_mesh.h new3/src/libscotch/arch_mesh.h
+diff -rc src/src/libscotch/arch_mesh.h new4/src/libscotch/arch_mesh.h
 *** src/src/libscotch/arch_mesh.h	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_mesh.h	2010-04-30 10:28:22.184131082 -0700
+--- new4/src/libscotch/arch_mesh.h	2010-05-03 15:37:55.221089945 -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 new3/src/libscotch/arch_tleaf.c
+diff -rc src/src/libscotch/arch_tleaf.c new4/src/libscotch/arch_tleaf.c
 *** src/src/libscotch/arch_tleaf.c	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_tleaf.c	2010-04-30 10:28:22.189131084 -0700
+--- new4/src/libscotch/arch_tleaf.c	2010-05-03 15:37:55.228089950 -0700
 ***************
 *** 92,99 ****
@@ -554,7 +554,7 @@
       return     (1);
     }
-diff -rc src/src/libscotch/arch_tleaf.h new3/src/libscotch/arch_tleaf.h
+diff -rc src/src/libscotch/arch_tleaf.h new4/src/libscotch/arch_tleaf.h
 *** src/src/libscotch/arch_tleaf.h	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_tleaf.h	2010-04-30 10:28:22.194131086 -0700
+--- new4/src/libscotch/arch_tleaf.h	2010-05-03 15:37:55.235089956 -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 new3/src/libscotch/arch_torus.c
+diff -rc src/src/libscotch/arch_torus.c new4/src/libscotch/arch_torus.c
 *** src/src/libscotch/arch_torus.c	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_torus.c	2010-04-30 10:28:22.199131088 -0700
+--- new4/src/libscotch/arch_torus.c	2010-05-03 15:37:55.242089962 -0700
 ***************
 *** 90,97 ****
@@ -670,7 +670,7 @@
       return     (1);
     }
-diff -rc src/src/libscotch/arch_torus.h new3/src/libscotch/arch_torus.h
+diff -rc src/src/libscotch/arch_torus.h new4/src/libscotch/arch_torus.h
 *** src/src/libscotch/arch_torus.h	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/arch_torus.h	2010-04-30 10:28:22.204131090 -0700
+--- new4/src/libscotch/arch_torus.h	2010-05-03 15:37:55.248089967 -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 new3/src/libscotch/common.c
+diff -rc src/src/libscotch/common.c new4/src/libscotch/common.c
 *** src/src/libscotch/common.c	2008-05-22 06:44:41.000000000 -0700
---- new3/src/libscotch/common.c	2010-04-30 10:28:22.209131092 -0700
+--- new4/src/libscotch/common.c	2010-05-03 15:37:55.254089972 -0700
 ***************
 *** 100,106 ****
@@ -720,7 +720,7 @@
 + #endif /* MATLAB */
   }
-diff -rc src/src/libscotch/common.h new3/src/libscotch/common.h
+diff -rc src/src/libscotch/common.h new4/src/libscotch/common.h
 *** src/src/libscotch/common.h	2009-02-06 14:20:55.000000000 -0800
---- new3/src/libscotch/common.h	2010-05-03 14:22:16.763394855 -0700
+--- new4/src/libscotch/common.h	2010-05-03 15:37:55.261089978 -0700
 ***************
 *** 66,71 ****
@@ -766,7 +766,7 @@
   void                        intRandInit         (void);
   INT                         intRandVal          (INT);
-diff -rc src/src/libscotch/common_integer.c new3/src/libscotch/common_integer.c
+diff -rc src/src/libscotch/common_integer.c new4/src/libscotch/common_integer.c
 *** src/src/libscotch/common_integer.c	2009-01-21 01:32:32.000000000 -0800
---- new3/src/libscotch/common_integer.c	2010-05-03 14:21:44.014369358 -0700
+--- new4/src/libscotch/common_integer.c	2010-05-03 15:37:55.268089983 -0700
 ***************
 *** 191,196 ****
@@ -827,7 +827,7 @@
   
   /*********************/
-diff -rc src/src/libscotch/common_memory.c new3/src/libscotch/common_memory.c
+diff -rc src/src/libscotch/common_memory.c new4/src/libscotch/common_memory.c
 *** src/src/libscotch/common_memory.c	2009-01-03 02:16:11.000000000 -0800
---- new3/src/libscotch/common_memory.c	2010-04-30 10:28:22.224131099 -0700
+--- new4/src/libscotch/common_memory.c	2010-05-03 15:37:55.275089989 -0700
 ***************
 *** 87,93 ****
@@ -935,7 +935,7 @@
   }
   #endif /* COMMON_MEMORY_TRACE */
-diff -rc src/src/libscotch/dummysizes.c new3/src/libscotch/dummysizes.c
+diff -rc src/src/libscotch/dummysizes.c new4/src/libscotch/dummysizes.c
 *** src/src/libscotch/dummysizes.c	2009-05-09 16:08:02.000000000 -0700
---- new3/src/libscotch/dummysizes.c	2010-04-30 10:28:22.229131101 -0700
+--- new4/src/libscotch/dummysizes.c	2010-05-03 15:37:55.282089995 -0700
 ***************
 *** 267,271 ****
@@ -948,7 +948,7 @@
 + #endif /* MATLAB */
   }
-diff -rc src/src/libscotch/graph.c new3/src/libscotch/graph.c
+diff -rc src/src/libscotch/graph.c new4/src/libscotch/graph.c
 *** src/src/libscotch/graph.c	2008-05-22 06:44:42.000000000 -0700
---- new3/src/libscotch/graph.c	2010-04-30 10:28:22.234131103 -0700
+--- new4/src/libscotch/graph.c	2010-05-03 15:37:55.288090000 -0700
 ***************
 *** 135,141 ****
@@ -971,7 +971,7 @@
       if ((grafptr->edlotax != NULL) &&
           ((grafptr->flagval & GRAPHEDGEGROUP) == 0))
-diff -rc src/src/libscotch/graph.h new3/src/libscotch/graph.h
+diff -rc src/src/libscotch/graph.h new4/src/libscotch/graph.h
 *** src/src/libscotch/graph.h	2008-06-01 02:49:11.000000000 -0700
---- new3/src/libscotch/graph.h	2010-04-30 10:28:22.240131106 -0700
+--- new4/src/libscotch/graph.h	2010-05-03 15:37:55.295090006 -0700
 ***************
 *** 159,165 ****
@@ -988,7 +988,7 @@
   int                         graphSave           (const Graph * const, FILE * const);
   Gnum                        graphBase           (Graph * const, const Gnum);
-diff -rc src/src/libscotch/graph_io.c new3/src/libscotch/graph_io.c
+diff -rc src/src/libscotch/graph_io.c new4/src/libscotch/graph_io.c
 *** src/src/libscotch/graph_io.c	2008-05-22 06:44:42.000000000 -0700
---- new3/src/libscotch/graph_io.c	2010-04-30 10:28:22.245131108 -0700
+--- new4/src/libscotch/graph_io.c	2010-05-03 15:37:55.303090012 -0700
 ***************
 *** 86,92 ****
@@ -1226,7 +1226,7 @@
     }
   
-diff -rc src/src/libscotch/graph_io_scot.c new3/src/libscotch/graph_io_scot.c
+diff -rc src/src/libscotch/graph_io_scot.c new4/src/libscotch/graph_io_scot.c
 *** src/src/libscotch/graph_io_scot.c	2008-05-22 06:44:42.000000000 -0700
---- new3/src/libscotch/graph_io_scot.c	2010-04-30 10:28:22.251131111 -0700
+--- new4/src/libscotch/graph_io_scot.c	2010-05-03 15:37:55.310090018 -0700
 ***************
 *** 89,95 ****
@@ -1243,7 +1243,7 @@
     }
   
-diff -rc src/src/libscotch/library_arch.c new3/src/libscotch/library_arch.c
+diff -rc src/src/libscotch/library_arch.c new4/src/libscotch/library_arch.c
 *** src/src/libscotch/library_arch.c	2008-05-22 06:44:42.000000000 -0700
---- new3/src/libscotch/library_arch.c	2010-04-30 10:28:22.256131113 -0700
+--- new4/src/libscotch/library_arch.c	2010-05-03 15:37:55.317090024 -0700
 ***************
 *** 120,128 ****
@@ -1278,7 +1278,7 @@
   
   /*+ This routine saves the given opaque
-diff -rc src/src/libscotch/library_arch_f.c new3/src/libscotch/library_arch_f.c
+diff -rc src/src/libscotch/library_arch_f.c new4/src/libscotch/library_arch_f.c
 *** src/src/libscotch/library_arch_f.c	2008-05-22 06:44:42.000000000 -0700
---- new3/src/libscotch/library_arch_f.c	2010-04-30 10:28:22.260131115 -0700
+--- new4/src/libscotch/library_arch_f.c	2010-05-03 15:37:55.323090029 -0700
 ***************
 *** 121,127 ****
@@ -1295,7 +1295,7 @@
     fclose (stream);                                /* This closes filenum too */
   
-diff -rc src/src/libscotch/library_error_exit.c new3/src/libscotch/library_error_exit.c
+diff -rc src/src/libscotch/library_error_exit.c new4/src/libscotch/library_error_exit.c
 *** src/src/libscotch/library_error_exit.c	2009-01-20 00:36:33.000000000 -0800
---- new3/src/libscotch/library_error_exit.c	2010-04-30 10:28:22.265131117 -0700
+--- new4/src/libscotch/library_error_exit.c	2010-05-03 15:37:55.330090035 -0700
 ***************
 *** 114,119 ****
@@ -1370,7 +1370,7 @@
 + #endif /* MATLAB */
   }
-diff -rc src/src/libscotch/library_graph.c new3/src/libscotch/library_graph.c
+diff -rc src/src/libscotch/library_graph.c new4/src/libscotch/library_graph.c
 *** src/src/libscotch/library_graph.c	2008-05-22 07:28:12.000000000 -0700
---- new3/src/libscotch/library_graph.c	2010-04-30 10:28:22.270131119 -0700
+--- new4/src/libscotch/library_graph.c	2010-05-03 15:37:55.337090040 -0700
 ***************
 *** 137,143 ****
@@ -1415,7 +1415,7 @@
   
   /*+ This routine saves the contents of the given
-diff -rc src/src/libscotch/library_graph_f.c new3/src/libscotch/library_graph_f.c
+diff -rc src/src/libscotch/library_graph_f.c new4/src/libscotch/library_graph_f.c
 *** src/src/libscotch/library_graph_f.c	2008-05-22 06:44:43.000000000 -0700
---- new3/src/libscotch/library_graph_f.c	2010-04-30 10:28:22.275131121 -0700
+--- new4/src/libscotch/library_graph_f.c	2010-05-03 15:37:55.344090046 -0700
 ***************
 *** 136,142 ****
@@ -1432,7 +1432,7 @@
     fclose (stream);                                /* This closes filenum too */
   
-diff -rc src/src/libscotch/library_graph_map.c new3/src/libscotch/library_graph_map.c
+diff -rc src/src/libscotch/library_graph_map.c new4/src/libscotch/library_graph_map.c
 *** src/src/libscotch/library_graph_map.c	2008-09-28 04:04:05.000000000 -0700
---- new3/src/libscotch/library_graph_map.c	2010-04-30 10:28:22.280131123 -0700
+--- new4/src/libscotch/library_graph_map.c	2010-05-03 15:37:55.350090051 -0700
 ***************
 *** 182,192 ****
@@ -1457,7 +1457,7 @@
   
   /*+ This routine computes a mapping
-diff -rc src/src/libscotch/library_graph_map_f.c new3/src/libscotch/library_graph_map_f.c
+diff -rc src/src/libscotch/library_graph_map_f.c new4/src/libscotch/library_graph_map_f.c
 *** src/src/libscotch/library_graph_map_f.c	2008-06-28 03:44:26.000000000 -0700
---- new3/src/libscotch/library_graph_map_f.c	2010-04-30 10:28:22.285131126 -0700
+--- new4/src/libscotch/library_graph_map_f.c	2010-05-03 15:37:55.357090057 -0700
 ***************
 *** 183,189 ****
@@ -1474,7 +1474,7 @@
     fclose (stream);                                /* This closes filenum too */
   
-diff -rc src/src/libscotch/library.h new3/src/libscotch/library.h
+diff -rc src/src/libscotch/library.h new4/src/libscotch/library.h
 *** src/src/libscotch/library.h	2009-05-09 16:08:03.000000000 -0700
---- new3/src/libscotch/library.h	2010-04-30 10:28:22.291131128 -0700
+--- new4/src/libscotch/library.h	2010-05-03 15:37:55.365090063 -0700
 ***************
 *** 134,140 ****
@@ -1519,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 new3/src/libscotch/Makefile
+diff -rc src/src/libscotch/Makefile new4/src/libscotch/Makefile
 *** src/src/libscotch/Makefile	2009-05-09 16:08:04.000000000 -0700
---- new3/src/libscotch/Makefile	2010-04-30 10:28:22.297131131 -0700
+--- new4/src/libscotch/Makefile	2010-06-17 09:55:33.101320246 -0700
 ***************
 *** 49,55 ****
@@ -1551,14 +1551,211 @@
 + 					scotch.h						\
 + 					scotchf.h						\
-+ 					libscotch$(LIB)						\
-+ 					libscotcherr$(LIB)					\
-+ 					libscotcherrexit$(LIB)
++ 					libmexscotch$(LIB)						\
++ 					libmexscotcherr$(LIB)					\
++ 					libmexscotcherrexit$(LIB)
 + 
   install				:
   					-$(CP) scotch.h scotchf.h $(includedir)
   					-$(CP) libscotch$(LIB) libscotcherr*$(LIB) $(libdir)
-diff -rc src/src/libscotch/mapping.h new3/src/libscotch/mapping.h
+***************
+*** 77,82 ****
+--- 87,96 ----
+  					-$(CP) scotchf.h $(includedir)/ptscotchf.h
+  					-$(CP) libptscotch*$(LIB) $(libdir)
+  
++ mexinstall				:
++ 					-$(CP) scotch.h scotchf.h $(includedir)
++ 					-$(CP) libmexscotch$(LIB) libmexscotcherr*$(LIB) $(libdir)
++ 
+  clean				:
+  					-$(RM) *~ *$(OBJ) lib*$(LIB) common2* parser_yy.c parser_ly.h parser_ll.c *scotch.h *scotchf.h y.output dummysizes$(EXE)
+  
+***************
+*** 2452,2457 ****
+--- 2466,2632 ----
+  					$(AR) $(ARFLAGS) lib$(SCOTCHLIB)$(LIB) $(?)
+  					-$(RANLIB) lib$(SCOTCHLIB)$(LIB)
+  
++ libmexscotch$(LIB)			:	arch$(OBJ)				\
++ 					arch_build$(OBJ)			\
++ 					arch_cmplt$(OBJ)			\
++ 					arch_cmpltw$(OBJ)			\
++ 					arch_deco$(OBJ)				\
++ 					arch_hcub$(OBJ)				\
++ 					arch_mesh$(OBJ)				\
++ 					arch_tleaf$(OBJ)			\
++ 					arch_torus$(OBJ)			\
++ 					arch_vcmplt$(OBJ)			\
++ 					arch_vhcub$(OBJ)			\
++ 					bgraph$(OBJ)				\
++ 					bgraph_bipart_bd$(OBJ)			\
++ 					bgraph_bipart_df$(OBJ)			\
++ 					bgraph_bipart_ex$(OBJ)			\
++ 					bgraph_bipart_fm$(OBJ)			\
++ 					bgraph_bipart_gg$(OBJ)			\
++ 					bgraph_bipart_gp$(OBJ)			\
++ 					bgraph_bipart_ml$(OBJ)			\
++ 					bgraph_bipart_st$(OBJ)			\
++ 					bgraph_bipart_zr$(OBJ)			\
++ 					bgraph_check$(OBJ)			\
++ 					bgraph_store$(OBJ)			\
++ 					common$(OBJ)				\
++ 					common_file$(OBJ)			\
++ 					common_file_compress$(OBJ)		\
++ 					common_file_uncompress$(OBJ)		\
++ 					common_integer$(OBJ)			\
++ 					common_memory$(OBJ)			\
++ 					common_stub$(OBJ)			\
++ 					gain$(OBJ)				\
++ 					geom$(OBJ)				\
++ 					graph$(OBJ)				\
++ 					graph_base$(OBJ)			\
++ 					graph_check$(OBJ)			\
++ 					graph_coarsen$(OBJ)			\
++ 					graph_induce$(OBJ)			\
++ 					graph_io$(OBJ)				\
++ 					graph_io_chac$(OBJ)			\
++ 					graph_io_habo$(OBJ)			\
++ 					graph_io_mmkt$(OBJ)			\
++ 					graph_io_scot$(OBJ)			\
++ 					graph_list$(OBJ)			\
++ 					hall_order_hd$(OBJ)			\
++ 					hall_order_hf$(OBJ)			\
++ 					hall_order_hx$(OBJ)			\
++ 					hgraph$(OBJ)				\
++ 					hgraph_check$(OBJ)			\
++ 					hgraph_induce$(OBJ)			\
++ 					hgraph_order_bl$(OBJ)			\
++ 					hgraph_order_cp$(OBJ)			\
++ 					hgraph_order_gp$(OBJ)			\
++ 					hgraph_order_hd$(OBJ)			\
++ 					hgraph_order_hf$(OBJ)			\
++ 					hgraph_order_hx$(OBJ)			\
++ 					hgraph_order_nd$(OBJ)			\
++ 					hgraph_order_si$(OBJ)			\
++ 					hgraph_order_st$(OBJ)			\
++ 					hmesh$(OBJ)				\
++ 					hmesh_check$(OBJ)			\
++ 					hmesh_hgraph$(OBJ)			\
++ 					hmesh_induce$(OBJ)			\
++ 					hmesh_mesh$(OBJ)			\
++ 					hmesh_order_bl$(OBJ)			\
++ 					hmesh_order_cp$(OBJ)			\
++ 					hmesh_order_gr$(OBJ)			\
++ 					hmesh_order_gp$(OBJ)			\
++ 					hmesh_order_hd$(OBJ)			\
++ 					hmesh_order_hf$(OBJ)			\
++ 					hmesh_order_hx$(OBJ)			\
++ 					hmesh_order_nd$(OBJ)			\
++ 					hmesh_order_si$(OBJ)			\
++ 					hmesh_order_st$(OBJ)			\
++ 					kgraph$(OBJ)				\
++ 					kgraph_map_rb$(OBJ)			\
++ 					kgraph_map_rb_map$(OBJ)			\
++ 					kgraph_map_rb_part$(OBJ)		\
++ 					kgraph_map_st$(OBJ)			\
++ 					library_arch$(OBJ)			\
++ 					library_arch_f$(OBJ)			\
++ 					library_arch_build$(OBJ)		\
++ 					library_arch_build_f$(OBJ)		\
++ 					library_arch_cmpltw$(OBJ)		\
++ 					library_arch_cmpltw_f$(OBJ)		\
++ 					library_geom$(OBJ)			\
++ 					library_geom_f$(OBJ)			\
++ 					library_graph$(OBJ)			\
++ 					library_graph_f$(OBJ)			\
++ 					library_graph_base$(OBJ)		\
++ 					library_graph_base_f$(OBJ)		\
++ 					library_graph_check$(OBJ)		\
++ 					library_graph_check_f$(OBJ)		\
++ 					library_graph_io_chac$(OBJ)		\
++ 					library_graph_io_chac_f$(OBJ)		\
++ 					library_graph_io_habo$(OBJ)		\
++ 					library_graph_io_habo_f$(OBJ)		\
++ 					library_graph_io_mmkt$(OBJ)		\
++ 					library_graph_io_mmkt_f$(OBJ)		\
++ 					library_graph_io_scot$(OBJ)		\
++ 					library_graph_io_scot_f$(OBJ)		\
++ 					library_graph_map$(OBJ)			\
++ 					library_graph_map_f$(OBJ)		\
++ 					library_graph_map_view$(OBJ)		\
++ 					library_graph_map_view_f$(OBJ)		\
++ 					library_graph_order$(OBJ)		\
++ 					library_graph_order_f$(OBJ)		\
++ 					library_mesh$(OBJ)			\
++ 					library_mesh_f$(OBJ)			\
++ 					library_mesh_graph$(OBJ)		\
++ 					library_mesh_graph_f$(OBJ)		\
++ 					library_mesh_io_habo$(OBJ)		\
++ 					library_mesh_io_habo_f$(OBJ)		\
++ 					library_mesh_io_scot$(OBJ)		\
++ 					library_mesh_io_scot_f$(OBJ)		\
++ 					library_mesh_order$(OBJ)		\
++ 					library_mesh_order_f$(OBJ)		\
++ 					library_parser$(OBJ)			\
++ 					library_parser_f$(OBJ)			\
++ 					library_random$(OBJ)			\
++ 					library_random_f$(OBJ)			\
++ 					mapping$(OBJ)				\
++ 					mapping_io$(OBJ)			\
++ 					mesh$(OBJ)				\
++ 					mesh_check$(OBJ)			\
++ 					mesh_coarsen$(OBJ)			\
++ 					mesh_graph$(OBJ)			\
++ 					mesh_induce_sepa$(OBJ)			\
++ 					mesh_io$(OBJ)				\
++ 					mesh_io_habo$(OBJ)			\
++ 					mesh_io_scot$(OBJ)			\
++ 					order$(OBJ)				\
++ 					order_check$(OBJ)			\
++ 					order_io$(OBJ)				\
++ 					parser$(OBJ)				\
++ 					parser_ll$(OBJ)				\
++ 					parser_yy$(OBJ)				\
++ 					vgraph$(OBJ)				\
++ 					vgraph_check$(OBJ)			\
++ 					vgraph_separate_bd$(OBJ)		\
++ 					vgraph_separate_es$(OBJ)		\
++ 					vgraph_separate_fm$(OBJ)		\
++ 					vgraph_separate_gg$(OBJ)		\
++ 					vgraph_separate_gp$(OBJ)		\
++ 					vgraph_separate_ml$(OBJ)		\
++ 					vgraph_separate_st$(OBJ)		\
++ 					vgraph_separate_th$(OBJ)		\
++ 					vgraph_separate_vw$(OBJ)		\
++ 					vgraph_separate_zr$(OBJ)		\
++ 					vgraph_store$(OBJ)			\
++ 					vmesh$(OBJ)				\
++ 					vmesh_check$(OBJ)			\
++ 					vmesh_separate_fm$(OBJ)			\
++ 					vmesh_separate_gg$(OBJ)			\
++ 					vmesh_separate_gr$(OBJ)			\
++ 					vmesh_separate_ml$(OBJ)			\
++ 					vmesh_separate_zr$(OBJ)			\
++ 					vmesh_separate_st$(OBJ)			\
++ 					vmesh_store$(OBJ)
++ 					$(AR) $(ARFLAGS) $(@) $(?)
++ 					-$(RANLIB) $(@)
++ 
+  libptscotcherr$(LIB)		:	library_error$(OBJ)
+  					$(AR) $(ARFLAGS) $(@) $(?)
+  					-$(RANLIB) $(@)
+***************
+*** 2467,2469 ****
+--- 2642,2651 ----
+  libscotcherrexit$(LIB)		:	library_error_exit$(OBJ)
+  					$(AR) $(ARFLAGS) $(@) $(?)
+  					-$(RANLIB) $(@)
++ libmexscotcherr$(LIB)		:	library_error$(OBJ)
++ 					$(AR) $(ARFLAGS) $(@) $(?)
++ 					-$(RANLIB) $(@)
++ 
++ libmexscotcherrexit$(LIB)		:	library_error_exit$(OBJ)
++ 					$(AR) $(ARFLAGS) $(@) $(?)
++ 					-$(RANLIB) $(@)
+Only in new4/src/libscotch: Makefile_save
+diff -rc src/src/libscotch/mapping.h new4/src/libscotch/mapping.h
 *** src/src/libscotch/mapping.h	2008-10-27 08:27:47.000000000 -0700
---- new3/src/libscotch/mapping.h	2010-04-30 10:28:22.302131133 -0700
+--- new4/src/libscotch/mapping.h	2010-05-03 15:37:55.381090077 -0700
 ***************
 *** 106,112 ****
@@ -1575,7 +1772,7 @@
   
   #undef static
-diff -rc src/src/libscotch/mapping_io.c new3/src/libscotch/mapping_io.c
+diff -rc src/src/libscotch/mapping_io.c new4/src/libscotch/mapping_io.c
 *** src/src/libscotch/mapping_io.c	2008-05-22 06:44:43.000000000 -0700
---- new3/src/libscotch/mapping_io.c	2010-04-30 10:28:22.307131135 -0700
+--- new4/src/libscotch/mapping_io.c	2010-05-03 15:37:55.388090082 -0700
 ***************
 *** 199,204 ****
@@ -1664,7 +1861,7 @@
     return (0);
   }
-diff -rc src/src/libscotch/mesh_io_scot.c new3/src/libscotch/mesh_io_scot.c
+diff -rc src/src/libscotch/mesh_io_scot.c new4/src/libscotch/mesh_io_scot.c
 *** src/src/libscotch/mesh_io_scot.c	2008-05-22 06:44:43.000000000 -0700
---- new3/src/libscotch/mesh_io_scot.c	2010-04-30 10:28:22.312131137 -0700
+--- new4/src/libscotch/mesh_io_scot.c	2010-05-03 15:37:55.394090087 -0700
 ***************
 *** 85,91 ****
@@ -1681,7 +1878,7 @@
     }
   
-diff -rc src/src/libscotch/module.h new3/src/libscotch/module.h
+diff -rc src/src/libscotch/module.h new4/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
+--- new4/src/libscotch/module.h	2010-05-03 15:37:55.402090094 -0700
 ***************
 *** 156,161 ****
@@ -1694,7 +1891,7 @@
   #define intRandInit                 _SCOTCHintRandInit
   /* #define intRandVal               _SCOTCHintRandVal Already a macro */
-diff -rc src/src/libscotch/parser_ll.l new3/src/libscotch/parser_ll.l
+diff -rc src/src/libscotch/parser_ll.l new4/src/libscotch/parser_ll.l
 *** src/src/libscotch/parser_ll.l	2008-05-22 06:44:43.000000000 -0700
---- new3/src/libscotch/parser_ll.l	2010-04-30 10:28:22.318131140 -0700
+--- new4/src/libscotch/parser_ll.l	2010-05-03 15:37:55.410090101 -0700
 ***************
 *** 192,197 ****
@@ -1723,7 +1920,7 @@
     yyrestart (yyin);                               /* (Re-)initialize the parser */
   #endif /* FLEX_SCANNER */
-diff -rc src/src/libscotch/parser_yy.y new3/src/libscotch/parser_yy.y
+diff -rc src/src/libscotch/parser_yy.y new4/src/libscotch/parser_yy.y
 *** src/src/libscotch/parser_yy.y	2008-10-22 15:12:48.000000000 -0700
---- new3/src/libscotch/parser_yy.y	2010-04-30 10:28:22.363131160 -0700
+--- new4/src/libscotch/parser_yy.y	2010-05-03 15:37:55.418090107 -0700
 ***************
 *** 774,779 ****
@@ -1736,7 +1933,7 @@
     if (stratParserParse2 () != 0) {                /* Parse the strategy string */
       if (parserstratcurr != NULL)
-diff -rc src/src/libscotch/vgraph_separate_vw.c new3/src/libscotch/vgraph_separate_vw.c
+diff -rc src/src/libscotch/vgraph_separate_vw.c new4/src/libscotch/vgraph_separate_vw.c
 *** src/src/libscotch/vgraph_separate_vw.c	2008-05-22 06:44:43.000000000 -0700
---- new3/src/libscotch/vgraph_separate_vw.c	2010-04-30 10:28:22.368131162 -0700
+--- new4/src/libscotch/vgraph_separate_vw.c	2010-05-03 15:37:55.425090113 -0700
 ***************
 *** 83,88 ****
@@ -1758,7 +1955,7 @@
     return (0);
   }
-diff -rc src/src/Makefile new3/src/Makefile
+diff -rc src/src/Makefile new4/src/Makefile
 *** src/src/Makefile	2008-09-15 05:50:51.000000000 -0700
---- new3/src/Makefile	2010-04-30 10:28:22.373131164 -0700
+--- new4/src/Makefile	2010-06-17 09:31:54.881418932 -0700
 ***************
 *** 97,102 ****
@@ -1768,5 +1965,5 @@
   
 + mexscotch			:	required
-+ 					(cd libscotch ;      $(MAKE) VERSION=\"$(VERSION)\" mexscotch && $(MAKE) install)
++ 					(cd libscotch ;      $(MAKE) VERSION=\"$(VERSION)\" mexscotch && $(MAKE) mexinstall)
 + 					(cd scotch ;         $(MAKE) VERSION=\"$(VERSION)\" mexscotch && $(MAKE) mexinstall)
 + 
@@ -1774,10 +1971,10 @@
   					-$(CP) -f ../bin/[agm]*$(EXE) $(bindir)
   					-$(CP) -f ../include/*scotch*.h $(includedir)
-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
+Only in new4/src: Makefile.inc
+Only in new4/src/scotch: gmap_mex.c
+Only in new4/src/scotch: gmapx.c
+diff -rc src/src/scotch/Makefile new4/src/scotch/Makefile
 *** src/src/scotch/Makefile	2009-04-27 02:19:43.000000000 -0700
---- new3/src/scotch/Makefile	2010-04-30 10:28:22.379131167 -0700
+--- new4/src/scotch/Makefile	2010-06-17 10:09:39.718475100 -0700
 ***************
 *** 49,59 ****
@@ -1825,5 +2022,5 @@
 ***************
 *** 104,111 ****
---- 113,124 ----
+--- 113,126 ----
   					-$(RM) $(bindir)/dgpart$(EXE)
   					-$(LN) $(bindir)/dgmap$(EXE) $(bindir)/dgpart$(EXE)
@@ -1831,4 +2028,6 @@
 + mexinstall			:
 + 					-$(CP) gmap_mex$(MEX) $(bindir)
++ 					-$(RM) $(bindir)/gpart_mex$(MEX)
++ 					-$(LN) $(bindir)/gmap_mex$(MEX) $(bindir)/gpart_mex$(MEX)
 + 
   clean				:
@@ -1840,5 +2039,5 @@
 ***************
 *** 365,367 ****
---- 378,396 ----
+--- 380,403 ----
   					$(libdir)/libscotch$(LIB)		\
   					$(libdir)/libscotcherrexit$(LIB)	\
@@ -1860,2 +2059,7 @@
 + 					$(libdir)/libscotcherrexit$(LIB)	\
 + 					gmap.h
++ 
++ gpart_mex$(MEX)			:	gmap_mex$(MEX)
++ 					-$(RM) gpart_mex$(MEX)
++ 					-$(LN) gmap_mex$(MEX) gpart_mex$(MEX)
++ 
Index: /issm/trunk/externalpackages/scotch/scotch_jes_notes.txt
===================================================================
--- /issm/trunk/externalpackages/scotch/scotch_jes_notes.txt	(revision 4628)
+++ /issm/trunk/externalpackages/scotch/scotch_jes_notes.txt	(revision 4629)
@@ -302,2 +302,7 @@
 - implemented common_integer.c/intRandResetStatic to reset static variables from previous runs.
 
+6/16/10:
+
+- renamed scotch x-layer and separated it from rest of build.
+- set up scotch to build both stand-alone and mex libraries.
+
