Index: /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp	(revision 15836)
+++ /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp	(revision 15837)
@@ -13,27 +13,19 @@
 #include <cstring> // for memcpy
 
-#include "issmmpi.h"
-
-// for now - needs to be replaced by issm's type header file >>>>---- from here
-#ifdef _HAVE_ADOLC_
-# include "adolc/adolc.h"
-typedef adouble IssmDouble;
-#else 
-typedef double IssmDouble;
-#endif
-// ------<<<< until here
+#include "./issmmpi.h"
+#include "../../shared/Numerics/types.h"
 
 #ifndef _HAVE_MPI_
-ISSMMPI_Status ourIssmMPIStatusIgnore=0;
-size_t sizeHelper(ISSMMPI_Datatype type) { /*{{{*/
+ISSM_MPI_Status ourIssmMPIStatusIgnore=0;
+size_t sizeHelper(ISSM_MPI_Datatype type) { /*{{{*/
 
   switch(type) { 
-  case ISSMMPI_CHAR: 
+  case ISSM_MPI_CHAR: 
     return sizeof(char);
     break;
-  case ISSMMPI_DOUBLE: 
+  case ISSM_MPI_DOUBLE: 
     return sizeof(double);
     break;
-  case ISSMMPI_INT: 
+  case ISSM_MPI_INT: 
     return sizeof(int);
     break;
@@ -46,5 +38,5 @@
 #endif
 
-int ISSMMPI_Allgather(void *sendbuf, int sendcount, ISSMMPI_Datatype sendtype, void *recvbuf, int recvcount, ISSMMPI_Datatype recvtype, ISSMMPI_Comm comm) {  /*{{{*/
+int ISSM_MPI_Allgather(void *sendbuf, int sendcount, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcount, ISSM_MPI_Datatype recvtype, ISSM_MPI_Comm comm) {  /*{{{*/
   int rc=0;
   assert(sendcount==recvcount || sendtype==recvtype); // we handle only identical representations
@@ -69,5 +61,5 @@
 #else
 # ifdef _HAVE_ADOLC_
-  if (sendtype==ISSMMPI_DOUBLE) { 
+  if (sendtype==ISSM_MPI_DOUBLE) { 
     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
@@ -80,5 +72,5 @@
   return rc;
 } /*}}}*/
-int ISSMMPI_Allgatherv(void *sendbuf, int sendcount, ISSMMPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, ISSMMPI_Datatype recvtype, ISSMMPI_Comm comm) {  /*{{{*/
+int ISSM_MPI_Allgatherv(void *sendbuf, int sendcount, ISSM_MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, ISSM_MPI_Datatype recvtype, ISSM_MPI_Comm comm) {  /*{{{*/
   int rc=0;
   assert(sendtype==recvtype); // we handle only identical representations
@@ -106,5 +98,5 @@
   assert(sendcount==recvcounts[0]); // we handle only identical representations 
 # ifdef _HAVE_ADOLC_
-  if (sendtype==ISSMMPI_DOUBLE) { 
+  if (sendtype==ISSM_MPI_DOUBLE) { 
     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
     IssmDouble* activeRecvBuf=(IssmDouble*)(recvbuf)+displs[0];
@@ -117,5 +109,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Allreduce(void *sendbuf, void *recvbuf, int count, ISSMMPI_Datatype datatype, ISSMMPI_Op op, ISSMMPI_Comm comm){/*{{{*/
+int ISSM_MPI_Allreduce(void *sendbuf, void *recvbuf, int count, ISSM_MPI_Datatype datatype, ISSM_MPI_Op op, ISSM_MPI_Comm comm){/*{{{*/
  
   int rc=0;
@@ -138,5 +130,5 @@
 #else
 # ifdef _HAVE_ADOLC_
-  if (datatype==ISSMMPI_DOUBLE) { 
+  if (datatype==ISSM_MPI_DOUBLE) { 
     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
@@ -149,5 +141,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Barrier(ISSMMPI_Comm comm){  /*{{{*/
+int ISSM_MPI_Barrier(ISSM_MPI_Comm comm){  /*{{{*/
 
   int rc=0;
@@ -163,5 +155,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Bcast(void *buffer, int count, ISSMMPI_Datatype datatype, int root, ISSMMPI_Comm comm){  /*{{{*/
+int ISSM_MPI_Bcast(void *buffer, int count, ISSM_MPI_Datatype datatype, int root, ISSM_MPI_Comm comm){  /*{{{*/
 
   int rc=0;
@@ -185,5 +177,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Comm_free(ISSMMPI_Comm *comm){ /*{{{*/
+int ISSM_MPI_Comm_free(ISSM_MPI_Comm *comm){ /*{{{*/
  
   int rc=0;
@@ -199,5 +191,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Comm_rank(ISSMMPI_Comm comm, int *rank){  /*{{{*/
+int ISSM_MPI_Comm_rank(ISSM_MPI_Comm comm, int *rank){  /*{{{*/
 
   int rc=0;
@@ -210,5 +202,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Comm_size( ISSMMPI_Comm comm, int *size){ /*{{{*/
+int ISSM_MPI_Comm_size( ISSM_MPI_Comm comm, int *size){ /*{{{*/
  
   int rc=0;
@@ -221,5 +213,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Finalize(void){  /*{{{*/
+int ISSM_MPI_Finalize(void){  /*{{{*/
 
   int rc=0;
@@ -233,5 +225,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Gather(void *sendbuf, int sendcnt, ISSMMPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSMMPI_Datatype recvtype, int root, ISSMMPI_Comm comm){  /*{{{*/
+int ISSM_MPI_Gather(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm){  /*{{{*/
 
   int rc=0;
@@ -259,5 +251,5 @@
 #else
 # ifdef _HAVE_ADOLC_
-  if (sendtype==ISSMMPI_DOUBLE) { 
+  if (sendtype==ISSM_MPI_DOUBLE) { 
     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
@@ -270,5 +262,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Gatherv(void *sendbuf, int sendcnt, ISSMMPI_Datatype sendtype, void *recvbuf, int *recvcnts, int *displs, ISSMMPI_Datatype recvtype, int root, ISSMMPI_Comm comm){/*{{{*/
+int ISSM_MPI_Gatherv(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int *recvcnts, int *displs, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm){/*{{{*/
  
   int rc=0;
@@ -299,5 +291,5 @@
   assert(sendcnt==recvcnts[0]); // we handle only identical representations 
 # ifdef _HAVE_ADOLC_
-  if (sendtype==ISSMMPI_DOUBLE) { 
+  if (sendtype==ISSM_MPI_DOUBLE) { 
     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
     IssmDouble* activeRecvBuf=(IssmDouble*)(recvbuf)+displs[0];
@@ -310,5 +302,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Init(int *argc, char ***argv){  /*{{{*/
+int ISSM_MPI_Init(int *argc, char ***argv){  /*{{{*/
 
   int rc=0;
@@ -322,5 +314,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Recv(void *buf, int count, ISSMMPI_Datatype datatype, int source, int tag, ISSMMPI_Comm comm, ISSMMPI_Status *status){ /*{{{*/
+int ISSM_MPI_Recv(void *buf, int count, ISSM_MPI_Datatype datatype, int source, int tag, ISSM_MPI_Comm comm, ISSM_MPI_Status *status){ /*{{{*/
 
   int rc=0;
@@ -351,5 +343,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Reduce(void *sendbuf, void *recvbuf, int count, ISSMMPI_Datatype datatype, ISSMMPI_Op op, int root, ISSMMPI_Comm comm){ /*{{{*/
+int ISSM_MPI_Reduce(void *sendbuf, void *recvbuf, int count, ISSM_MPI_Datatype datatype, ISSM_MPI_Op op, int root, ISSM_MPI_Comm comm){ /*{{{*/
 
   int rc=0;
@@ -374,5 +366,5 @@
 #else
 # ifdef _HAVE_ADOLC_
-  if (datatype==ISSMMPI_DOUBLE) { 
+  if (datatype==ISSM_MPI_DOUBLE) { 
     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
@@ -385,5 +377,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Scatter(void *sendbuf, int sendcnt, ISSMMPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSMMPI_Datatype recvtype, int root, ISSMMPI_Comm comm){ /*{{{*/
+int ISSM_MPI_Scatter(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm){ /*{{{*/
 
   int rc=0;
@@ -411,5 +403,5 @@
 #else
 # ifdef _HAVE_ADOLC_
-  if (sendtype==ISSMMPI_DOUBLE) { 
+  if (sendtype==ISSM_MPI_DOUBLE) { 
     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
@@ -422,5 +414,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Scatterv(void *sendbuf, int *sendcnts, int *displs, ISSMMPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSMMPI_Datatype recvtype, int root, ISSMMPI_Comm comm){ /*{{{*/
+int ISSM_MPI_Scatterv(void *sendbuf, int *sendcnts, int *displs, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm){ /*{{{*/
 
   int rc=0;
@@ -451,5 +443,5 @@
   assert(sendcnts[0]==recvcnt); // we handle only identical representations 
 # ifdef _HAVE_ADOLC_
-  if (sendtype==ISSMMPI_DOUBLE) { 
+  if (sendtype==ISSM_MPI_DOUBLE) { 
     IssmDouble* activeSendBuf=(IssmDouble*)(sendbuf)+displs[0];
     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
@@ -462,5 +454,5 @@
   return rc;
 }/*}}}*/
-int ISSMMPI_Send(void *buf, int count, ISSMMPI_Datatype datatype, int dest, int tag, ISSMMPI_Comm comm){ /*{{{*/
+int ISSM_MPI_Send(void *buf, int count, ISSM_MPI_Datatype datatype, int dest, int tag, ISSM_MPI_Comm comm){ /*{{{*/
 
   int rc=0;
@@ -487,10 +479,10 @@
   return rc;
 }/*}}}*/
-double ISSMMPI_Wtime(void){/*{{{*/
+double ISSM_MPI_Wtime(void){/*{{{*/
  
   assert(0); // to be implemented
   return 0.0;
 }/*}}}*/
-void ISSMMPI_ContiguousInAdolc(size_t aSize) { /*{{{*/
+void ISSM_MPI_ContiguousInAdolc(size_t aSize) { /*{{{*/
 
 #ifdef _HAVE_ADOLC_
@@ -498,3 +490,2 @@
 #endif
 }/*}}}*/
-
