Index: /issm/trunk-jpl/src/c/classes/IoModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/IoModel.cpp	(revision 13606)
+++ /issm/trunk-jpl/src/c/classes/IoModel.cpp	(revision 13607)
@@ -334,5 +334,5 @@
 				record_code=0; //0 means bailout
 				#ifdef _HAVE_MPI_
-				MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell others cpus we are bailing: */
+				MPI_Bcast(&record_code,1,MPI_INT,0,IssmComm::GetComm());  /*tell others cpus we are bailing: */
 				#endif
 				break;
@@ -346,9 +346,9 @@
 				#ifdef _HAVE_MPI_
 				/*Tell other cpus what we are doing: */
-				MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell other cpus what we are going to do: */
+				MPI_Bcast(&record_code,1,MPI_INT,0,IssmComm::GetComm());  /*tell other cpus what we are going to do: */
 
 				/*Tell other cpus the name of the data, then branch according to the data type: */
-				MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD);  
-				MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD);  
+				MPI_Bcast(&record_enum,1,MPI_INT,0,IssmComm::GetComm());  
+				MPI_Bcast(&record_length,1,MPI_INT,0,IssmComm::GetComm());  
 				#endif
 				
@@ -358,5 +358,5 @@
 						if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_("could not read boolean ");
 						#ifdef _HAVE_MPI_
-						MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+						MPI_Bcast(&booleanint,1,MPI_INT,0,IssmComm::GetComm()); 
 						#endif
 
@@ -369,5 +369,5 @@
 						if(fread(&integer,sizeof(int),1,this->fid)!=1) _error_("could not read integer ");
 						#ifdef _HAVE_MPI_
-						MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+						MPI_Bcast(&integer,1,MPI_INT,0,IssmComm::GetComm()); 
 						#endif
 
@@ -386,5 +386,5 @@
 							if(fread(&pscalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar ");
 							#ifdef _HAVE_MPI_
-							MPI_Bcast(&pscalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+							MPI_Bcast(&pscalar,1,MPI_DOUBLE,0,IssmComm::GetComm()); 
 							#endif
 							scalar=reCast<IssmDouble>(pscalar);
@@ -399,5 +399,5 @@
 						if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_("could not read length of string ");
 						#ifdef _HAVE_MPI_
-						MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+						MPI_Bcast(&string_size,1,MPI_INT,0,IssmComm::GetComm()); 
 						#endif
 
@@ -409,5 +409,5 @@
 							if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_(" could not read string ");
 							#ifdef _HAVE_MPI_
-							MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+							MPI_Bcast(string,string_size,MPI_CHAR,0,IssmComm::GetComm()); 
 							#endif
 						}
@@ -467,15 +467,15 @@
 	else{ //cpu ~0 {{{
 		for(;;){ //wait on cpu 0
-			MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*get from cpu 0 what we are going to do: */
+			MPI_Bcast(&record_code,1,MPI_INT,0,IssmComm::GetComm());  /*get from cpu 0 what we are going to do: */
 			if(record_code==0){
 				break; //we are done, break from the loop
 			}
 			else{
-				MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD);   //get from cpu 0 name of the data
-				MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD);  
+				MPI_Bcast(&record_enum,1,MPI_INT,0,IssmComm::GetComm());   //get from cpu 0 name of the data
+				MPI_Bcast(&record_length,1,MPI_INT,0,IssmComm::GetComm());  
 				switch(record_code){
 				case 1: 
 					/*boolean. get it from cpu 0 */
-					MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+					MPI_Bcast(&booleanint,1,MPI_INT,0,IssmComm::GetComm()); 
 						
 					/*create BoolParam: */
@@ -485,5 +485,5 @@
 				case 2:
 					/*integer. get it from cpu 0 */
-					MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+					MPI_Bcast(&integer,1,MPI_INT,0,IssmComm::GetComm()); 
 						
 					/*create IntParam: */
@@ -493,5 +493,5 @@
 				case 3:
 					/*scalar. get it from cpu 0 */
-					MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+					MPI_Bcast(&scalar,1,MPI_DOUBLE,0,IssmComm::GetComm()); 
 						
 					/*create DoubleParam: */
@@ -500,5 +500,5 @@
 					break;
 				case 4: 
-					MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+					MPI_Bcast(&string_size,1,MPI_INT,0,IssmComm::GetComm()); 
 					if(string_size){
 						string=xNew<char>((string_size+1));
@@ -506,5 +506,5 @@
 
 						/*Read string from cpu 0: */
-						MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+						MPI_Bcast(string,string_size,MPI_CHAR,0,IssmComm::GetComm()); 
 					}
 					else{
@@ -561,5 +561,5 @@
 	}
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&booleanint,1,MPI_INT,0,IssmComm::GetComm()); 
 	#endif
 
@@ -593,5 +593,5 @@
 
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&integer,1,MPI_INT,0,IssmComm::GetComm()); 
 	#endif
 
@@ -624,5 +624,5 @@
 	}
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&scalar,1,MPI_DOUBLE,0,IssmComm::GetComm()); 
 	#endif
 
