Only in src: bin
Only in src: include
Only in src: lib
diff -crB scotch_5.1/src/libscotch/arch.c src/src/libscotch/arch.c
*** scotch_5.1/src/libscotch/arch.c	2008-09-27 07:48:01.000000000 -0700
--- src/src/libscotch/arch.c	2013-05-06 14:14:11.000000000 -0700
***************
*** 173,187 ****
  int
  archLoad (
  Arch * restrict const       archptr,
! FILE * const                stream)
  {
    const ArchClass * restrict  class;              /* Pointer to architecture class */
    char                        name[256];          /* Architecture name string      */
  
    if (fscanf (stream, "%255s", name) != 1) {      /* Read architecture name */
      errorPrint ("archLoad: cannot load architecture type");
      return     (1);
    }
    name[255] = '\0';                               /* Set end of string */
  
    if ((class = archClass (name)) == NULL) {       /* Get class from its name */
--- 173,203 ----
  int
  archLoad (
  Arch * restrict const       archptr,
! FILE * const                stream
! #ifdef NOFILEIO
!                                   ,
! const char *                archtyp,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
  {
    const ArchClass * restrict  class;              /* Pointer to architecture class */
    char                        name[256];          /* Architecture name string      */
  
+ #ifdef NOFILEIO
+ //  printf("archLoad - stream=%p; archtyp=\"%s\"\n",stream,archtyp);
+ //  printf("archLoad - napar=%d,archpar=%p\n",napar,archpar);
+ #endif /* NOFILEIO */
+ 
+ #ifndef NOFILEIO
    if (fscanf (stream, "%255s", name) != 1) {      /* Read architecture name */
      errorPrint ("archLoad: cannot load architecture type");
      return     (1);
    }
+ #else /* NOFILEIO */
+   strcpy(name,archtyp);
+ #endif /* NOFILEIO */
    name[255] = '\0';                               /* Set end of string */
  
    if ((class = archClass (name)) == NULL) {       /* Get class from its name */
***************
*** 190,196 ****
--- 206,216 ----
    }
  
    if (class->archLoad != NULL) {                  /* If class has loading function */
+ #ifndef NOFILEIO
      if (class->archLoad (&archptr->data, stream) != 0) { /* Load class data        */
+ #else /* NOFILEIO */
+     if (class->archLoad (&archptr->data, stream, napar, archpar) != 0) { /* Load class data        */
+ #endif /* NOFILEIO */
        errorPrint ("archLoad: cannot load architecture data");
        memset     (archptr, 0, sizeof (Arch));     /* Initialize architecture body */
        return     (1);
diff -crB scotch_5.1/src/libscotch/arch_cmplt.c src/src/libscotch/arch_cmplt.c
*** scotch_5.1/src/libscotch/arch_cmplt.c	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_cmplt.c	2013-05-06 14:14:11.000000000 -0700
***************
*** 90,99 ****
  int
  archCmpltArchLoad (
  ArchCmplt * restrict const  archptr,
! FILE * restrict const       stream)
  {
    long                numnbr;
  
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchCmplt)    > sizeof (ArchDummy)) ||
        (sizeof (ArchCmpltDom) > sizeof (ArchDomDummy))) {
--- 90,109 ----
  int
  archCmpltArchLoad (
  ArchCmplt * restrict const  archptr,
! FILE * restrict const       stream
! #ifdef NOFILEIO
!                                   ,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
  {
    long                numnbr;
  
+ #ifdef NOFILEIO
+ //  printf("archCmpltArchLoad - napar=%d,archpar=%p\n",napar,archpar);
+ #endif /* NOFILEIO */
+ 
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchCmplt)    > sizeof (ArchDummy)) ||
        (sizeof (ArchCmpltDom) > sizeof (ArchDomDummy))) {
***************
*** 102,109 ****
--- 112,124 ----
    }
  #endif /* SCOTCH_DEBUG_ARCH1 */
  
+ #ifndef NOFILEIO
    if ((fscanf (stream, "%ld", &numnbr) != 1) ||
        (numnbr < 1)) {
+ #else /* NOFILEIO */
+   if ((napar < 1) ||
+       ((numnbr=(long)archpar[0]) < 1)) {
+ #endif /* NOFILEIO */
      errorPrint ("archCmpltArchLoad: bad input");
      return     (1);
    }
diff -crB scotch_5.1/src/libscotch/arch_cmplt.h src/src/libscotch/arch_cmplt.h
*** scotch_5.1/src/libscotch/arch_cmplt.h	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_cmplt.h	2013-05-06 14:14:11.000000000 -0700
***************
*** 87,93 ****
--- 87,97 ----
  #define static
  #endif
  
+ #ifndef NOFILEIO
  int                         archCmpltArchLoad   (ArchCmplt * restrict const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         archCmpltArchLoad   (ArchCmplt * restrict const, FILE * restrict const, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archCmpltArchSave   (const ArchCmplt * const, FILE * restrict const);
  #define archCmpltArchFree           NULL
  ArchDomNum                  archCmpltDomNum     (const ArchCmplt * const, const ArchCmpltDom * const);
diff -crB scotch_5.1/src/libscotch/arch_cmpltw.c src/src/libscotch/arch_cmpltw.c
*** scotch_5.1/src/libscotch/arch_cmpltw.c	2008-08-27 14:22:22.000000000 -0700
--- src/src/libscotch/arch_cmpltw.c	2013-05-06 14:14:12.000000000 -0700
***************
*** 200,211 ****
  int
  archCmpltwArchLoad (
  ArchCmpltw * restrict const  archptr,
! FILE * restrict const       stream)
  {
    long                vertnbr;
    Gnum                velosum;
    Anum                vertnum;
  
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchCmpltw)    > sizeof (ArchDummy)) ||
        (sizeof (ArchCmpltwDom) > sizeof (ArchDomDummy))) {
--- 200,221 ----
  int
  archCmpltwArchLoad (
  ArchCmpltw * restrict const  archptr,
! FILE * restrict const       stream
! #ifdef NOFILEIO
!                                   ,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
  {
    long                vertnbr;
    Gnum                velosum;
    Anum                vertnum;
  
+ #ifdef NOFILEIO
+ //  printf("archCmpltwArchLoad - napar=%d,archpar=%p\n",napar,archpar);
+ #endif /* NOFILEIO */
+ 
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchCmpltw)    > sizeof (ArchDummy)) ||
        (sizeof (ArchCmpltwDom) > sizeof (ArchDomDummy))) {
***************
*** 214,221 ****
--- 224,236 ----
    }
  #endif /* SCOTCH_DEBUG_ARCH1 */
  
+ #ifndef NOFILEIO
    if ((fscanf (stream, "%ld", &vertnbr) != 1) ||
        (vertnbr < 1)) {
+ #else /* NOFILEIO */
+   if ((napar < 1) ||
+       ((vertnbr=(long)archpar[0]) < 1)) {
+ #endif /* NOFILEIO */
      errorPrint ("archCmpltwArchLoad: bad input (1)");
      return     (1);
    }
***************
*** 230,237 ****
--- 245,257 ----
      long                veloval;
      Gnum                velotmp;
  
+ #ifndef NOFILEIO
      if ((fscanf (stream, "%ld", &veloval) != 1) ||
          (veloval < 1)) {
+ #else /* NOFILEIO */
+     if ((napar < 1+(vertnum+1)) ||
+         ((veloval=(long)archpar[1+(vertnum+1)]) < 1)) {
+ #endif /* NOFILEIO */
        errorPrint ("archCmpltwArchLoad: bad input (2)");
        return     (1);
      }
diff -crB scotch_5.1/src/libscotch/arch_cmpltw.h src/src/libscotch/arch_cmpltw.h
*** scotch_5.1/src/libscotch/arch_cmpltw.h	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_cmpltw.h	2013-05-06 14:14:12.000000000 -0700
***************
*** 86,92 ****
--- 86,96 ----
  #endif
  
  int                         archCmpltwArchBuild (ArchCmpltw * restrict const archptr, const Gnum, const Gnum * restrict const);
+ #ifndef NOFILEIO
  int                         archCmpltwArchLoad  (ArchCmpltw * restrict const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         archCmpltwArchLoad  (ArchCmpltw * restrict const, FILE * restrict const, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archCmpltwArchSave  (const ArchCmpltw * const, FILE * restrict const);
  int                         archCmpltwArchFree  (ArchCmpltw * restrict const);
  ArchDomNum                  archCmpltwDomNum    (const ArchCmpltw * const, const ArchCmpltwDom * const);
diff -crB scotch_5.1/src/libscotch/arch_deco.c src/src/libscotch/arch_deco.c
*** scotch_5.1/src/libscotch/arch_deco.c	2008-09-28 06:35:27.000000000 -0700
--- src/src/libscotch/arch_deco.c	2013-05-06 14:14:12.000000000 -0700
***************
*** 211,217 ****
  int
  archDecoArchLoad (
  ArchDeco * restrict const   archptr,
! FILE * restrict const       stream)
  {
    INT                         decotype;           /* Type of decomposition                            */
    INT                         termdomnbr;         /* Number of terminal domains (ie processors)       */
--- 211,223 ----
  int
  archDecoArchLoad (
  ArchDeco * restrict const   archptr,
! FILE * restrict const       stream
! #ifdef NOFILEIO
!                                   ,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
  {
    INT                         decotype;           /* Type of decomposition                            */
    INT                         termdomnbr;         /* Number of terminal domains (ie processors)       */
***************
*** 220,225 ****
--- 226,237 ----
    Anum * restrict             termdisttab;        /* Table of terminal-to-terminal distances          */
    INT                         i, j;
  
+ #ifdef NOFILEIO
+ //  printf("archDecoArchLoad - napar=%d,archpar=%p\n",napar,archpar);
+   errorPrint ("archDecoArchLoad - not yet converted to matlab matrices");
+   return     (1);
+ #endif /* NOFILEIO */
+ 
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchDeco)    > sizeof (ArchDummy)) ||
        (sizeof (ArchDecoDom) > sizeof (ArchDomDummy))) {
diff -crB scotch_5.1/src/libscotch/arch_deco.h src/src/libscotch/arch_deco.h
*** scotch_5.1/src/libscotch/arch_deco.h	2008-09-27 07:49:46.000000000 -0700
--- src/src/libscotch/arch_deco.h	2013-05-06 14:14:13.000000000 -0700
***************
*** 113,119 ****
--- 113,123 ----
  #endif
  
  int                         archDecoArchBuild   (ArchDeco * const, const Anum, const Anum, const ArchDecoTermVert * const, const Anum  * const);
+ #ifndef NOFILEIO
  int                         archDecoArchLoad    (ArchDeco * const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         archDecoArchLoad    (ArchDeco * const, FILE * restrict const, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archDecoArchSave    (const ArchDeco * const, FILE * restrict const);
  int                         archDecoArchFree    (ArchDeco * const);
  Anum                        archDecoArchSize    (ArchDeco * const, const Anum);
diff -crB scotch_5.1/src/libscotch/arch.h src/src/libscotch/arch.h
*** scotch_5.1/src/libscotch/arch.h	2009-04-28 08:11:27.000000000 -0700
--- src/src/libscotch/arch.h	2013-05-06 14:14:13.000000000 -0700
***************
*** 175,181 ****
--- 175,185 ----
  int                         archInit            (Arch * restrict const);
  int                         archExit            (Arch * restrict const);
  int                         archFree            (Arch * restrict const);
+ #ifndef NOFILEIO
  int                         archLoad            (Arch * restrict const, FILE * const);
+ #else /* NOFILEIO */
+ int                         archLoad            (Arch * restrict const, FILE * const, const char *, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archSave            (const Arch * const, FILE * const);
  char *                      archName            (const Arch * const);
  const ArchClass *           archClass           (const char * const);
diff -crB scotch_5.1/src/libscotch/arch_hcub.c src/src/libscotch/arch_hcub.c
*** scotch_5.1/src/libscotch/arch_hcub.c	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_hcub.c	2013-05-06 14:14:13.000000000 -0700
***************
*** 88,95 ****
  int
  archHcubArchLoad (
  ArchHcub * restrict const   archptr,
! FILE * restrict const       stream)
  {
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchHcub)    > sizeof (ArchDummy)) ||
        (sizeof (ArchHcubDom) > sizeof (ArchDomDummy))) {
--- 88,105 ----
  int
  archHcubArchLoad (
  ArchHcub * restrict const   archptr,
! FILE * restrict const       stream
! #ifdef NOFILEIO
!                                   ,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
  {
+ #ifdef NOFILEIO
+ //  printf("archHcubArchLoad - napar=%d,archpar=%p\n",napar,archpar);
+ #endif /* NOFILEIO */
+ 
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchHcub)    > sizeof (ArchDummy)) ||
        (sizeof (ArchHcubDom) > sizeof (ArchDomDummy))) {
***************
*** 98,105 ****
--- 108,120 ----
    }
  #endif /* SCOTCH_DEBUG_ARCH1 */
  
+ #ifndef NOFILEIO
    if ((intLoad (stream, &archptr->dimmax) != 1) ||
        (archptr->dimmax < 1)                     ||
+ #else /* NOFILEIO */
+   if ((napar < 1)                        ||
+       ((archptr->dimmax=archpar[0]) < 1) ||
+ #endif /* NOFILEIO */
        (archptr->dimmax > (sizeof (archptr->dimmax) << 3))) {
      errorPrint ("archHcubArchLoad: bad input");
      return     (1);
diff -crB scotch_5.1/src/libscotch/arch_hcub.h src/src/libscotch/arch_hcub.h
*** scotch_5.1/src/libscotch/arch_hcub.h	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_hcub.h	2013-05-06 14:14:14.000000000 -0700
***************
*** 85,91 ****
--- 85,95 ----
  #define static
  #endif
  
+ #ifndef NOFILEIO
  int                         archHcubArchLoad    (ArchHcub * restrict const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         archHcubArchLoad    (ArchHcub * restrict const, FILE * restrict const, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archHcubArchSave    (const ArchHcub * const, FILE * restrict const);
  #define archHcubArchFree            NULL
  ArchDomNum                  archHcubDomNum      (const ArchHcub * const, const ArchHcubDom * const);
diff -crB scotch_5.1/src/libscotch/arch_mesh.c src/src/libscotch/arch_mesh.c
*** scotch_5.1/src/libscotch/arch_mesh.c	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_mesh.c	2013-05-06 14:14:14.000000000 -0700
***************
*** 96,103 ****
  int
  archMesh2ArchLoad (
  ArchMesh2 * restrict const  archptr,
! FILE * restrict const       stream)
! {
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchMesh2)    > sizeof (ArchDummy)) ||
        (sizeof (ArchMesh2Dom) > sizeof (ArchDomDummy))) {
--- 96,113 ----
  int
  archMesh2ArchLoad (
  ArchMesh2 * restrict const  archptr,
! FILE * restrict const       stream
! #ifdef NOFILEIO
!                                   ,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
! {
! #ifdef NOFILEIO
! //  printf("archMesh2ArchLoad - napar=%d,archpar=%p\n",napar,archpar);
! #endif /* NOFILEIO */
! 
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchMesh2)    > sizeof (ArchDummy)) ||
        (sizeof (ArchMesh2Dom) > sizeof (ArchDomDummy))) {
***************
*** 106,114 ****
--- 116,130 ----
    }
  #endif /* SCOTCH_DEBUG_ARCH1 */
  
+ #ifndef NOFILEIO
    if ((intLoad (stream, &archptr->c[0]) != 1) ||
        (intLoad (stream, &archptr->c[1]) != 1) ||
        (archptr->c[0] < 1) || (archptr->c[1] < 1)) {
+ #else /* NOFILEIO */
+   if ((napar < 2)                      ||
+       ((archptr->c[0]=archpar[0]) < 1) ||
+       ((archptr->c[1]=archpar[1]) < 1)) {
+ #endif /* NOFILEIO */
      errorPrint ("archMesh2ArchLoad: bad input");
      return     (1);
    }
***************
*** 421,428 ****
  int
  archMesh3ArchLoad (
  ArchMesh3 * restrict const  archptr,
! FILE * restrict const       stream)
! {
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchMesh3)    > sizeof (ArchDummy)) ||
        (sizeof (ArchMesh3Dom) > sizeof (ArchDomDummy))) {
--- 437,454 ----
  int
  archMesh3ArchLoad (
  ArchMesh3 * restrict const  archptr,
! FILE * restrict const       stream
! #ifdef NOFILEIO
!                                   ,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
! {
! #ifdef NOFILEIO
! //  printf("archMesh3ArchLoad - napar=%d,archpar=%p\n",napar,archpar);
! #endif /* NOFILEIO */
! 
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchMesh3)    > sizeof (ArchDummy)) ||
        (sizeof (ArchMesh3Dom) > sizeof (ArchDomDummy))) {
***************
*** 431,440 ****
--- 457,473 ----
    }
  #endif /* SCOTCH_DEBUG_ARCH1 */
  
+ #ifndef NOFILEIO
    if ((intLoad (stream, &archptr->c[0]) != 1) ||
        (intLoad (stream, &archptr->c[1]) != 1) ||
        (intLoad (stream, &archptr->c[2]) != 1) ||
        (archptr->c[0] < 1) || (archptr->c[1] < 1) || (archptr->c[2] < 1)) {
+ #else /* NOFILEIO */
+   if ((napar < 3)                      ||
+       ((archptr->c[0]=archpar[0]) < 1) ||
+       ((archptr->c[1]=archpar[1]) < 1) ||
+       ((archptr->c[2]=archpar[2]) < 1)) {
+ #endif /* NOFILEIO */
      errorPrint ("archMesh3ArchLoad: bad input");
      return     (1);
    }
diff -crB scotch_5.1/src/libscotch/arch_mesh.h src/src/libscotch/arch_mesh.h
*** scotch_5.1/src/libscotch/arch_mesh.h	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_mesh.h	2013-05-06 14:14:14.000000000 -0700
***************
*** 96,102 ****
--- 96,106 ----
  #define static
  #endif
  
+ #ifndef NOFILEIO
  int                         archMesh2ArchLoad   (ArchMesh2 * restrict const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         archMesh2ArchLoad   (ArchMesh2 * restrict const, FILE * restrict const, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archMesh2ArchSave   (const ArchMesh2 * const, FILE * restrict const);
  #define archMesh2ArchFree           NULL
  ArchDomNum                  archMesh2DomNum     (const ArchMesh2 * const, const ArchMesh2Dom * const);
***************
*** 114,120 ****
--- 118,128 ----
  int                         archMesh2DomMpiType (const ArchMesh2 * const, MPI_Datatype * const);
  #endif /* SCOTCH_PTSCOTCH */
  
+ #ifndef NOFILEIO
  int                         archMesh3ArchLoad   (ArchMesh3 * restrict const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         archMesh3ArchLoad   (ArchMesh3 * restrict const, FILE * restrict const, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archMesh3ArchSave   (const ArchMesh3 * const, FILE * restrict const);
  #define archMesh3ArchFree           NULL
  ArchDomNum                  archMesh3DomNum     (const ArchMesh3 * const, const ArchMesh3Dom * const);
diff -crB scotch_5.1/src/libscotch/arch_tleaf.c src/src/libscotch/arch_tleaf.c
*** scotch_5.1/src/libscotch/arch_tleaf.c	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_tleaf.c	2013-05-06 14:14:14.000000000 -0700
***************
*** 92,99 ****
  int
  archTleafArchLoad (
  ArchTleaf * restrict const  archptr,
! FILE * restrict const       stream)
  {
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchTleaf)    > sizeof (ArchDummy)) ||
        (sizeof (ArchTleafDom) > sizeof (ArchDomDummy))) {
--- 92,109 ----
  int
  archTleafArchLoad (
  ArchTleaf * restrict const  archptr,
! FILE * restrict const       stream
! #ifdef NOFILEIO
!                                   ,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
  {
+ #ifdef NOFILEIO
+ //  printf("archTleafArchLoad - napar=%d,archpar=%p\n",napar,archpar);
+ #endif /* NOFILEIO */
+ 
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchTleaf)    > sizeof (ArchDummy)) ||
        (sizeof (ArchTleafDom) > sizeof (ArchDomDummy))) {
***************
*** 102,107 ****
--- 112,118 ----
    }
  #endif /* SCOTCH_DEBUG_ARCH1 */
  
+ #ifndef NOFILEIO
    if ((intLoad (stream, &archptr->leafdep) != 1) ||
        (intLoad (stream, &archptr->clusdep) != 1) ||
        (intLoad (stream, &archptr->linkval) != 1) ||
***************
*** 109,114 ****
--- 120,132 ----
        (archptr->clusdep < 0)                     ||
        (archptr->clusdep > archptr->leafdep)      ||
        (archptr->linkval < 1)) {
+ #else /* NOFILEIO */
+   if ((napar < 3)                            ||
+       ((archptr->leafdep=archpar[0]) < 1)    ||
+       ((archptr->clusdep=archpar[1]) < 0)    ||
+       ( archptr->clusdep > archptr->leafdep) ||
+       ((archptr->linkval=archpar[2]) < 1)) {
+ #endif /* NOFILEIO */
      errorPrint ("archTleafArchLoad: bad input");
      return     (1);
    }
diff -crB scotch_5.1/src/libscotch/arch_tleaf.h src/src/libscotch/arch_tleaf.h
*** scotch_5.1/src/libscotch/arch_tleaf.h	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_tleaf.h	2013-05-06 14:14:15.000000000 -0700
***************
*** 89,95 ****
--- 89,99 ----
  #define static
  #endif
  
+ #ifndef NOFILEIO
  int                         archTleafArchLoad   (ArchTleaf * restrict const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         archTleafArchLoad   (ArchTleaf * restrict const, FILE * restrict const, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archTleafArchSave   (const ArchTleaf * const, FILE * restrict const);
  #define archTleafArchFree           NULL
  ArchDomNum                  archTleafDomNum     (const ArchTleaf * const, const ArchTleafDom * const);
diff -crB scotch_5.1/src/libscotch/arch_torus.c src/src/libscotch/arch_torus.c
*** scotch_5.1/src/libscotch/arch_torus.c	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_torus.c	2013-05-06 14:14:15.000000000 -0700
***************
*** 90,97 ****
  int
  archTorus2ArchLoad (
  ArchTorus2 * restrict const archptr,
! FILE * restrict const       stream)
! {
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchTorus2)    > sizeof (ArchDummy)) ||
        (sizeof (ArchTorus2Dom) > sizeof (ArchDomDummy))) {
--- 90,107 ----
  int
  archTorus2ArchLoad (
  ArchTorus2 * restrict const archptr,
! FILE * restrict const       stream
! #ifdef NOFILEIO
!                                   ,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
! {
! #ifdef NOFILEIO
! //  printf("archTorus2ArchLoad - napar=%d,archpar=%p\n",napar,archpar);
! #endif /* NOFILEIO */
! 
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchTorus2)    > sizeof (ArchDummy)) ||
        (sizeof (ArchTorus2Dom) > sizeof (ArchDomDummy))) {
***************
*** 100,108 ****
--- 110,124 ----
    }
  #endif /* SCOTCH_DEBUG_ARCH1 */
  
+ #ifndef NOFILEIO
    if ((intLoad (stream, &archptr->c[0]) != 1) ||
        (intLoad (stream, &archptr->c[1]) != 1) ||
        (archptr->c[0] < 1) || (archptr->c[1] < 1)) {
+ #else /* NOFILEIO */
+   if ((napar < 2)                      ||
+       ((archptr->c[0]=archpar[0]) < 1) ||
+       ((archptr->c[1]=archpar[1]) < 1)) {
+ #endif /* NOFILEIO */
      errorPrint ("archTorus2ArchLoad: bad input");
      return     (1);
    }
***************
*** 363,370 ****
  int
  archTorus3ArchLoad (
  ArchTorus3 * restrict const archptr,
! FILE * restrict const       stream)
! {
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchTorus3)    > sizeof (ArchDummy)) ||
        (sizeof (ArchTorus3Dom) > sizeof (ArchDomDummy))) {
--- 379,396 ----
  int
  archTorus3ArchLoad (
  ArchTorus3 * restrict const archptr,
! FILE * restrict const       stream
! #ifdef NOFILEIO
!                                   ,
! const Anum                  napar,
! const Anum *                archpar
! #endif /* NOFILEIO */
!                                    )
! {
! #ifdef NOFILEIO
! //  printf("archTorus3ArchLoad - napar=%d,archpar=%p\n",napar,archpar);
! #endif /* NOFILEIO */
! 
  #ifdef SCOTCH_DEBUG_ARCH1
    if ((sizeof (ArchTorus3)    > sizeof (ArchDummy)) ||
        (sizeof (ArchTorus3Dom) > sizeof (ArchDomDummy))) {
***************
*** 373,382 ****
--- 399,415 ----
    }
  #endif /* SCOTCH_DEBUG_ARCH1 */
  
+ #ifndef NOFILEIO
    if ((intLoad (stream, &archptr->c[0]) != 1) ||
        (intLoad (stream, &archptr->c[1]) != 1) ||
        (intLoad (stream, &archptr->c[2]) != 1) ||
        (archptr->c[0] < 1) || (archptr->c[1] < 1) || (archptr->c[2] < 1)) {
+ #else /* NOFILEIO */
+   if ((napar < 3)                      ||
+       ((archptr->c[0]=archpar[0]) < 1) ||
+       ((archptr->c[1]=archpar[1]) < 1) ||
+       ((archptr->c[2]=archpar[2]) < 1)) {
+ #endif /* NOFILEIO */
      errorPrint ("archTorus3ArchLoad: bad input");
      return     (1);
    }
diff -crB scotch_5.1/src/libscotch/arch_torus.h src/src/libscotch/arch_torus.h
*** scotch_5.1/src/libscotch/arch_torus.h	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/arch_torus.h	2013-05-06 14:14:15.000000000 -0700
***************
*** 96,102 ****
--- 96,106 ----
  #define static
  #endif
  
+ #ifndef NOFILEIO
  int                         archTorus2ArchLoad  (ArchTorus2 * restrict const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         archTorus2ArchLoad  (ArchTorus2 * restrict const, FILE * restrict const, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archTorus2ArchSave  (const ArchTorus2 * const, FILE * restrict const);
  #define archTorus2ArchFree          NULL
  ArchDomNum                  archTorus2DomNum    (const ArchTorus2 * const, const ArchTorus2Dom * const);
***************
*** 114,120 ****
--- 118,128 ----
  int                         archTorus2DomMpiType (const ArchTorus2 * const, MPI_Datatype * const);
  #endif /* SCOTCH_PTSCOTCH */
  
+ #ifndef NOFILEIO
  int                         archTorus3ArchLoad  (ArchTorus3 * restrict const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         archTorus3ArchLoad  (ArchTorus3 * restrict const, FILE * restrict const, const Anum, const Anum *);
+ #endif /* NOFILEIO */
  int                         archTorus3ArchSave  (const ArchTorus3 * const, FILE * restrict const);
  #define archTorus3ArchFree          NULL
  ArchDomNum                  archTorus3DomNum    (const ArchTorus3 * const, const ArchTorus3Dom * const);
diff -crB scotch_5.1/src/libscotch/common.c src/src/libscotch/common.c
*** scotch_5.1/src/libscotch/common.c	2008-05-22 06:44:41.000000000 -0700
--- src/src/libscotch/common.c	2013-05-06 14:14:15.000000000 -0700
***************
*** 100,106 ****
--- 100,112 ----
  {
    const char **       cptr;
  
+ #ifndef MATLAB
    fprintf (stream, "Usage is:\n");
    for (cptr = data; *cptr != NULL; cptr ++)
      fprintf (stream, "  %s\n", *cptr);
+ #else /* MATLAB */
+   mexPrintf ("Usage is:\n");
+   for (cptr = data; *cptr != NULL; cptr ++)
+     mexPrintf ("  %s\n", *cptr);
+ #endif /* MATLAB */
  }
diff -crB scotch_5.1/src/libscotch/common.h src/src/libscotch/common.h
*** scotch_5.1/src/libscotch/common.h	2009-02-06 14:20:55.000000000 -0800
--- src/src/libscotch/common.h	2013-05-09 11:49:35.317220518 -0700
***************
*** 1,3 ****
--- 1,5 ----
+ #ifndef _SCOTCH_COMMON_H_
+ #define _SCOTCH_COMMON_H_
  /* Copyright 2004,2007-2009 ENSEIRB, INRIA & CNRS
  **
  ** This file is part of the Scotch software package for static mapping,
***************
*** 79,84 ****
--- 81,87 ----
  #include            <sys/resource.h>
  #endif /* COMMON_TIMING_OLD */
  #include            <unistd.h>
+ #include            <sys/param.h>
  
  #ifdef SCOTCH_PTSCOTCH
  #include            <mpi.h>
***************
*** 106,113 ****
  #define memCpy(dst,src,siz)         memcpy((dst),(src),(siz))
  #define memMov(dst,src,siz)         memmove((dst),(src),(siz))
  
- #define MIN(x,y)                    (((x) < (y)) ? (x) : (y))
- #define MAX(x,y)                    (((x) < (y)) ? (y) : (x))
  #define ABS(x)                      MAX ((x), -(x))
  #define SIGN(x)                     (((x) < 0) ? -1 : 1)
  
--- 109,114 ----
***************
*** 171,179 ****
  /** The file structure. **/
  
  typedef struct File_ {
!   char *                    name;                 /*+ File name    +*/
    FILE *                    pntr;                 /*+ File pointer +*/
!   char *                    mode;                 /*+ Opening mode +*/
  } File;
  
  /*
--- 172,180 ----
  /** The file structure. **/
  
  typedef struct File_ {
!   const char *              name;                 /*+ File name    +*/
    FILE *                    pntr;                 /*+ File pointer +*/
!   const char *              mode;                 /*+ Opening mode +*/
  } File;
  
  /*
***************
*** 190,216 ****
  size_t                      memMax              ();
  #endif /* COMMON_MEMORY_TRACE */
  
- void                        usagePrint          (FILE * const, const char (* []));
  
- int                         fileBlockOpen       (File * const, const int);
  int                         fileBlockOpenDist   (File * const, const int, const int, const int, const int);
- void                        fileBlockClose      (File * const, const int);
  FILE *                      fileCompress        (FILE * const, const int);
  int                         fileCompressType    (const char * const);
  FILE *                      fileUncompress      (FILE * const, const int);
  int                         fileUncompressType  (const char * const);
  int                         fileNameDistExpand  (char ** const, const int, const int, const int);
  
  void                        errorProg           (const char * const);
  void                        errorPrint          (const char * const, ...);
  void                        errorPrintW         (const char * const, ...);
  
  int                         intLoad             (FILE * const, INT * const);
  int                         intSave             (FILE * const, const INT);
  void                        intAscn             (INT * const, const INT, const INT);
  void                        intPerm             (INT * const, const INT);
  void                        intRandReset        (void);
- void                        intRandInit         (void);
  INT                         intRandVal          (INT);
  void                        intSort1asc1        (void * const, const INT);
  void                        intSort2asc1        (void * const, const INT);
--- 191,227 ----
  size_t                      memMax              ();
  #endif /* COMMON_MEMORY_TRACE */
  
  
  int                         fileBlockOpenDist   (File * const, const int, const int, const int, const int);
  FILE *                      fileCompress        (FILE * const, const int);
  int                         fileCompressType    (const char * const);
  FILE *                      fileUncompress      (FILE * const, const int);
  int                         fileUncompressType  (const char * const);
  int                         fileNameDistExpand  (char ** const, const int, const int, const int);
  
+ #ifdef __cplusplus
+ extern "C" {
+ #endif /* __cplusplus */
+ 
  void                        errorProg           (const char * const);
  void                        errorPrint          (const char * const, ...);
  void                        errorPrintW         (const char * const, ...);
+ double                      clockGet            (void);
+ void                        usagePrint          (FILE * const, const char (* []));
+ void                        intRandInit         (void);
+ int                         fileBlockOpen       (File * const, const int);
+ void                        fileBlockClose      (File * const, const int);
+ void                        intRandResetStatic  (void);
+ 
+ #ifdef __cplusplus
+ }
+ #endif /* __cplusplus */
  
  int                         intLoad             (FILE * const, INT * const);
  int                         intSave             (FILE * const, const INT);
  void                        intAscn             (INT * const, const INT, const INT);
  void                        intPerm             (INT * const, const INT);
  void                        intRandReset        (void);
  INT                         intRandVal          (INT);
  void                        intSort1asc1        (void * const, const INT);
  void                        intSort2asc1        (void * const, const INT);
***************
*** 221,227 ****
  void                        clockStart          (Clock * const);
  void                        clockStop           (Clock * const);
  double                      clockVal            (Clock * const);
- double                      clockGet            (void);
  
  /*
  **  Macro definitions.
--- 232,237 ----
***************
*** 249,251 ****
--- 259,263 ----
  void nl##__ pl                                   \
  { nu pc; }                                       \
  void nu pl
+ 
+ #endif //#ifndef _SCOTCH_COMMON_H_
diff -crB scotch_5.1/src/libscotch/common_integer.c src/src/libscotch/common_integer.c
*** scotch_5.1/src/libscotch/common_integer.c	2009-01-21 01:32:32.000000000 -0800
--- src/src/libscotch/common_integer.c	2013-05-06 14:14:16.000000000 -0700
***************
*** 191,196 ****
--- 191,209 ----
  static volatile int intrandflag = 0;              /*+ Flag set if generator already initialized +*/
  static unsigned int intrandseed = 1;              /*+ Random seed                               +*/
  
+ void
+ intRandResetStatic (void)
+ {
+ #ifdef MATLAB
+ //  printf("intRandResetStatic begin - intrandflag=%d,intrandseed=%d\n",intrandflag,intrandseed);
+ #endif /* MATLAB */
+   intrandflag = 0;              /*+ Flag set if generator already initialized +*/
+   intrandseed = 1;              /*+ Random seed                               +*/
+ #ifdef MATLAB
+ //  printf("intRandResetStatic end   - intrandflag=%d,intrandseed=%d\n",intrandflag,intrandseed);
+ #endif /* MATLAB */
+ }
+ 
  /* 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 ****
--- 218,226 ----
  void
  intRandInit (void)
  {
+ #ifdef MATLAB
+ //  printf("intRandInit begin - intrandflag=%d,intrandseed=%d\n",intrandflag,intrandseed);
+ #endif /* MATLAB */
    if (intrandflag == 0) {                         /* If generator not yet initialized */
  #if ! ((defined COMMON_DEBUG) || (defined COMMON_RANDOM_FIXED_SEED) || (defined SCOTCH_DETERMINISTIC))
      intrandseed = time (NULL);                    /* Set random seed if needed */
***************
*** 216,221 ****
--- 232,240 ----
  #endif /* COMMON_RANDOM_RAND */
      intrandflag = 1;                              /* Generator has been initialized */
    }
+ #ifdef MATLAB
+ //  printf("intRandInit end   - intrandflag=%d,intrandseed=%d\n",intrandflag,intrandseed);
+ #endif /* MATLAB */
  }
  
  /* This routine reinitializes the pseudo-random
***************
*** 228,233 ****
--- 247,255 ----
  void
  intRandReset (void)
  {
+ #ifdef MATLAB
+ //  printf("intRandReset begin - intrandflag=%d,intrandseed=%d\n",intrandflag,intrandseed);
+ #endif /* MATLAB */
    if (intrandflag != 0) {                         /* Keep seed computed during first initialization */
  #ifdef COMMON_RANDOM_RAND
      srand (intrandseed);
***************
*** 237,242 ****
--- 259,267 ----
    }
    else
      intRandInit ();
+ #ifdef MATLAB
+ //  printf("intRandReset end   - intrandflag=%d,intrandseed=%d\n",intrandflag,intrandseed);
+ #endif /* MATLAB */
  }
  
  /*********************/
diff -crB scotch_5.1/src/libscotch/common_memory.c src/src/libscotch/common_memory.c
*** scotch_5.1/src/libscotch/common_memory.c	2009-01-03 02:16:11.000000000 -0800
--- src/src/libscotch/common_memory.c	2013-05-06 14:14:16.000000000 -0700
***************
*** 87,93 ****
--- 87,95 ----
    size_t              newadd;
    byte *              newptr;
  
+   printf("memAllocRecord begin -- memorysiz=%d,memorymax=%d\n",memorysiz,memorymax);
  #if (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD))
+   printf("memAllocRecord begin -- muteflag=%d,mutelocdat=%p\n",muteflag,mutelocdat);
    if (muteflag != 0) {                            /* Unsafe code with respect to race conditions but should work as first allocs are sequential */
      muteflag = 0;
      pthread_mutex_init (&mutelocdat, NULL);       /* Initialize local mutex */
***************
*** 109,116 ****
--- 111,120 ----
  
  #if (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD))
    pthread_mutex_unlock (&mutelocdat);             /* Unlock local mutex */
+   printf("memAllocRecord end   -- muteflag=%d,mutelocdat=%p\n",muteflag,mutelocdat);
  #endif /* (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD)) */
  
+   printf("memAllocRecord end   -- memorysiz=%d,memorymax=%d\n",memorysiz,memorymax);
    return ((void *) newptr);                       /* Return skewed pointer or NULL */
  }
  
***************
*** 124,133 ****
--- 128,139 ----
    size_t              oldsiz;
    size_t              newadd;
  
+   printf("memReallocRecord begin -- memorysiz=%d,memorymax=%d\n",memorysiz,memorymax);
    tmpptr = ((byte *) oldptr) - COMMON_MEMORY_SKEW;
    oldsiz = *((size_t *) tmpptr);
  
  #if (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD))
+   printf("memReallocRecord begin -- muteflag=%d,mutelocdat=%p\n",muteflag,mutelocdat);
    pthread_mutex_lock (&mutelocdat);               /* Lock local mutex */
  #endif /* (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD)) */
  
***************
*** 145,152 ****
--- 151,160 ----
  
  #if (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD))
    pthread_mutex_unlock (&mutelocdat);             /* Unlock local mutex */
+   printf("memReallocRecord end   -- muteflag=%d,mutelocdat=%p\n",muteflag,mutelocdat);
  #endif /* (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD)) */
  
+   printf("memReallocRecord end   -- memorysiz=%d,memorymax=%d\n",memorysiz,memorymax);
    return ((void *) newptr);                       /* Return skewed pointer or NULL */
  }
  
***************
*** 157,166 ****
--- 165,176 ----
    byte *              tmpptr;
    size_t              oldsiz;
  
+   printf("memFreeRecord begin -- memorysiz=%d,memorymax=%d\n",memorysiz,memorymax);
    tmpptr = ((byte *) oldptr) - COMMON_MEMORY_SKEW;
    oldsiz = *((size_t *) tmpptr);
  
  #if (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD))
+   printf("memFreeRecord begin -- muteflag=%d,mutelocdat=%p\n",muteflag,mutelocdat);
    pthread_mutex_lock (&mutelocdat);               /* Lock local mutex */
  #endif /* (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD)) */
  
***************
*** 169,175 ****
--- 179,187 ----
  
  #if (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD))
    pthread_mutex_unlock (&mutelocdat);             /* Unlock local mutex */
+   printf("memFreeRecord end   -- muteflag=%d,mutelocdat=%p\n",muteflag,mutelocdat);
  #endif /* (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD)) */
+   printf("memFreeRecord end   -- memorysiz=%d,memorymax=%d\n",memorysiz,memorymax);
  }
  
  size_t
***************
*** 177,183 ****
--- 189,197 ----
  {
    size_t              curmax;
  
+   printf("memMax begin -- memorysiz=%d,memorymax=%d\n",memorysiz,memorymax);
  #if (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD))
+   printf("memMax begin -- muteflag=%d,mutelocdat=%p\n",muteflag,mutelocdat);
    pthread_mutex_lock (&mutelocdat);               /* Lock local mutex */
  #endif /* (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD)) */
  
***************
*** 185,192 ****
--- 199,208 ----
  
  #if (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD))
    pthread_mutex_unlock (&mutelocdat);             /* Unlock local mutex */
+   printf("memMax end   -- muteflag=%d,mutelocdat=%p\n",muteflag,mutelocdat);
  #endif /* (defined (COMMON_PTHREAD) || defined (SCOTCH_PTHREAD)) */
  
+   printf("memMax end   -- memorysiz=%d,memorymax=%d\n",memorysiz,memorymax);
    return (curmax);
  }
  #endif /* COMMON_MEMORY_TRACE */
diff -crB scotch_5.1/src/libscotch/dummysizes.c src/src/libscotch/dummysizes.c
*** scotch_5.1/src/libscotch/dummysizes.c	2009-05-09 16:08:02.000000000 -0700
--- src/src/libscotch/dummysizes.c	2013-05-06 14:14:16.000000000 -0700
***************
*** 267,271 ****
--- 267,273 ----
    }
  #endif /* SCOTCH_DEBUG_MAIN1 */
  
+ #ifndef MATLAB
    exit (0);
+ #endif /* MATLAB */
  }
diff -crB scotch_5.1/src/libscotch/graph.c src/src/libscotch/graph.c
*** scotch_5.1/src/libscotch/graph.c	2008-05-22 06:44:42.000000000 -0700
--- src/src/libscotch/graph.c	2013-05-06 14:14:17.000000000 -0700
***************
*** 135,141 ****
      if ((grafptr->velotax != NULL) &&             /* Free graph tables             */
          ((grafptr->flagval & GRAPHVERTGROUP) == 0))
        memFree (grafptr->velotax + grafptr->baseval);
!     if (grafptr->vlbltax != NULL)
        memFree (grafptr->vlbltax + grafptr->baseval);
      if ((grafptr->edlotax != NULL) &&
          ((grafptr->flagval & GRAPHEDGEGROUP) == 0))
--- 135,144 ----
      if ((grafptr->velotax != NULL) &&             /* Free graph tables             */
          ((grafptr->flagval & GRAPHVERTGROUP) == 0))
        memFree (grafptr->velotax + grafptr->baseval);
! /*  vlbltax must also check GRAPHVERTGROUP (jes, 12/11/09)  */
! //    if (grafptr->vlbltax != NULL)
!     if ((grafptr->vlbltax != NULL) &&
!         ((grafptr->flagval & GRAPHVERTGROUP) == 0))
        memFree (grafptr->vlbltax + grafptr->baseval);
      if ((grafptr->edlotax != NULL) &&
          ((grafptr->flagval & GRAPHEDGEGROUP) == 0))
diff -crB scotch_5.1/src/libscotch/graph.h src/src/libscotch/graph.h
*** scotch_5.1/src/libscotch/graph.h	2008-06-01 02:49:11.000000000 -0700
--- src/src/libscotch/graph.h	2013-05-06 14:14:17.000000000 -0700
***************
*** 159,165 ****
--- 159,169 ----
  int                         graphInit           (Graph * const);
  void                        graphExit           (Graph * const);
  void                        graphFree           (Graph * const);
+ #ifndef NOFILEIO
  int                         graphLoad           (Graph * const, FILE * const, const Gnum, const GraphFlag);
+ #else /* NOFILEIO */
+ int                         graphLoad           (Graph * const, FILE * const, const Gnum, const GraphFlag, const Gnum, const Gnum, const Gnum*, const Gnum*, const Gnum*, const Gnum*, const Gnum*);
+ #endif /* NOFILEIO */
  int                         graphLoad2          (const Gnum, const Gnum, const Gnum * const, const Gnum * const, Gnum * restrict const, const Gnum, const Gnum * const);
  int                         graphSave           (const Graph * const, FILE * const);
  Gnum                        graphBase           (Graph * const, const Gnum);
diff -crB scotch_5.1/src/libscotch/graph_io.c src/src/libscotch/graph_io.c
*** scotch_5.1/src/libscotch/graph_io.c	2008-05-22 06:44:42.000000000 -0700
--- src/src/libscotch/graph_io.c	2013-05-06 14:14:17.000000000 -0700
***************
*** 86,92 ****
  Graph * restrict const      grafptr,              /* Graph structure to fill              */
  FILE * const                stream,               /* Stream from which to read graph data */
  const Gnum                  baseval,              /* Base value (-1 means keep file base) */
! const GraphFlag             flagval)              /* Graph loading flags                  */
  {
    Gnum                edgenum;                    /* Number of edges really allocated */
    Gnum                edgennd;
--- 86,103 ----
  Graph * restrict const      grafptr,              /* Graph structure to fill              */
  FILE * const                stream,               /* Stream from which to read graph data */
  const Gnum                  baseval,              /* Base value (-1 means keep file base) */
! const GraphFlag             flagval               /* Graph loading flags                  */
! #ifdef NOFILEIO
!                                    ,
! const Gnum                  nvert,
! const Gnum                  nedge2,
! const Gnum*                 adjir,
! const Gnum*                 adjjc,
! const Gnum*                 vertlab,
! const Gnum*                 vertwgt,
! const Gnum*                 edgewgt
! #endif /* NOFILEIO */
!                                    )
  {
    Gnum                edgenum;                    /* Number of edges really allocated */
    Gnum                edgennd;
***************
*** 104,120 ****
--- 115,141 ----
    char                proptab[4];
    Gnum                vertnum;
  
+ #ifdef NOFILEIO
+ //  printf("graphLoad - stream=%p; nvert=%d,nedge2=%d\n",stream,nvert,nedge2);
+ //  printf("graphLoad - adjir=%p,adjjc=%p,vertlab=%p,vertwgt=%p,edgewgt=%p\n",
+ //         adjir,adjjc,vertlab,vertwgt,edgewgt);
+ #endif /* NOFILEIO */
    memSet (grafptr, 0, sizeof (Graph));
  
+ #ifndef NOFILEIO
    if (intLoad (stream, &versval) != 1) {          /* Read version number */
      errorPrint ("graphLoad: bad input (1)");
      return     (1);
    }
+ #else /* NOFILEIO */
+   versval=0;
+ #endif /* NOFILEIO */
    if (versval != 0) {                             /* If version not zero */
      errorPrint ("graphLoad: old-style graph format no longer supported");
      return     (1);
    }
  
+ #ifndef NOFILEIO
    if ((intLoad (stream, &grafptr->vertnbr) != 1) || /* Read rest of header */
        (intLoad (stream, &grafptr->edgenbr) != 1) ||
        (intLoad (stream, &baseadj)          != 1) ||
***************
*** 124,129 ****
--- 145,159 ----
      errorPrint ("graphLoad: bad input (2)");
      return     (1);
    }
+ #else /* NOFILEIO */
+   grafptr->vertnbr=nvert;
+   grafptr->edgenbr=nedge2;
+   baseadj=1;
+   propval=0;
+   if (vertlab) propval+=100;
+   if (edgewgt) propval+= 10;
+   if (vertwgt) propval+=  1;
+ #endif /* NOFILEIO */
    sprintf (proptab, "%3.3d", (int) propval);      /* Compute file properties */
    proptab[0] -= '0';                              /* Vertex labels flag      */
    proptab[1] -= '0';                              /* Edge weights flag       */
***************
*** 140,145 ****
--- 170,179 ----
    }
    if (proptab[0] != 0)                            /* If vertex labels, no base adjust */
      baseadj = 0;
+ #ifdef NOFILEIO
+ //  printf("graphLoad - baseadj=%d,baseval=%d,grafptr->baseval=%d\n",
+ //         baseadj,baseval,grafptr->baseval);
+ #endif /* NOFILEIO */
  
    velonbr = ((proptab[2] != 0) && ((flagval & GRAPHIONOLOADVERT) == 0)) ? grafptr->vertnbr : 0;
    vlblnbr = (proptab[0] != 0) ? grafptr->vertnbr : 0;
***************
*** 178,188 ****
--- 212,226 ----
      if (grafptr->vlbltax != NULL) {               /* If must read label               */
        Gnum                vlblval;                /* Value where to read vertex label */
  
+ #ifndef NOFILEIO
        if (intLoad (stream, &vlblval) != 1) {      /* Read label data */
          errorPrint ("graphLoad: bad input (3)");
          graphFree  (grafptr);
          return     (1);
        }
+ #else /* NOFILEIO */
+       vlblval=vertlab[vertnum-grafptr->baseval];
+ #endif /* NOFILEIO */
        grafptr->vlbltax[vertnum] = vlblval;
        if (grafptr->vlbltax[vertnum] > vlblmax)    /* Get maximum vertex label */
          vlblmax = grafptr->vlbltax[vertnum];
***************
*** 190,209 ****
--- 228,257 ----
      if (proptab[2] != 0) {                        /* If must read vertex load        */
        Gnum                veloval;                /* Value where to read vertex load */
  
+ #ifndef NOFILEIO
        if (intLoad (stream, &veloval) != 1) {      /* Read vertex load data    */
          errorPrint ("graphLoad: bad input (4)");
          graphFree  (grafptr);
          return     (1);
        }
+ #else /* NOFILEIO */
+       veloval=vertwgt[vertnum-grafptr->baseval];
+ #endif /* NOFILEIO */
        if (grafptr->velotax != NULL)
          velosum                  +=
          grafptr->velotax[vertnum] = veloval;
      }
+ #ifndef NOFILEIO
      if (intLoad (stream, &degrval) != 1) {        /* Read vertex degree */
        errorPrint ("graphLoad: bad input (5)");
        graphFree  (grafptr);
        return     (1);
      }
+ #else /* NOFILEIO */
+ //    printf("old degrval=%d; new degrval=%d\n",
+ //           degrval,adjjc[vertnum-grafptr->baseval+1]-adjjc[vertnum-grafptr->baseval]);
+     degrval=adjjc[vertnum-grafptr->baseval+1]-adjjc[vertnum-grafptr->baseval];
+ #endif /* NOFILEIO */
      if (degrmax < degrval)                        /* Set maximum degree */
        degrmax = degrval;
  
***************
*** 219,238 ****
--- 267,301 ----
        if (proptab[1] != 0) {                      /* If must read edge load        */
          Gnum                edloval;              /* Value where to read edge load */
  
+ #ifndef NOFILEIO
          if (intLoad (stream, &edloval) != 1) {    /* Read edge load data    */
            errorPrint ("graphLoad: bad input (6)");
            graphFree  (grafptr);
            return     (1);
          }
+ #else /* NOFILEIO */
+         edloval=edgewgt[edgenum-grafptr->baseval];
+ #endif /* NOFILEIO */
          if (grafptr->edlotax != NULL)
            edlosum                  +=
            grafptr->edlotax[edgenum] = (Gnum) edloval;
        }
+ #ifndef NOFILEIO
        if (intLoad (stream, &edgeval) != 1) {      /* Read edge data */
          errorPrint ("graphLoad: bad input (7)");
          graphFree  (grafptr);
          return     (1);
        }
+ #else /* NOFILEIO */
+ //      printf("edgenum=%d: old edgeval=%d; new edgeval[%d]=%d\n",
+ //            edgenum,edgeval,edgenum-grafptr->baseval,adjir[edgenum-grafptr->baseval]+1);
+ /*  if vertex labels are supplied, they must be referenced  (jes, 1/05/10)  */
+ //      edgeval=adjir[edgenum-grafptr->baseval]+1;
+       if (vertlab)
+         edgeval=vertlab[adjir[edgenum-grafptr->baseval]  ];
+       else
+         edgeval=        adjir[edgenum-grafptr->baseval]+1;
+ #endif /* NOFILEIO */
        grafptr->edgetax[edgenum] = edgeval + baseadj;
      }
    }
***************
*** 279,284 ****
--- 342,351 ----
    Gnum                vertnum;                    /* Number of current vertex        */
    Gnum * restrict     indxtab;                    /* Vertex label/number index table */
  
+ #ifdef NOFILEIO
+   printf("graphLoad2 - baseval=%d,vertnnd=%d,vlblmax=%d\n",
+          baseval,vertnnd,vlblmax);
+ #endif /* NOFILEIO */
    if ((indxtab = (Gnum *) memAlloc ((vlblmax + 1) * sizeof (Gnum))) == NULL) {
      errorPrint  ("graphLoad2: out of memory");
      return      (1);
***************
*** 286,291 ****
--- 353,362 ----
  
    memSet (indxtab, ~0, (vlblmax + 1) * sizeof (Gnum)); /* Assume labels not used */
    for (vertnum = baseval; vertnum < vertnnd; vertnum ++) {
+ #ifdef NOFILEIO
+ //    printf("graphLoad2 - vertnum=%d; vlbltax=%d,indxtab=%d\n",
+ //           vertnum,vlbltax[vertnum],indxtab[vlbltax[vertnum]]);
+ #endif /* NOFILEIO */
      if (indxtab[vlbltax[vertnum]] != ~0) {        /* If vertex label already used */
        errorPrint  ("graphLoad2: duplicate vertex label");
        memFree     (indxtab);
***************
*** 294,299 ****
--- 365,374 ----
      indxtab[vlbltax[vertnum]] = vertnum;          /* Set vertex number index */
    }
    for (vertnum = baseval; vertnum < vertnnd; vertnum ++) {
+ #ifdef NOFILEIO
+ //    printf("graphLoad2 - vertnum=%d; vlbltax=%d,indxtab=%d\n",
+ //           vertnum,vlbltax[vertnum],indxtab[vlbltax[vertnum]]);
+ #endif /* NOFILEIO */
      Gnum                edgenum;                  /* Number of current edge */
  
      for (edgenum = verttax[vertnum]; edgenum < vendtax[vertnum]; edgenum ++) {
***************
*** 307,313 ****
--- 382,396 ----
          memFree    (indxtab);
          return     (1);
        }
+ #ifdef NOFILEIO
+ //      printf("graphLoad2 - edgenum=%d; old edgetax=%d,",
+ //             edgenum,edgetax[edgenum]);
+ #endif /* NOFILEIO */
        edgetax[edgenum] = indxtab[edgetax[edgenum]]; /* Replace label by number */
+ #ifdef NOFILEIO
+ //      printf("new edgetax=%d\n",
+ //             edgetax[edgenum]);
+ #endif /* NOFILEIO */
      }
    }
  
diff -crB scotch_5.1/src/libscotch/graph_io_scot.c src/src/libscotch/graph_io_scot.c
*** scotch_5.1/src/libscotch/graph_io_scot.c	2008-05-22 06:44:42.000000000 -0700
--- src/src/libscotch/graph_io_scot.c	2013-05-06 14:14:17.000000000 -0700
***************
*** 89,95 ****
--- 89,99 ----
    int                           o;
  
    if (filesrcptr != NULL) {
+ #ifndef NOFILEIO
      if (graphLoad (grafptr, filesrcptr, -1, 0) != 0)
+ #else /* NOFILEIO */
+     if (graphLoad (grafptr, filesrcptr, -1, 0, 0, 0, NULL, NULL, NULL, NULL, NULL) != 0)
+ #endif /* NOFILEIO */
        return (1);
    }
  
diff -crB scotch_5.1/src/libscotch/library_arch.c src/src/libscotch/library_arch.c
*** scotch_5.1/src/libscotch/library_arch.c	2008-05-22 06:44:42.000000000 -0700
--- src/src/libscotch/library_arch.c	2013-05-06 14:14:17.000000000 -0700
***************
*** 120,128 ****
  int
  SCOTCH_archLoad (
  SCOTCH_Arch * const         archptr,
! FILE * const                stream)
  {
    return (archLoad ((Arch *) archptr, stream));
  }
  
  /*+ This routine saves the given opaque
--- 120,139 ----
  int
  SCOTCH_archLoad (
  SCOTCH_Arch * const         archptr,
! FILE * const                stream
! #ifdef NOFILEIO
!                                   ,
! const char *                archtyp,
! const SCOTCH_Num            napar,
! const SCOTCH_Num *          archpar
! #endif /* NOFILEIO */
!                                    )
  {
+ #ifndef NOFILEIO
    return (archLoad ((Arch *) archptr, stream));
+ #else /* NOFILEIO */
+   return (archLoad ((Arch *) archptr, stream, archtyp, napar, archpar));
+ #endif /* NOFILEIO */
  }
  
  /*+ This routine saves the given opaque
diff -crB scotch_5.1/src/libscotch/library_arch_f.c src/src/libscotch/library_arch_f.c
*** scotch_5.1/src/libscotch/library_arch_f.c	2008-05-22 06:44:42.000000000 -0700
--- src/src/libscotch/library_arch_f.c	2013-05-06 14:14:18.000000000 -0700
***************
*** 121,127 ****
--- 121,131 ----
    }
    setbuf (stream, NULL);                          /* Do not buffer on input */
  
+ #ifndef NOFILEIO
    o = SCOTCH_archLoad (archptr, stream);
+ #else /* NOFILEIO */
+   o = SCOTCH_archLoad (archptr, stream, "", 0, NULL);
+ #endif /* NOFILEIO */
  
    fclose (stream);                                /* This closes filenum too */
  
diff -crB scotch_5.1/src/libscotch/library_error_exit.c src/src/libscotch/library_error_exit.c
*** scotch_5.1/src/libscotch/library_error_exit.c	2009-01-20 00:36:33.000000000 -0800
--- src/src/libscotch/library_error_exit.c	2013-05-06 14:14:18.000000000 -0700
***************
*** 114,119 ****
--- 114,120 ----
    int                 proclocnum;
  #endif /* SCOTCH_PTSCOTCH */
  
+ #ifndef MATLAB
    fprintf  (stderr, "%s", _SCOTCHerrorProgName);
  #ifdef SCOTCH_PTSCOTCH
    if ((MPI_Initialized (&proclocnum) == MPI_SUCCESS) &&
***************
*** 131,136 ****
--- 132,155 ----
    fprintf  (stderr, "\n");
    fflush   (stderr);                              /* In case it has been set to buffered mode */
  
+ #else /* MATLAB */
+   mexPrintf  ("%s", _SCOTCHerrorProgName);
+ #ifdef SCOTCH_PTSCOTCH
+   if ((MPI_Initialized (&proclocnum) == MPI_SUCCESS) &&
+       (proclocnum != 0)                              &&
+       (MPI_Comm_rank (MPI_COMM_WORLD, &proclocnum) == MPI_SUCCESS))
+     mexPrintf ("(%d): ", proclocnum);
+ #else /* SCOTCH_PTSCOTCH */
+   if (_SCOTCHerrorProgName[0] != '\0')
+     mexPrintf  (": ");
+ #endif /* SCOTCH_PTSCOTCH */
+   mexPrintf  ("ERROR: ");
+   va_start (errlist, errstr);
+   mexPrintf (errstr, errlist);             /* Print arguments */
+   va_end   (errlist);
+   mexPrintf  ("\n");
+ #endif /* MATLAB */
+ 
  #ifdef SCOTCH_ERROR_SLEEP
    sleep (SCOTCH_ERROR_SLEEP);                     /* Wait for messages to be propagated */
  #endif /* SCOTCH_ERROR_SLEEP */
***************
*** 155,160 ****
--- 174,180 ----
    int                 proclocnum;
  #endif /* SCOTCH_PTSCOTCH */
  
+ #ifndef MATLAB
    fprintf  (stderr, "%s", _SCOTCHerrorProgName);
  #ifdef SCOTCH_PTSCOTCH
    if ((MPI_Initialized (&proclocnum) == MPI_SUCCESS) &&
***************
*** 171,174 ****
--- 191,212 ----
    va_end   (errlist);
    fprintf  (stderr, "\n");
    fflush   (stderr);                              /* In case it has been set to buffered mode */
+ 
+ #else /* MATLAB */
+   mexPrintf  ("%s", _SCOTCHerrorProgName);
+ #ifdef SCOTCH_PTSCOTCH
+   if ((MPI_Initialized (&proclocnum) == MPI_SUCCESS) &&
+       (proclocnum != 0)                              &&
+       (MPI_Comm_rank (MPI_COMM_WORLD, &proclocnum) == MPI_SUCCESS))
+     mexPrintf ("(%d): ", proclocnum);
+ #else /* SCOTCH_PTSCOTCH */
+   if (_SCOTCHerrorProgName[0] != '\0')
+     mexPrintf  (": ");
+ #endif /* SCOTCH_PTSCOTCH */
+   mexPrintf  ("WARNING: ");
+   va_start (errlist, errstr);
+   mexPrintf (errstr, errlist);             /* Print arguments */
+   va_end   (errlist);
+   mexPrintf  ("\n");
+ #endif /* MATLAB */
  }
diff -crB scotch_5.1/src/libscotch/library_graph.c src/src/libscotch/library_graph.c
*** scotch_5.1/src/libscotch/library_graph.c	2008-05-22 07:28:12.000000000 -0700
--- src/src/libscotch/library_graph.c	2013-05-06 14:14:18.000000000 -0700
***************
*** 137,143 ****
  SCOTCH_Graph * const        grafptr,
  FILE * const                stream,
  const SCOTCH_Num            baseval,
! const SCOTCH_Num            flagval)
  {
    GraphFlag           srcgrafflag;                /* Graph flags */
  
--- 137,154 ----
  SCOTCH_Graph * const        grafptr,
  FILE * const                stream,
  const SCOTCH_Num            baseval,
! const SCOTCH_Num            flagval
! #ifdef NOFILEIO
!                                    ,
! const SCOTCH_Num            nvert,
! const SCOTCH_Num            nedge2,
! const SCOTCH_Num*           adjir,
! const SCOTCH_Num*           adjjc,
! const SCOTCH_Num*           vertlab,
! const SCOTCH_Num*           vertwgt,
! const SCOTCH_Num*           edgewgt
! #endif /* NOFILEIO */
!                                    )
  {
    GraphFlag           srcgrafflag;                /* Graph flags */
  
***************
*** 153,159 ****
--- 164,174 ----
    srcgrafflag = (((flagval & 1) != 0) ? GRAPHIONOLOADVERT : 0) +
                  (((flagval & 2) != 0) ? GRAPHIONOLOADEDGE : 0);
  
+ #ifndef NOFILEIO
    return (graphLoad ((Graph * const) grafptr, stream, (Gnum) baseval, srcgrafflag));
+ #else /* NOFILEIO */
+   return (graphLoad ((Graph * const) grafptr, stream, (Gnum) baseval, srcgrafflag, (const Gnum) nvert, (const Gnum) nedge2, (const Gnum *) adjir, (const Gnum *) adjjc, (const Gnum *) vertlab, (const Gnum *) vertwgt, (const Gnum *) edgewgt));
+ #endif /* NOFILEIO */
  }
  
  /*+ This routine saves the contents of the given
diff -crB scotch_5.1/src/libscotch/library_graph_f.c src/src/libscotch/library_graph_f.c
*** scotch_5.1/src/libscotch/library_graph_f.c	2008-05-22 06:44:43.000000000 -0700
--- src/src/libscotch/library_graph_f.c	2013-05-06 14:14:18.000000000 -0700
***************
*** 136,142 ****
--- 136,146 ----
    }
    setbuf (stream, NULL);                          /* Do not buffer on input */
  
+ #ifndef NOFILEIO
    o = SCOTCH_graphLoad (grafptr, stream, *baseptr, *flagptr);
+ #else /* NOFILEIO */
+   o = SCOTCH_graphLoad (grafptr, stream, *baseptr, *flagptr, 0, 0, NULL, NULL, NULL, NULL, NULL);
+ #endif /* NOFILEIO */
  
    fclose (stream);                                /* This closes filenum too */
  
diff -crB scotch_5.1/src/libscotch/library_graph_map.c src/src/libscotch/library_graph_map.c
*** scotch_5.1/src/libscotch/library_graph_map.c	2008-09-28 04:04:05.000000000 -0700
--- src/src/libscotch/library_graph_map.c	2013-05-06 14:14:19.000000000 -0700
***************
*** 182,192 ****
--- 182,200 ----
  
  int
  SCOTCH_graphMapSave (
+ #ifdef NOFILEIO
+ Gnum *pnvert,
+ Gnum (**pmaptab)[2],
+ #endif /* NOFILEIO */
  const SCOTCH_Graph * const    grafptr,            /*+ Graph to order  +*/
  const SCOTCH_Mapping * const  mappptr,            /*+ Mapping to save +*/
  FILE * const                  stream)             /*+ Output stream   +*/
  {
+ #ifndef NOFILEIO
    return (mapSave (&((LibMapping *) mappptr)->m, ((Graph *) grafptr)->vlbltax, stream));
+ #else /* NOFILEIO */
+   return (mapSave (pnvert, pmaptab, &((LibMapping *) mappptr)->m, ((Graph *) grafptr)->vlbltax, stream));
+ #endif /* NOFILEIO */
  }
  
  /*+ This routine computes a mapping
diff -crB scotch_5.1/src/libscotch/library_graph_map_f.c src/src/libscotch/library_graph_map_f.c
*** scotch_5.1/src/libscotch/library_graph_map_f.c	2008-06-28 03:44:26.000000000 -0700
--- src/src/libscotch/library_graph_map_f.c	2013-05-06 14:14:19.000000000 -0700
***************
*** 183,189 ****
--- 183,193 ----
      return;
    }
  
+ #ifndef NOFILEIO
    o = SCOTCH_graphMapSave (grafptr, mapptr, stream);
+ #else /* NOFILEIO */
+   o = SCOTCH_graphMapSave (NULL, NULL, grafptr, mapptr, stream);
+ #endif /* NOFILEIO */
  
    fclose (stream);                                /* This closes filenum too */
  
diff -crB scotch_5.1/src/libscotch/library.h src/src/libscotch/library.h
*** scotch_5.1/src/libscotch/library.h	2009-05-09 16:08:03.000000000 -0700
--- src/src/libscotch/library.h	2013-05-06 14:14:19.000000000 -0700
***************
*** 1,3 ****
--- 1,5 ----
+ #ifndef _SCOTCH_H_
+ #define _SCOTCH_H_
  /* Copyright 2004,2007-2009 ENSEIRB, INRIA & CNRS
  **
  ** This file is part of the Scotch software package for static mapping,
***************
*** 134,140 ****
--- 136,146 ----
  
  int                         SCOTCH_archInit     (SCOTCH_Arch * const);
  void                        SCOTCH_archExit     (SCOTCH_Arch * const);
+ #ifndef NOFILEIO
  int                         SCOTCH_archLoad     (SCOTCH_Arch * const, FILE * const);
+ #else /* NOFILEIO */
+ int                         SCOTCH_archLoad     (SCOTCH_Arch * const, FILE * const, const char *, const SCOTCH_Num, const SCOTCH_Num *);
+ #endif /* NOFILEIO */
  int                         SCOTCH_archSave     (const SCOTCH_Arch * const, FILE * const);
  int                         SCOTCH_archBuild    (SCOTCH_Arch * const, const SCOTCH_Graph * const, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Strat * const);
  int                         SCOTCH_archCmplt    (SCOTCH_Arch * const, const SCOTCH_Num);
***************
*** 191,197 ****
--- 197,207 ----
  int                         SCOTCH_graphInit    (SCOTCH_Graph * const);
  void                        SCOTCH_graphExit    (SCOTCH_Graph * const);
  void                        SCOTCH_graphFree    (SCOTCH_Graph * const);
+ #ifndef NOFILEIO
  int                         SCOTCH_graphLoad    (SCOTCH_Graph * const, FILE * const, const SCOTCH_Num, const SCOTCH_Num);
+ #else /* NOFILEIO */
+ int                         SCOTCH_graphLoad    (SCOTCH_Graph * const, FILE * const, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num *, const SCOTCH_Num *, const SCOTCH_Num *, const SCOTCH_Num *, const SCOTCH_Num *);
+ #endif /* NOFILEIO */
  int                         SCOTCH_graphSave    (const SCOTCH_Graph * const, FILE * const);
  int                         SCOTCH_graphBuild   (SCOTCH_Graph * const, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Num * const);
  SCOTCH_Num                  SCOTCH_graphBase    (SCOTCH_Graph * const, const SCOTCH_Num baseval);
***************
*** 210,216 ****
--- 220,230 ----
  int                         SCOTCH_graphMapInit (const SCOTCH_Graph * const, SCOTCH_Mapping * const, const SCOTCH_Arch * const, SCOTCH_Num * const);
  void                        SCOTCH_graphMapExit (const SCOTCH_Graph * const, SCOTCH_Mapping * const);
  int                         SCOTCH_graphMapLoad (const SCOTCH_Graph * const, const SCOTCH_Mapping * const, FILE * const);
+ #ifndef NOFILEIO
  int                         SCOTCH_graphMapSave (const SCOTCH_Graph * const, const SCOTCH_Mapping * const, FILE * const);
+ #else /* NOFILEIO */
+ int                         SCOTCH_graphMapSave (SCOTCH_Num *, SCOTCH_Num (**)[2], const SCOTCH_Graph * const, const SCOTCH_Mapping * const, FILE * const);
+ #endif /* NOFILEIO */
  int                         SCOTCH_graphMapView (const SCOTCH_Graph * const, const SCOTCH_Mapping * const, FILE * const);
  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);
***************
*** 278,280 ****
--- 292,296 ----
  #ifdef __cplusplus
  }
  #endif /* __cplusplus */
+ 
+ #endif //#ifndef _SCOTCH_H_
diff -crB scotch_5.1/src/libscotch/Makefile src/src/libscotch/Makefile
*** scotch_5.1/src/libscotch/Makefile	2009-05-09 16:08:04.000000000 -0700
--- src/src/libscotch/Makefile	2013-05-06 14:14:19.000000000 -0700
***************
*** 49,55 ****
  ##  Project rules.
  ##
  
! .PHONY				:	ptscotch	scotch	ptinstall	install	clean	realclean
  
  scotch				:	clean
  					$(MAKE) CC="$(CCS)" CCD="$(CCS)" SCOTCHLIB=scotch	\
--- 49,55 ----
  ##  Project rules.
  ##
  
! .PHONY				:	ptscotch	scotch	nfioscotch	mexscotch	ptinstall	install	nfioinstall	mexinstall	clean	realclean
  
  scotch				:	clean
  					$(MAKE) CC="$(CCS)" CCD="$(CCS)" SCOTCHLIB=scotch	\
***************
*** 68,73 ****
--- 68,93 ----
  					libptscotcherr$(LIB)								\
  					libptscotcherrexit$(LIB)
  
+ nfioscotch				:	clean
+ 					$(MAKE) CFLAGS="$(CFLAGS)" CC="$(CCS)" CCD="$(CCS)" LDFLAGS="$(LDFLAGS)" SCOTCHLIB=scotch	\
+ 					dummysizes$(EXE)
+ 					$(MAKE) CFLAGS="$(CFLAGS) -DNOFILEIO" CC="$(CCS)" CCD="$(CCS)" SCOTCHLIB=nfioscotch	\
+ 					scotch.h						\
+ 					scotchf.h						\
+ 					libnfioscotch$(LIB)						\
+ 					libnfioscotcherr$(LIB)					\
+ 					libnfioscotcherrexit$(LIB)
+ 
+ mexscotch			:	clean
+ 					$(MAKE) CFLAGS="$(CFLAGS)" CC="$(CCS)" CCD="$(CCS)" LDFLAGS="$(LDFLAGS)" SCOTCHLIB=scotch	\
+ 					dummysizes$(EXE)
+ 					$(MAKE) CFLAGS="$(CFLAGS) -DNOFILEIO -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=mexscotch	\
+ 					scotch.h						\
+ 					scotchf.h						\
+ 					libmexscotch$(LIB)						\
+ 					libmexscotcherr$(LIB)					\
+ 					libmexscotcherrexit$(LIB)
+ 
  install				:
  					-$(CP) scotch.h scotchf.h $(includedir)
  					-$(CP) libscotch$(LIB) libscotcherr*$(LIB) $(libdir)
***************
*** 77,82 ****
--- 97,110 ----
  					-$(CP) scotchf.h $(includedir)/ptscotchf.h
  					-$(CP) libptscotch*$(LIB) $(libdir)
  
+ nfioinstall				:
+ 					-$(CP) scotch.h scotchf.h $(includedir)
+ 					-$(CP) libnfioscotch$(LIB) libnfioscotcherr*$(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 ****
--- 2480,2807 ----
  					$(AR) $(ARFLAGS) lib$(SCOTCHLIB)$(LIB) $(?)
  					-$(RANLIB) lib$(SCOTCHLIB)$(LIB)
  
+ libnfioscotch$(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) 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) lib$(SCOTCHLIB)$(LIB) $(?)
+ 					-$(RANLIB) lib$(SCOTCHLIB)$(LIB)
+ 
  libptscotcherr$(LIB)		:	library_error$(OBJ)
  					$(AR) $(ARFLAGS) $(@) $(?)
  					-$(RANLIB) $(@)
***************
*** 2467,2469 ****
--- 2817,2835 ----
  libscotcherrexit$(LIB)		:	library_error_exit$(OBJ)
  					$(AR) $(ARFLAGS) $(@) $(?)
  					-$(RANLIB) $(@)
+ 
+ libnfioscotcherr$(LIB)		:	library_error$(OBJ)
+ 					$(AR) $(ARFLAGS) $(@) $(?)
+ 					-$(RANLIB) $(@)
+ 
+ libnfioscotcherrexit$(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) $(@)
diff -crB scotch_5.1/src/libscotch/mapping.h src/src/libscotch/mapping.h
*** scotch_5.1/src/libscotch/mapping.h	2008-10-27 08:27:47.000000000 -0700
--- src/src/libscotch/mapping.h	2013-05-06 14:14:20.000000000 -0700
***************
*** 106,112 ****
--- 106,116 ----
  int                         mapInit2            (Mapping * restrict const, const Gnum, const Gnum, const Arch * restrict const, const ArchDom * restrict const);
  void                        mapExit             (Mapping * const);
  int                         mapLoad             (Mapping * restrict const, const Gnum * restrict const, FILE * restrict const);
+ #ifndef NOFILEIO
  int                         mapSave             (const Mapping * restrict const, const Gnum * restrict const, FILE * restrict const);
+ #else /* NOFILEIO */
+ int                         mapSave             (Gnum *, Gnum (**)[2], const Mapping * restrict const, const Gnum * restrict const, FILE * restrict const);
+ #endif /* NOFILEIO */
  int                         mapView             (const Mapping * restrict const, const Graph * restrict const, FILE * const);
  
  #undef static
diff -crB scotch_5.1/src/libscotch/mapping_io.c src/src/libscotch/mapping_io.c
*** scotch_5.1/src/libscotch/mapping_io.c	2008-05-22 06:44:43.000000000 -0700
--- src/src/libscotch/mapping_io.c	2013-05-06 14:14:20.000000000 -0700
***************
*** 199,204 ****
--- 199,208 ----
  
  int
  mapSave (
+ #ifdef NOFILEIO
+ Gnum *pnvert,
+ Gnum (**pmaptab)[2],
+ #endif /* NOFILEIO */
  const Mapping * restrict const  mappptr,
  const Gnum * restrict const     vlbltab,
  FILE * restrict const           stream)
***************
*** 206,226 ****
    const Gnum * restrict vlbltax;
    Gnum                  vertnum;
  
    vlbltax = (vlbltab != NULL) ? (vlbltab - mappptr->baseval) : NULL;
  
    if (fprintf (stream, "%ld\n", (long) mappptr->vertnbr) == EOF) {
      errorPrint ("mapSave: bad output (1)");
      return     (1);
    }
  
    for (vertnum = mappptr->baseval; vertnum < (mappptr->vertnbr + mappptr->baseval); vertnum ++) {
      if (fprintf (stream, "%ld\t%ld\n",
!                  (long) ((vlbltax != NULL) ? vlbltax[vertnum] : vertnum),
                   (long) archDomNum (&mappptr->archdat, &mappptr->domntab[mappptr->parttax[vertnum]])) == EOF) {
        errorPrint ("mapSave: bad output (2)");
        return     (1);
      }
    }
  
    return (0);
  }
--- 210,258 ----
    const Gnum * restrict vlbltax;
    Gnum                  vertnum;
  
+ #ifdef NOFILEIO
+ //  printf("mapSave - stream=%p\n",stream);
+ #endif /* NOFILEIO */
    vlbltax = (vlbltab != NULL) ? (vlbltab - mappptr->baseval) : NULL;
  
+ #ifndef NOFILEIO
    if (fprintf (stream, "%ld\n", (long) mappptr->vertnbr) == EOF) {
      errorPrint ("mapSave: bad output (1)");
      return     (1);
    }
+ #else /* NOFILEIO */
+   if (pnvert) {
+     *pnvert=mappptr->vertnbr;
+ //    printf("mapSave - nvert=%d\n",*pnvert);
+   }
+   if (pmaptab) {
+     *pmaptab = (Gnum (*)[2]) malloc(mappptr->vertnbr*2*sizeof(Gnum));
+ //    printf("mapSave - maptab=%p\n",*pmaptab);
+   }
+ #endif /* NOFILEIO */
  
+ #ifndef NOFILEIO
    for (vertnum = mappptr->baseval; vertnum < (mappptr->vertnbr + mappptr->baseval); vertnum ++) {
      if (fprintf (stream, "%ld\t%ld\n",
! /*  not sure why, but need to offset vlbltax in other direction (jes, 12/11/09)  */
! //                 (long) ((vlbltax != NULL) ? vlbltax[vertnum] : vertnum),
!                  (long) ((vlbltax != NULL) ? vlbltax[vertnum+mappptr->baseval] : vertnum),
                   (long) archDomNum (&mappptr->archdat, &mappptr->domntab[mappptr->parttax[vertnum]])) == EOF) {
        errorPrint ("mapSave: bad output (2)");
        return     (1);
      }
    }
+ #else /* NOFILEIO */
+   if (pmaptab && *pmaptab)
+     for (vertnum = mappptr->baseval; vertnum < (mappptr->vertnbr + mappptr->baseval); vertnum ++) {
+ /*  not sure why, but need to offset vlbltax in other direction (jes, 12/11/09)  */
+ //      (*pmaptab)[vertnum-mappptr->baseval][0]=((vlbltax != NULL) ? vlbltax[vertnum] : vertnum);
+       (*pmaptab)[vertnum-mappptr->baseval][0]=((vlbltax != NULL) ? vlbltax[vertnum+mappptr->baseval] : vertnum);
+       (*pmaptab)[vertnum-mappptr->baseval][1]=archDomNum (&mappptr->archdat, &mappptr->domntab[mappptr->parttax[vertnum]]);
+ //    printf("mapSave - vertnum=%d; vlbltax=%d,archDomNum=%d\n",
+ //           vertnum,((vlbltax != NULL) ? vlbltax[vertnum+mappptr->baseval] : -1),archDomNum (&mappptr->archdat, &mappptr->domntab[mappptr->parttax[vertnum]]));
+     }
+ #endif /* NOFILEIO */
  
    return (0);
  }
diff -crB scotch_5.1/src/libscotch/mesh_io_scot.c src/src/libscotch/mesh_io_scot.c
*** scotch_5.1/src/libscotch/mesh_io_scot.c	2008-05-22 06:44:43.000000000 -0700
--- src/src/libscotch/mesh_io_scot.c	2013-05-06 14:14:20.000000000 -0700
***************
*** 85,91 ****
--- 85,95 ----
    int                           o;
  
    if (filesrcptr != NULL) {
+ #ifndef NOFILEIO
      if (graphLoad (meshptr, filesrcptr, -1, 0) != 0)
+ #else /* NOFILEIO */
+     if (graphLoad (meshptr, filesrcptr, -1, 0, 0, 0, NULL, NULL, NULL, NULL, NULL) != 0)
+ #endif /* NOFILEIO */
        return (1);
    }
  
diff -crB scotch_5.1/src/libscotch/module.h src/src/libscotch/module.h
*** scotch_5.1/src/libscotch/module.h	2009-04-26 23:07:14.000000000 -0700
--- src/src/libscotch/module.h	2013-05-06 14:14:20.000000000 -0700
***************
*** 1,3 ****
--- 1,5 ----
+ #ifndef _SCOTCH_MODULE_H_
+ #define _SCOTCH_MODULE_H_
  /* Copyright 2004,2007-2009 ENSEIRB, INRIA & CNRS
  **
  ** This file is part of the Scotch software package for static mapping,
***************
*** 55,60 ****
--- 57,65 ----
  
  #define MODULE_H
  
+ /*Don't forget stdint.h:*/
+ #include "stdint.h"
+ 
  /*
  ** Collective communication handling.
  */
***************
*** 156,161 ****
--- 161,167 ----
  #define intSave                     _SCOTCHintSave
  #define intAscn                     _SCOTCHintAscn
  #define intPerm                     _SCOTCHintPerm
+ #define intRandResetStatic          _SCOTCHintRandResetStatic
  #define intRandReset                _SCOTCHintRandReset
  #define intRandInit                 _SCOTCHintRandInit
  /* #define intRandVal               _SCOTCHintRandVal Already a macro */
***************
*** 681,683 ****
--- 687,691 ----
  #define vmeshStoreSave              _SCOTCHvmeshStoreSave
  #define vmeshStoreUpdt              _SCOTCHvmeshStoreUpdt
  #endif /* SCOTCH_RENAME */
+ 
+ #endif //#ifndef _SCOTCH_MODULE_H_
diff -crB scotch_5.1/src/libscotch/parser_ll.l src/src/libscotch/parser_ll.l
*** scotch_5.1/src/libscotch/parser_ll.l	2008-05-22 06:44:43.000000000 -0700
--- src/src/libscotch/parser_ll.l	2013-05-06 14:14:21.000000000 -0700
***************
*** 192,197 ****
--- 192,213 ----
  stratParserInit (
  const char * const          string)               /*+ Strategy string to parse +*/
  {
+ /*  reset static variables from previous runs (jes, 4/29/10)  */
+   yy_hold_char = (char) 0;
+   yy_n_chars=0;          /* number of characters read into yy_ch_buf */
+   yy_c_buf_p = (char *) 0;
+   yy_init = 1;         /* whether we need to initialize */
+   yy_start = 0;        /* start state number */
+   yy_did_buffer_switch_on_eof=0;
+   yy_last_accepting_state=0;
+   yy_last_accepting_cpos = (char *) 0;
+   stratparserstringptr = (char *) 0; /* Pointer to the string to parse */
+ #if YY_STACK_USED
+   yy_start_stack_ptr = 0;
+   yy_start_stack_depth = 0;
+   yy_start_stack = 0;
+ #endif
+ 
  #ifdef FLEX_SCANNER
    yyrestart (yyin);                               /* (Re-)initialize the parser */
  #endif /* FLEX_SCANNER */
diff -crB scotch_5.1/src/libscotch/parser_yy.y src/src/libscotch/parser_yy.y
*** scotch_5.1/src/libscotch/parser_yy.y	2008-10-22 15:12:48.000000000 -0700
--- src/src/libscotch/parser_yy.y	2013-05-06 14:14:21.000000000 -0700
***************
*** 774,779 ****
--- 774,780 ----
    stratParserInit (string);                       /* Initialize the lexical parser           */
    parserstrattab  = strattab;                     /* Point to the parsing tables             */
    parserstratcurr = NULL;                         /* Clear up the temporary strategy pointer */
+   parserparamcurr = NULL;                         /* reset the last static (jes, 4/29/10)    */
  
    if (stratParserParse2 () != 0) {                /* Parse the strategy string */
      if (parserstratcurr != NULL)
diff -crB scotch_5.1/src/libscotch/vgraph_separate_vw.c src/src/libscotch/vgraph_separate_vw.c
*** scotch_5.1/src/libscotch/vgraph_separate_vw.c	2008-05-22 06:44:43.000000000 -0700
--- src/src/libscotch/vgraph_separate_vw.c	2013-05-06 14:14:21.000000000 -0700
***************
*** 83,88 ****
--- 83,89 ----
    FILE * restrict     fileptr;
    Gnum                vertnum;                    /* Vertex number */
  
+   printf("vgraphSeparateVw begin -- vgraphseparatevwfilenum=%d\n",vgraphseparatevwfilenum);
    sprintf (nametab, "vgraphseparatevw_output_%08d.map", vgraphseparatevwfilenum ++);
    if ((fileptr = fopen (nametab, "w+")) == NULL) {
      errorPrint ("vgraphSeparateVw: cannot open partition file");
***************
*** 102,106 ****
--- 103,108 ----
      }
    }
  
+   printf("vgraphSeparateVw end   -- vgraphseparatevwfilenum=%d\n",vgraphseparatevwfilenum);
    return (0);
  }
diff -crB scotch_5.1/src/Makefile src/src/Makefile
*** scotch_5.1/src/Makefile	2008-09-15 05:50:51.000000000 -0700
--- src/src/Makefile	2013-05-06 14:14:21.000000000 -0700
***************
*** 97,102 ****
--- 97,109 ----
  					(cd scotch ;         $(MAKE) VERSION=\"$(VERSION)\" ptscotch && $(MAKE) ptinstall)
  					(cd libscotchmetis ; $(MAKE)                        ptscotch && $(MAKE) ptinstall)
  
+ nfioscotch			:	required
+ 					(cd libscotch ;      $(MAKE) VERSION=\"$(VERSION)\" nfioscotch && $(MAKE) nfioinstall)
+ 
+ mexscotch			:	required
+ 					(cd libscotch ;      $(MAKE) VERSION=\"$(VERSION)\" mexscotch && $(MAKE) mexinstall)
+ 					(cd scotch ;         $(MAKE) VERSION=\"$(VERSION)\" mexscotch && $(MAKE) mexinstall)
+ 
  install				:	required	$(bindir)	$(includedir)	$(libdir)	$(mandir)/man1
  					-$(CP) -f ../bin/[agm]*$(EXE) $(bindir)
  					-$(CP) -f ../include/*scotch*.h $(includedir)
Only in src/src: Makefile.inc
diff -crB scotch_5.1/src/scotch/gmap.h src/src/scotch/gmap.h
*** scotch_5.1/src/scotch/gmap.h	2008-06-18 11:05:17.000000000 -0700
--- src/src/scotch/gmap.h	2013-05-06 14:14:22.000000000 -0700
***************
*** 1,3 ****
--- 1,5 ----
+ #ifndef _SCOTCH_GMAP_H_
+ #define _SCOTCH_GMAP_H_
  /* Copyright 2004,2007,2008 ENSEIRB, INRIA & CNRS
  **
  ** This file is part of the Scotch software package for static mapping,
***************
*** 87,89 ****
--- 89,93 ----
  #define C_FLAGVERBSTR               0x0002        /* Verbose flags */
  #define C_FLAGVERBTIM               0x0004
  #define C_FLAGVERBMAP               0x0008
+ 
+ #endif //#ifndef _SCOTCH_GMAP_H_
Only in src/src/scotch: gmap_mex.c
Only in src/src/scotch: gmapx.c
diff -crB scotch_5.1/src/scotch/Makefile src/src/scotch/Makefile
*** scotch_5.1/src/scotch/Makefile	2009-04-27 02:19:43.000000000 -0700
--- src/src/scotch/Makefile	2013-05-06 14:14:22.000000000 -0700
***************
*** 49,59 ****
  %$(EXE)	:	%.c
  		 		$(CC) $(CFLAGS) -I$(includedir) -I../libscotch -DSCOTCH_VERSION=\"$(VERSION)\" $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -l$(SCOTCHLIB)errexit $(LDFLAGS)
  
  ##
  ##  Project rules.
  ##
  
! .PHONY				:	ptscotch	scotch	ptinstall	install	clean	realclean
  
  scotch				:	clean
  					$(MAKE) CC="$(CCS)" SCOTCHLIB=scotch	\
--- 49,62 ----
  %$(EXE)	:	%.c
  		 		$(CC) $(CFLAGS) -I$(includedir) -I../libscotch -DSCOTCH_VERSION=\"$(VERSION)\" $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -l$(SCOTCHLIB)errexit $(LDFLAGS)
  
+ %$(MEX)	:	%.c
+ 		 		$(CCM) $(MFLAGS) -I$(includedir) -I../libscotch -DSCOTCH_VERSION=\"$(VERSION)\" $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -l$(SCOTCHLIB)errexit $(LDFLAGS)
+ 
  ##
  ##  Project rules.
  ##
  
! .PHONY				:	ptscotch	scotch	mexscotch	ptinstall	install	mexinstall	clean	realclean
  
  scotch				:	clean
  					$(MAKE) CC="$(CCS)" SCOTCHLIB=scotch	\
***************
*** 94,99 ****
--- 97,108 ----
  					dgscat$(EXE)				\
  					dgtst$(EXE)
  
+ mexscotch			:	clean
+ 					$(MAKE) CFLAGS="$(CFLAGS) -DNOFILEIO -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=mexscotch \
+                     gmapx$(OBJ)
+ 					$(MAKE) CFLAGS="$(CFLAGS) -DNOFILEIO -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=mexscotch	\
+ 					gmap_mex$(MEX)
+ 
  install				:
  					-$(CP) acpl$(EXE) amk_ccc$(EXE) amk_fft2$(EXE) amk_grf$(EXE) amk_hy$(EXE) amk_m2$(EXE) amk_p2$(EXE) atst$(EXE) gbase$(EXE) gcv$(EXE) gmap$(EXE) gmk_hy$(EXE) gmk_m2$(EXE) gmk_m3$(EXE) gmk_msh$(EXE) gmk_ub2$(EXE) gmtst$(EXE) gord$(EXE) gotst$(EXE) gout$(EXE) *gtst$(EXE) gscat$(EXE) mcv$(EXE) mmk_m2$(EXE) mmk_m3$(EXE) mord$(EXE) mtst$(EXE) $(bindir)
  					-$(RM) $(bindir)/gpart$(EXE)
***************
*** 104,111 ****
--- 113,126 ----
  					-$(RM) $(bindir)/dgpart$(EXE)
  					-$(LN) $(bindir)/dgmap$(EXE) $(bindir)/dgpart$(EXE)
  
+ mexinstall			:
+ 					-$(CP) gmap_mex$(MEX) $(bindir)
+ 					-$(RM) $(bindir)/gpart_mex$(MEX)
+ 					-$(LN) $(bindir)/gmap_mex$(MEX) $(bindir)/gpart_mex$(MEX)
+ 
  clean				:
  					-$(RM) *~ *$(OBJ) acpl$(EXE) amk_ccc$(EXE) amk_fft2$(EXE) amk_grf$(EXE) amk_hy$(EXE) amk_m2$(EXE) amk_p2$(EXE) atst$(EXE) gbase$(EXE) gcv$(EXE) *gmap$(EXE) gmk_hy$(EXE) gmk_m2$(EXE) gmk_m3$(EXE) gmk_msh$(EXE) gmk_ub2$(EXE) gmtst$(EXE) *gord$(EXE) gotst$(EXE) gout$(EXE) *gpart$(EXE) *gscat$(EXE) *gtst$(EXE) mcv$(EXE) mmk_m2$(EXE) mmk_m3$(EXE) mord$(EXE) mtst$(EXE)
+ 					-$(RM) gmap_mex$(MEX)
  
  realclean			:	clean
  
***************
*** 365,367 ****
--- 380,403 ----
  					$(libdir)/libscotch$(LIB)		\
  					$(libdir)/libscotcherrexit$(LIB)	\
  					mtst.h
+ 
+ gmapx$(OBJ)			:	gmapx.c					\
+ 					../libscotch/module.h			\
+ 					../libscotch/common.h			\
+ 					$(includedir)/scotch.h			\
+ 					$(libdir)/libmexscotch$(LIB)		\
+ 					$(libdir)/libmexscotcherrexit$(LIB)	\
+ 					gmap.h
+ 
+ gmap_mex$(MEX)		:	gmap_mex.c					\
+ 					../libscotch/module.h			\
+ 					../libscotch/common.h			\
+ 					$(includedir)/scotch.h			\
+ 					$(libdir)/libmexscotch$(LIB)		\
+ 					$(libdir)/libmexscotcherrexit$(LIB)	\
+ 					gmap.h
+ 
+ gpart_mex$(MEX)			:	gmap_mex$(MEX)
+ 					-$(RM) gpart_mex$(MEX)
+ 					-$(LN) gmap_mex$(MEX) gpart_mex$(MEX)
+ 
