Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 14909)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 14910)
@@ -236,5 +236,6 @@
 					./io/Disk/pfclose.cpp\
 					./io/Disk/WriteLockFile.cpp\
-					./io/PrintfFunction.cpp\
+					./io/Print/PrintfFunction.cpp\
+					./io/Print/Print.h\
 					./io/Comm/Comm.h\
 					./io/Comm/CommDef.h\
Index: /issm/trunk-jpl/src/c/classes/DofIndexing.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 14909)
+++ /issm/trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 14910)
@@ -14,4 +14,5 @@
 #include "../include/types.h"
 #include "../include/typedefs.h"
+#include "../io/Print/Print.h"
 #include "../include/macros.h"
 #include "../shared/Exceptions/exceptions.h"
Index: /issm/trunk-jpl/src/c/classes/bamg/Edge.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/bamg/Edge.cpp	(revision 14909)
+++ /issm/trunk-jpl/src/c/classes/bamg/Edge.cpp	(revision 14910)
@@ -7,4 +7,5 @@
 #include "Mesh.h"
 #include "Geometry.h"
+#include "../../io/Print/Print.h"
 
 namespace bamg {
Index: /issm/trunk-jpl/src/c/classes/bamg/EigenMetric.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/bamg/EigenMetric.cpp	(revision 14909)
+++ /issm/trunk-jpl/src/c/classes/bamg/EigenMetric.cpp	(revision 14910)
@@ -5,4 +5,5 @@
 
 #include "Metric.h"
+#include "../../io/Print/Print.h"
 
 namespace bamg {
Index: /issm/trunk-jpl/src/c/classes/bamg/Metric.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/bamg/Metric.cpp	(revision 14909)
+++ /issm/trunk-jpl/src/c/classes/bamg/Metric.cpp	(revision 14910)
@@ -6,4 +6,5 @@
 #include "../../include/include.h"
 #include "../../shared/Exceptions/exceptions.h"
+#include "../../io/Print/Print.h"
 
 using namespace std;
Index: /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 14909)
+++ /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 14910)
@@ -6,4 +6,5 @@
 #include "./GaussTria.h"
 #include "../../include/macros.h"
+#include "../../io/Print/Print.h"
 #include "../../shared/Exceptions/exceptions.h"
 #include "../../shared/MemOps/MemOps.h"
Index: /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 14909)
+++ /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 14910)
@@ -5,7 +5,9 @@
 #include "./GaussTria.h"
 #include "../../include/macros.h"
+#include "../../io/Print/Print.h"
 #include "../../shared/Exceptions/exceptions.h"
 #include "../../shared/MemOps/MemOps.h"
 #include "../../shared/Numerics/GaussPoints.h"
+#include "../../include/typedefs.h"
 
 /*GaussTria constructors and destructors:*/
Index: /issm/trunk-jpl/src/c/include/macros.h
===================================================================
--- /issm/trunk-jpl/src/c/include/macros.h	(revision 14909)
+++ /issm/trunk-jpl/src/c/include/macros.h	(revision 14910)
@@ -19,7 +19,15 @@
 /*}}}*/
 
-/* _printf_ {{{*/
-/*Printing macro: only cpu number 0 */
-#define _printf_(flag,...) do{if(flag) PrintfFunction(__VA_ARGS__);}while(0)
+
+/*Exceptions: */
+/* _assert_ {{{*/
+/*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
+#ifdef _ISSM_DEBUG_ 
+#define _assert_(statement)\
+  if (!(statement)) _error_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT)
+#else
+#define _assert_(ignore)\
+  ((void) 0)
+#endif
 /*}}}*/
 /* _error_ {{{*/
