Index: /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp	(revision 24766)
+++ /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp	(revision 24767)
@@ -221,5 +221,8 @@
 				rc=AMPI_Finalize();
 			#elif defined(_HAVE_MEDIPACK_)
-				TOOL::finalize();
+				/*Old implementation*/
+				//TOOL::finalize();
+				/*New implementation*/
+				delete mpiTypes;
 				rc=AMPI_Finalize();
 			#else
@@ -318,5 +321,9 @@
 			#elif defined(_HAVE_MEDIPACK_)
 				rc=AMPI_Init(argc,argv);
-				TOOL::init();
+				/*Old implementation of Medipack*/
+				//TOOL::init();
+				/*New*/
+				//MpiTypes* mpiTypes;
+				mpiTypes = new MpiTypes();
 			#else
 				rc=AMPI_Init_NT(argc,argv);
Index: /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 24766)
+++ /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 24767)
@@ -26,7 +26,14 @@
 			using namespace medi;
 			#if defined(_HAVE_CODIPACK_)
-			#include "codi/externals/codiMediPackTypes.hpp"
-			#define TOOL CoDiPackTool<IssmDouble>
-			#define AMPI_ADOUBLE TOOL::MPI_TYPE
+			/*Old implementation of MeDiPack*/
+			//#include "codi/externals/codiMediPackTypes.hpp"
+			//#define TOOL CoDiPackTool<IssmDouble>
+			//#define AMPI_ADOUBLE TOOL::MPI_TYPE
+			//
+			/*New implementation*/
+			#include <codi/externals/codiMpiTypes.hpp>
+			using MpiTypes = CoDiMpiTypes<IssmDouble>;
+			MpiTypes* mpiTypes;
+			#define AMPI_ADOUBLE mpiTypes->MPI_TYPE
 			#elif defined(_HAVE_ADOLC_)
 			#include "adolc/medipacksupport.h"