@@ -659,5 +659,5 @@
 
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&string_size,1,MPI_INT,0,IssmComm::GetComm()); 
 	#endif
 
@@ -672,5 +672,5 @@
 		}
 		#ifdef _HAVE_MPI_
-		MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+		MPI_Bcast(string,string_size,MPI_CHAR,0,IssmComm::GetComm()); 
 		#endif
 	}
@@ -715,5 +715,5 @@
 
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&M,1,MPI_INT,0,IssmComm::GetComm()); 
 	#endif
 
@@ -722,5 +722,5 @@
 	}
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
+	MPI_Bcast(&N,1,MPI_INT,0,IssmComm::GetComm());
 	#endif
 
@@ -735,5 +735,5 @@
 		
 		#ifdef _HAVE_MPI_
-		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,IssmComm::GetComm()); 
 		#endif
 	}
@@ -787,5 +787,5 @@
 	}
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&M,1,MPI_INT,0,IssmComm::GetComm()); 
 	#endif
 
@@ -794,5 +794,5 @@
 	}
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&N,1,MPI_INT,0,IssmComm::GetComm()); 
 	#endif
 
@@ -806,5 +806,5 @@
 		}
 		#ifdef _HAVE_MPI_
-		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,IssmComm::GetComm()); 
 		#endif
 
@@ -857,5 +857,5 @@
 	}
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&numstrings,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&numstrings,1,MPI_INT,0,IssmComm::GetComm()); 
 	#endif
 
@@ -872,5 +872,5 @@
 			}
 			#ifdef _HAVE_MPI_
-			MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+			MPI_Bcast(&string_size,1,MPI_INT,0,IssmComm::GetComm()); 
 			#endif
 			if(string_size){
@@ -883,5 +883,5 @@
 				}
 				#ifdef _HAVE_MPI_
-				MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+				MPI_Bcast(string,string_size,MPI_CHAR,0,IssmComm::GetComm()); 
 				#endif
 			}
@@ -930,5 +930,5 @@
 	}
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&numrecords,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&numrecords,1,MPI_INT,0,IssmComm::GetComm()); 
 	#endif
 
@@ -953,5 +953,5 @@
 			}
 			#ifdef _HAVE_MPI_
-			MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+			MPI_Bcast(&M,1,MPI_INT,0,IssmComm::GetComm()); 
 			#endif
 
@@ -960,5 +960,5 @@
 			}
 			#ifdef _HAVE_MPI_
-			MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
+			MPI_Bcast(&N,1,MPI_INT,0,IssmComm::GetComm()); 
 			#endif
 
@@ -973,5 +973,5 @@
 
 				#ifdef _HAVE_MPI_
-				MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+				MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,IssmComm::GetComm()); 
 				#endif
 				matrices[i]=xNew<IssmDouble>(M*N);
@@ -1308,5 +1308,5 @@
 	/*Broadcast code and vector type: */
 #ifdef _HAVE_MPI_
-	MPI_Bcast(&lastindex,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&lastindex,1,MPI_INT,0,IssmComm::GetComm()); 
 #endif
 
@@ -1364,5 +1364,5 @@
 	}
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&found,1,MPI_INT,0,IssmComm::GetComm()); 
 	if(!found)_error_("could not find data with name " << EnumToStringx(data_enum) << " in binary file");
 	#endif
@@ -1370,7 +1370,7 @@
 	/*Broadcast code and vector type: */
 	#ifdef _HAVE_MPI_