@@ -35,38 +43,4 @@
    aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
    throw ErrorException(__FILE__,__func__,__LINE__,aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
-#endif
-/*}}}*/
-/* _printLine_ {{{*/
-/* macro to print a line, adds std::endl */
-#define _printLine_(StreamArgs)\
-   do{std::cout << StreamArgs << std::endl;}while(0)
-/*}}}*/
-/* _printString_ {{{*/
-/* macro to print some string */
-#define _printString_(StreamArgs)\
-   do{std::cout << StreamArgs;}while(0)
-/*}}}*/
-/* _pprintLine_ {{{*/
-/* macro to print a line, adds std::endl, only on cpu 0 */
-#define _pprintLine_(StreamArgs)\
-  do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
-	  aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
-	  PrintfFunction(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
-/*}}}*/
-/* _pprintString_ {{{*/
-/* macro to print some string. Only on cpu0 */
-#define _pprintString_(StreamArgs)\
-  do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
-	  aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
-	  PrintfFunction2(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
-/*}}}*/
-/* _assert_ {{{*/
-/*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
-#ifdef _ISSM_DEBUG_ 
-#define _assert_(statement)\
-  if (!(statement)) _error_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT)
-#else
-#define _assert_(ignore)\
-  ((void) 0)
 #endif
 /*}}}*/
Index: /issm/trunk-jpl/src/c/io/Print/Print.h
===================================================================
--- /issm/trunk-jpl/src/c/io/Print/Print.h	(revision 14910)
+++ /issm/trunk-jpl/src/c/io/Print/Print.h	(revision 14910)
@@ -0,0 +1,55 @@
+/*\file Print.h
+ *\brief: print I/O for ISSM
+ */
+
+#ifndef _ISSM_PRINT_H_
+#define _ISSM_PRINT_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif 
+
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+
+using namespace std;
+/*macros:*/
+/* _printf_ {{{*/
+/*Printing macro: only cpu number 0 */
+#define _printf_(flag,...) do{if(flag) PrintfFunction(__VA_ARGS__);}while(0)
+/*}}}*/
+/* _printLine_ {{{*/
+/* macro to print a line, adds std::endl */
+#define _printLine_(StreamArgs)\
+   do{std::cout << StreamArgs << std::endl;}while(0)
+/*}}}*/
+/* _printString_ {{{*/
+/* macro to print some string */
+#define _printString_(StreamArgs)\
+   do{std::cout << StreamArgs;}while(0)
+/*}}}*/
+/* _pprintLine_ {{{*/
+/* macro to print a line, adds std::endl, only on cpu 0 */
+#define _pprintLine_(StreamArgs)\
+  do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+	  aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
+	  PrintfFunction(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+/*}}}*/
+/* _pprintString_ {{{*/
+/* macro to print some string. Only on cpu0 */
+#define _pprintString_(StreamArgs)\
+  do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
+	  aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
+	  PrintfFunction2(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
+/*}}}*/
+
+/*functions: */
+int PrintfFunction(const char* format,...);
+int PrintfFunction(const string & message);
+int PrintfFunction2(const string & message);
+
+#endif	
Index: /issm/trunk-jpl/src/c/io/Print/PrintfFunction.cpp
===================================================================
--- /issm/trunk-jpl/src/c/io/Print/PrintfFunction.cpp	(revision 14910)
+++ /issm/trunk-jpl/src/c/io/Print/PrintfFunction.cpp	(revision 14910)
@@ -0,0 +1,87 @@
+/*\file PrintfFunction.c
+ *\brief: this function is used by the _printf_ macro, to take into account the 
+ *fact we may be running on a cluster. 
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./Print.h"
+#include "../Comm/Comm.h"
+#include "../../shared/MemOps/MemOps.h"
+
+#ifdef _HAVE_ANDROID_NDK_
+#include <android/log.h>
+#endif
+
+int PrintfFunction(const char* format,...){
+	/*http://linux.die.net/man/3/vsnprintf*/
+
+	/*string to be printed: */
+	char *buffer = NULL;
+	int   n,size = 100;
+	int   my_rank;
+	//variable list of arguments
+	va_list args;
+
+	/*recover my_rank:*/
+	my_rank=IssmComm::GetRank();
+
+	while(true){
+
+		/*allocate buffer for given string size*/
+		buffer=xNew<char>(size);
+
+		/* Try to print in the allocated space. */
+		va_start(args, format);
+		n=vsnprintf(buffer,size,format,args);
+		va_end(args);
+
+		/* If that worked, return the string. */
+		if(n>-1 && n<size) break;
+
+		/* Else try again with more space. */
+		if(n>-1)   /* glibc 2.1 */
+		 size=n+1; /* precisely what is needed */
+		else       /* glibc 2.0 */
+		 size*=2;  /* twice the old size */
+
+		xDelete<char>(buffer);
+	}
+
+	/*Ok, if we are running in parallel, get node 0 to print*/
+	if(my_rank==0)_printString_(buffer);
+
+	/*Clean up and return*/
+	xDelete<char>(buffer);
+	return 1;
+}
+int PrintfFunction(const string & message){
+	int  my_rank;
+
+	/*recover my_rank:*/
+	my_rank=IssmComm::GetRank();
+
+	if(my_rank==0){
+		#ifdef _HAVE_ANDROID_JNI_
+		__android_log_print(ANDROID_LOG_INFO, "Native",message.c_str());
+		#else
+		printf("%s\n",message.c_str());
+		#endif
+	}
+	return 1;
+}
+int PrintfFunction2(const string & message){
+	int  my_rank;
+
+	/*recover my_rank:*/
+	my_rank=IssmComm::GetRank();
+
+	if(my_rank==0){
+		printf("%s",message.c_str());
+	}
+	return 1;
+}
Index: sm/trunk-jpl/src/c/io/PrintfFunction.cpp
===================================================================
--- /issm/trunk-jpl/src/c/io/PrintfFunction.cpp	(revision 14909)
+++ 	(revision )
@@ -1,82 +1,0 @@
-/*\file PrintfFunction.c
- *\brief: this function is used by the _printf_ macro, to take into account the 
- *fact we may be running on a cluster. 
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include "../shared/shared.h"
-#include "../include/include.h"
-
-#ifdef _HAVE_ANDROID_NDK_
-#include <android/log.h>
-#endif
-
-int PrintfFunction(const char* format,...){
-	/*http://linux.die.net/man/3/vsnprintf*/
-
-	/*string to be printed: */
-	char *buffer = NULL;
-	int   n,size = 100;
-	int   my_rank;
-	//variable list of arguments
-	va_list args;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	while(true){
-
-		/*allocate buffer for given string size*/
-		buffer=xNew<char>(size);
-
-		/* Try to print in the allocated space. */
-		va_start(args, format);
-		n=vsnprintf(buffer,size,format,args);
-		va_end(args);
-
-		/* If that worked, return the string. */
-		if(n>-1 && n<size) break;
-
-		/* Else try again with more space. */
-		if(n>-1)   /* glibc 2.1 */
-		 size=n+1; /* precisely what is needed */
-		else       /* glibc 2.0 */
-		 size*=2;  /* twice the old size */
-
-		xDelete<char>(buffer);
-	}
-
-	/*Ok, if we are running in parallel, get node 0 to print*/
-	if(my_rank==0)_printString_(buffer);
-
-	/*Clean up and return*/
-	xDelete<char>(buffer);
-	return 1;
-}
-int PrintfFunction(const string & message){
-	int  my_rank;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	if(my_rank==0){
-		#ifdef _HAVE_ANDROID_JNI_
-		__android_log_print(ANDROID_LOG_INFO, "Native",message.c_str());
-		#else
-		printf("%s\n",message.c_str());
-		#endif
-	}
-	return 1;
-}
-int PrintfFunction2(const string & message){
-	int  my_rank;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	if(my_rank==0){
-		printf("%s",message.c_str());
-	}
-	return 1;
-}
Index: /issm/trunk-jpl/src/c/io/io.h
===================================================================
--- /issm/trunk-jpl/src/c/io/io.h	(revision 14909)
+++ /issm/trunk-jpl/src/c/io/io.h	(revision 14910)
@@ -11,10 +11,8 @@
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
 #endif 
+
 #include "./Disk/diskio.h"
-
-/*printf: */
-int PrintfFunction(const char* format,...);
-int PrintfFunction(const string & message);
-int PrintfFunction2(const string & message);
+#include "./Print/Print.h"
+#include "./Comm/Comm.h"
 
 #endif	/* _IO_H_ */
Index: /issm/trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h	(revision 14909)
+++ /issm/trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h	(revision 14910)
@@ -20,4 +20,5 @@
 #include "../../shared/Exceptions/exceptions.h"
 #include "../../shared/MemOps/MemOps.h"
+#include "../../io/Print/Print.h"
 #include "../../include/macros.h"
 #include "../../toolkits/gsl/gslincludes.h"
Index: /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 14909)
+++ /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 14910)
@@ -18,4 +18,5 @@
 
 #include "../../shared/Exceptions/exceptions.h"
+#include "../../io/Print/Print.h"
 #include "../../shared/MemOps/MemOps.h"
 #include "../../include/macros.h"
