Index: issm/trunk-jpl/src/c/classes/IoModel.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/IoModel.cpp	(revision 17225)
+++ issm/trunk-jpl/src/c/classes/IoModel.cpp	(revision 17627)
@@ -445,5 +445,5 @@
 				/*Ok, we have reached the end of the file. break: */
 				record_code=0; //0 means bailout
-				ISSM_MPI_Bcast(&record_code,1,ISSM_MPI_INT,0,IssmComm::GetComm());  /*tell others cpus we are bailing: */
+				ISSM_MPI_Bcast<int>(&record_code,1,0,IssmComm::GetComm());  /*tell others cpus we are bailing: */
 				break;
 			}
@@ -653,5 +653,5 @@
 		if(fread(&booleanint,sizeof(int),1,fid)!=1) _error_("could not read boolean ");
 	}
-	ISSM_MPI_Bcast(&booleanint,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&booleanint,1,0,IssmComm::GetComm()); 
 
 	/*cast to bool: */
@@ -683,5 +683,5 @@
 	}
 
-	ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&integer,1,0,IssmComm::GetComm()); 
 
 	/*Assign output pointers: */
@@ -710,5 +710,5 @@
 		if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error_("could not read scalar ");
 	}
-	ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<IssmPDouble>(&scalar,1,0,IssmComm::GetComm()); 
 
 	/*Assign output pointers: */
@@ -742,5 +742,5 @@
 	}
 
-	ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&string_size,1,0,IssmComm::GetComm()); 
 
 	/*Now allocate string: */
@@ -753,5 +753,5 @@
 			if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
 		}
-		ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+		ISSM_MPI_Bcast<char>(string,string_size,0,IssmComm::GetComm()); 
 	}
 	else{
@@ -792,10 +792,10 @@
 	}
 
-	ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&M,1,0,IssmComm::GetComm()); 
 
 	if(my_rank==0){  
 		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
 	}
-	ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+	ISSM_MPI_Bcast<int>(&N,1,0,IssmComm::GetComm());
 
 	/*Now allocate matrix: */
@@ -808,5 +808,5 @@
 		}
 
-		ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+		ISSM_MPI_Bcast<IssmPDouble>(matrix,M*N,0,IssmComm::GetComm()); 
 	}
 
@@ -857,10 +857,10 @@
 		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
 	}
-	ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&M,1,0,IssmComm::GetComm()); 
 
 	if(my_rank==0){  
 		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
 	}
-	ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&N,1,0,IssmComm::GetComm()); 
 
 	/*Now allocate matrix: */
@@ -872,5 +872,5 @@
 			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
 		}
-		ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+		ISSM_MPI_Bcast<IssmPDouble>(matrix,M*N,0,IssmComm::GetComm()); 
 
 		_assert_(this->independents);
@@ -921,5 +921,5 @@
 		if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_("could not read length of string array");
 	}
-	ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&numstrings,1,0,IssmComm::GetComm()); 
 
 	/*Now allocate string array: */
@@ -934,5 +934,5 @@
 				if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string ");
 			}
-			ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast<int>(&string_size,1,0,IssmComm::GetComm()); 
 			if(string_size){
 				string=xNew<char>((string_size+1));
@@ -943,5 +943,5 @@
 					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
 				}
-				ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast<char>(string,string_size,0,IssmComm::GetComm()); 
 			}
 			else{
@@ -988,5 +988,5 @@
 		if(fread(&numrecords,sizeof(int),1,fid)!=1) _error_("could not read number of records in matrix array ");
 	}
-	ISSM_MPI_Bcast(&numrecords,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&numrecords,1,0,IssmComm::GetComm()); 
 
 	if(numrecords){
@@ -1009,10 +1009,10 @@
 				if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows in " << i << "th matrix of matrix array");
 			}
-			ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast<int>(&M,1,0,IssmComm::GetComm()); 
 
 			if(my_rank==0){  
 				if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns in " << i << "th matrix of matrix array");
 			}
-			ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast<int>(&N,1,0,IssmComm::GetComm()); 
 
 			/*Now allocate matrix: */
@@ -1025,5 +1025,5 @@
 				}
 
-				ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast<IssmPDouble>(matrix,M*N,0,IssmComm::GetComm()); 
 				matrices[i]=xNew<IssmDouble>(M*N);
 				for (int j=0;j<M*N;++j) {matrices[i][j]=matrix[j];}
@@ -1169,5 +1169,5 @@
 			}
 
-			ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast<int>(&string_size,1,0,IssmComm::GetComm()); 
 
 			/*Now allocate string: */
@@ -1180,5 +1180,5 @@
 					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
 				}
-				ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast<char>(string,string_size,0,IssmComm::GetComm()); 
 			}
 			else{
@@ -1236,5 +1236,5 @@
 				}
 			}
-			ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast<int>(&integer,1,0,IssmComm::GetComm()); 
 
 			/*Assign: */
@@ -1295,10 +1295,10 @@
 				if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
 			}
-			ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast<int>(&M,1,0,IssmComm::GetComm()); 
 
 			if(my_rank==0){  
 				if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
 			}
-			ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast<int>(&N,1,0,IssmComm::GetComm()); 
 
 
@@ -1311,5 +1311,5 @@
 					if(fread(pmatrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
 				}
-				ISSM_MPI_Bcast(pmatrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast<IssmPDouble>(pmatrix,M*N,0,IssmComm::GetComm()); 
 
 				_assert_(this->independents);
@@ -1401,10 +1401,10 @@
 				if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
 			}
-			ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast<int>(&M,1,0,IssmComm::GetComm()); 
 
 			if(my_rank==0){  
 				if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
 			}
-			ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast<int>(&N,1,0,IssmComm::GetComm()); 
 
 
@@ -1418,5 +1418,5 @@
 					if(fread(pmatrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
 				}
-				ISSM_MPI_Bcast(pmatrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast<IssmPDouble>(pmatrix,M*N,0,IssmComm::GetComm()); 
 
 				_assert_(this->independents);
@@ -1594,5 +1594,5 @@
 	}
 	/*Broadcast code and vector type: */
-	ISSM_MPI_Bcast(&lastindex,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&lastindex,1,0,IssmComm::GetComm()); 
 
 	/*Assign output pointers:*/
@@ -1650,10 +1650,10 @@
 		}
 	}
-	ISSM_MPI_Bcast(&found,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&found,1,0,IssmComm::GetComm()); 
 	if(!found)_error_("could not find data with name " << EnumToStringx(data_enum) << " in binary file");
 
 	/*Broadcast code and vector type: */
-	ISSM_MPI_Bcast(&record_code,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-	ISSM_MPI_Bcast(&vector_type,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&record_code,1,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&vector_type,1,0,IssmComm::GetComm()); 
 
 	/*Assign output pointers:*/
@@ -1754,5 +1754,5 @@
 
 	/*Broadcast data: */
-	ISSM_MPI_Bcast(&num_instances,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast<int>(&num_instances,1,0,IssmComm::GetComm()); 
 
 	/*Assign output pointers:*/