-	MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD); 
-	MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD); 
-	if(record_code==5) MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD); 
+	MPI_Bcast(&record_code,1,MPI_INT,0,IssmComm::GetComm()); 
+	MPI_Bcast(&vector_type,1,MPI_INT,0,IssmComm::GetComm()); 
+	if(record_code==5) MPI_Bcast(&vector_type,1,MPI_INT,0,IssmComm::GetComm()); 
 	#endif
 
Index: /issm/trunk-jpl/src/c/classes/Patch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Patch.cpp	(revision 13606)
+++ /issm/trunk-jpl/src/c/classes/Patch.cpp	(revision 13607)
@@ -122,6 +122,6 @@
 	/*First, figure out total number of rows combining all the cpus: */
 	#ifdef _HAVE_MPI_
-	MPI_Reduce(&this->numrows,&total_numrows,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
-	MPI_Bcast(&total_numrows,1,MPI_INT,0,MPI_COMM_WORLD);
+	MPI_Reduce(&this->numrows,&total_numrows,1,MPI_INT,MPI_SUM,0,IssmComm::GetComm() );
+	MPI_Bcast(&total_numrows,1,MPI_INT,0,IssmComm::GetComm());
 	#else
 	total_numrows=this->numrows;
@@ -145,10 +145,10 @@
 	for (i=1;i<num_procs;i++){
 		if (my_rank==i){ 
-			MPI_Send(&this->numrows,1,MPI_INT,0,1,MPI_COMM_WORLD);   
-			if (this->numrows)MPI_Send(this->values,this->numrows*this->numcols,MPI_DOUBLE,0,1,MPI_COMM_WORLD); 
+			MPI_Send(&this->numrows,1,MPI_INT,0,1,IssmComm::GetComm());   
+			if (this->numrows)MPI_Send(this->values,this->numrows*this->numcols,MPI_DOUBLE,0,1,IssmComm::GetComm()); 
 		}
 		if (my_rank==0){
-			MPI_Recv(&node_numrows,1,MPI_INT,i,1,MPI_COMM_WORLD,&status); 
-			if (node_numrows)MPI_Recv(total_values+count,node_numrows*this->numcols,MPI_DOUBLE,i,1,MPI_COMM_WORLD,&status);
+			MPI_Recv(&node_numrows,1,MPI_INT,i,1,IssmComm::GetComm(),&status); 
+			if (node_numrows)MPI_Recv(total_values+count,node_numrows*this->numcols,MPI_DOUBLE,i,1,IssmComm::GetComm(),&status);
 			count+=node_numrows*this->numcols;
 		}
Index: /issm/trunk-jpl/src/c/classes/objects/IndependentObject.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/IndependentObject.cpp	(revision 13606)
+++ /issm/trunk-jpl/src/c/classes/objects/IndependentObject.cpp	(revision 13607)
@@ -117,5 +117,5 @@
 		
 		#ifdef _HAVE_MPI_
-		MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+		MPI_Bcast(&scalar,1,MPI_DOUBLE,0,IssmComm::GetComm()); 
 		#endif
 
@@ -151,5 +151,5 @@
 		}
 		#ifdef _HAVE_MPI_
-		MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+		MPI_Bcast(&M,1,MPI_INT,0,IssmComm::GetComm()); 
 		#endif
 
@@ -158,5 +158,5 @@
 		}
 		#ifdef _HAVE_MPI_
-		MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
+		MPI_Bcast(&N,1,MPI_INT,0,IssmComm::GetComm()); 
 		#endif
 
@@ -174,5 +174,5 @@
 			}
 			#ifdef _HAVE_MPI_
-			MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+			MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,IssmComm::GetComm()); 
 			#endif
 			
Index: /issm/trunk-jpl/src/c/classes/objects/Profiler.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Profiler.cpp	(revision 13606)
+++ /issm/trunk-jpl/src/c/classes/objects/Profiler.cpp	(revision 13607)
@@ -71,5 +71,5 @@
 	if(!dontmpisync){
 		#ifdef _HAVE_MPI_
-		MPI_Barrier(MPI_COMM_WORLD); 
+		MPI_Barrier(IssmComm::GetComm()); 
 		#endif
 	}
