Index: /issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 23642)
+++ /issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 23643)
@@ -719,9 +719,10 @@
 		}
 
-		/*Serialize vector*/
-		IssmPDouble* serialvalues = this->value->ToMPISerial();
-		this->value->GetSize(&rows);
+		/*Serialize vector on cpu0*/
+		IssmPDouble* serialvalues = this->value->ToMPISerial0();
 
 		if(IssmComm::GetRank()==0){
+			this->value->GetSize(&rows);
+
 			/*First write name: */
 			length=(strlen(this->result_name)+1)*sizeof(char);
@@ -770,12 +771,14 @@
 		}
 
-		/*Serialize vector*/
-		serialvalues = this->value->ToMPISerial();
-		this->value->GetSize(&rows);
-
-		pserialvalues=xNew<IssmPDouble>(rows);
-		for(i=0;i<rows;i++)pserialvalues[i]=reCast<IssmPDouble>(serialvalues[i]);
+		/*Serialize vector only on cpu0*/
+		serialvalues = this->value->ToMPISerial0();
 
 		if(IssmComm::GetRank()==0){
+
+			/*Make it passive*/
+			this->value->GetSize(&rows);
+			pserialvalues=xNew<IssmPDouble>(rows);
+			for(i=0;i<rows;i++)pserialvalues[i]=reCast<IssmPDouble>(serialvalues[i]);
+
 			/*First write name: */
 			length=(strlen(this->result_name)+1)*sizeof(char);
@@ -794,10 +797,11 @@
 			fwrite(&cols,sizeof(int),1,fid);
 			fwrite(pserialvalues,cols*rows*sizeof(IssmPDouble),1,fid);
+
+			/*Clean up*/
+			xDelete<IssmPDouble>(pserialvalues);
 		}
 
 		/*Clean up*/
-		xDelete<IssmPDouble>(pserialvalues);
 		xDelete<IssmDouble>(serialvalues);
-
 	}
 	/*}}}*/
Index: /issm/trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h	(revision 23642)
+++ /issm/trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h	(revision 23643)
@@ -43,4 +43,5 @@
 		virtual void AYPX(IssmAbsVec* X, doubletype a)=0;
 		virtual doubletype* ToMPISerial(void)=0;
+		virtual doubletype* ToMPISerial0(void)=0;
 		virtual void Shift(doubletype shift)=0;
 		virtual void Copy(IssmAbsVec* to)=0;
Index: /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 23642)
+++ /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 23643)
@@ -460,4 +460,11 @@
 			/*return: */
 			return buffer;
+
+		}
+		/*}}}*/
+		doubletype* ToMPISerial0(void){/*{{{*/
+
+			/*FIXME: Should not broadcast to every cpu*/
+			return this->ToMPISerial();
 
 		}
Index: /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 23642)
+++ /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 23643)
@@ -218,4 +218,10 @@
 		}
 		/*}}}*/
+		doubletype* ToMPISerial0(void){/*{{{*/
+
+			return this->ToMPISerial();
+
+		}
+		/*}}}*/
 		void Shift(doubletype shift){/*{{{*/
 
Index: /issm/trunk-jpl/src/c/toolkits/issm/IssmVec.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/IssmVec.h	(revision 23642)
+++ /issm/trunk-jpl/src/c/toolkits/issm/IssmVec.h	(revision 23643)
@@ -183,4 +183,8 @@
 		}
 		/*}}}*/
+		doubletype* ToMPISerial0(void){/*{{{*/
+			return vector->ToMPISerial0();
+		}
+		/*}}}*/
 		void Shift(doubletype shift){/*{{{*/
 			vector->Shift(shift);
Index: /issm/trunk-jpl/src/c/toolkits/objects/Vector.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/objects/Vector.h	(revision 23642)
+++ /issm/trunk-jpl/src/c/toolkits/objects/Vector.h	(revision 23643)
@@ -291,4 +291,20 @@
 		}
 		/*}}}*/
+		doubletype* ToMPISerial0(void){/*{{{*/
+
+			doubletype* vec_serial=NULL;
+
+			_assert_(this);
+			if(type==PetscVecType){
+				#ifdef _HAVE_PETSC_
+				vec_serial=this->pvector->ToMPISerial0();
+				#endif
+			}
+			else vec_serial=this->ivector->ToMPISerial0();
+
+			return vec_serial;
+
+		}
+		/*}}}*/
 		void Shift(doubletype shift){_assert_(this);/*{{{*/
 
Index: /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 23642)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 23643)
@@ -191,5 +191,13 @@
 
 	IssmDouble* vec_serial=NULL;
-	VecToMPISerial(&vec_serial, this->vector,IssmComm::GetComm());
+	VecToMPISerial(&vec_serial, this->vector,IssmComm::GetComm(),true);
+	return vec_serial;
+
+}
+/*}}}*/
+IssmDouble* PetscVec::ToMPISerial0(void){/*{{{*/
+
+	IssmDouble* vec_serial=NULL;
+	VecToMPISerial(&vec_serial, this->vector,IssmComm::GetComm(),false);
 	return vec_serial;
 
Index: /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 23642)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 23643)
@@ -51,4 +51,5 @@
 		void        AYPX(PetscVec* X, IssmDouble a);
 		IssmDouble* ToMPISerial(void);
+		IssmDouble* ToMPISerial0(void);
 		void        Shift(IssmDouble shift);
 		void        Copy(PetscVec* to);
Index: /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 23642)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 23643)
@@ -12,5 +12,5 @@
 #include "../../../shared/shared.h"
 
-int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm){
+int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm,bool broadcast){
 
 	int i;
@@ -45,5 +45,7 @@
 
 	/*Allocate gathered vector on all nodes .*/
-	gathered_vector=xNew<double>(vector_size);
+	if(broadcast || my_rank==0){ 
+		gathered_vector=xNew<double>(vector_size);
+	}
 
 	/*Allocate local vectors*/
@@ -83,6 +85,8 @@
 	}
 
-	/*Now, broadcast gathered_vector from node 0 to other nodes: */
-	ISSM_MPI_Bcast(gathered_vector,vector_size,ISSM_MPI_PDOUBLE,0,comm);
+	if(broadcast){
+		/*Now, broadcast gathered_vector from node 0 to other nodes: */
+		ISSM_MPI_Bcast(gathered_vector,vector_size,ISSM_MPI_PDOUBLE,0,comm);
+	}
 
 	/*Assign output pointers: */
Index: /issm/trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h	(revision 23642)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h	(revision 23643)
@@ -22,5 +22,5 @@
 Mat NewMat(int M,int N,int connectivity,int numberofdofspernode, ISSM_MPI_Comm comm);
 
-int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm);
+int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm,bool broadcast=true);
 void MatFree(Mat* pmat);
 void ISFree(IS* pis);
