Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 23599)
@@ -2281,10 +2281,4 @@
 
 }
-/*}}}*/
-void       Penta::SetClone(int* minranks){/*{{{*/
-
-	_error_("not implemented yet");
-}
-
 /*}}}*/
 void       Penta::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset, int N, int M){/*{{{*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 23599)
@@ -149,5 +149,4 @@
 		void           ResetFSBasalBoundaryCondition(void);
 		void           ResetHooks();
-		void	         SetClone(int* minranks);
 		void           SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset, int N,int M);
 		void           SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 23599)
@@ -3263,9 +3263,4 @@
 }
 /*}}}*/
-void       Tria::SetClone(int* minranks){/*{{{*/
-
-	_error_("not implemented yet");
-}
-/*}}}*/
 void       Tria::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int N, int M){/*{{{*/
 
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 23599)
@@ -207,5 +207,4 @@
 		void           NormalSection(IssmDouble* normal,IssmDouble* xyz_list);
 		void           NormalTop(IssmDouble* normal,IssmDouble* xyz_list);
-		void	         SetClone(int* minranks);
 		void           SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
 		Seg*	         SpawnSeg(int index1,int index2);
Index: /issm/trunk-jpl/src/c/classes/Node.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Node.cpp	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Node.cpp	(revision 23599)
@@ -749,21 +749,4 @@
 }
 /*}}}*/
-void Node::SetClone(int* minranks){/*{{{*/
-
-	int my_rank;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	if (minranks[sid]==my_rank){
-		indexing.clone=false;
-	}
-	else{
-		/*!there is a cpu with lower rank that has the same node, 
-		therefore, I am a clone*/
-		indexing.clone=true;	
-	}
-}
-/*}}}*/
 void Node::ShowTrueDofs(int* truedofs, int ncols,int setenum){/*{{{*/
 
Index: /issm/trunk-jpl/src/c/classes/Node.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Node.h	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Node.h	(revision 23599)
@@ -77,5 +77,4 @@
 		void  RelaxConstraint(int dof);
 		bool  RequiresDofReindexing(void);
-		void  SetClone(int* minranks);
 		void  SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
 		void  ShowTrueDofs(int* truerows,int ncols,int setenum);
Index: /issm/trunk-jpl/src/c/classes/Nodes.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Nodes.cpp	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Nodes.cpp	(revision 23599)
@@ -133,4 +133,7 @@
 void  Nodes::DistributeDofs(int setenum){/*{{{*/
 
+	/*some check: */
+	_assert_(setenum==GsetEnum || setenum==FsetEnum || setenum==SsetEnum);
+
 	int  i;
 	int  dofcount=0;
@@ -145,7 +148,4 @@
 	int num_procs = IssmComm::GetSize();
 
-	/*some check: */
-	_assert_(setenum==GsetEnum || setenum==FsetEnum || setenum==SsetEnum);
-
 	/*Go through objects, and distribute dofs locally, from 0 to numberofdofsperobject*/
 	for(i=0;i<this->Size();i++){
@@ -155,5 +155,5 @@
 
 	/* Now every object has distributed dofs, but locally, and with a dof count starting from 
-	 * 0. This means the dofs between all the cpus are not unique. We now offset the dofs of eache
+	 * 0. This means the dofs between all the cpus are not unique. We now offset the dofs of each
 	 * cpus by the total last dofs of the previus cpu, starting from 0.
 	 * First: get number of dofs for each cpu*/
Index: /issm/trunk-jpl/src/c/classes/Vertex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Vertex.cpp	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Vertex.cpp	(revision 23599)
@@ -138,20 +138,4 @@
 int        Vertex::Connectivity(void){return connectivity;}/*{{{*/
 /*}}}*/
-void       Vertex::DistributePids(int* ppidcount){/*{{{*/
-
-	/*retrieve current pid*/
-	int pidcount=*ppidcount;
-
-	/*This vertex is a clone! Don't distribute pids, it will get them from another cpu!*/
-	if(this->clone) return;
-
-	/*This vertex should distribute its pid*/
-	this->pid=pidcount;
-	pidcount++;
-
-	/*Assign output pointers: */
-	*ppidcount=pidcount;
-}
-/*}}}*/
 IssmDouble Vertex::GetLatitude(){/*{{{*/
 	return this->latitute;
@@ -178,55 +162,9 @@
 }
 /*}}}*/
-void       Vertex::OffsetPids(int pidcount){/*{{{*/
-
-	/*This vertex is a clone, don't offset the pids*/
-	if(this->clone) return;
-
-	/*This vertex should offset his pid, go ahead: */
-	this->pid+=pidcount;
-}
-/*}}}*/
 int        Vertex::Pid(void){ return pid; }/*{{{*/
 /*}}}*/
 int        Vertex::Lid(void){ return lid; }/*{{{*/
 /*}}}*/
-void       Vertex::SetClone(int* minranks){/*{{{*/
-
-	int my_rank;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	if (minranks[this->sid]==my_rank){
-		this->clone=false;
-	}
-	else{
-		/*!there is a cpu with lower rank that has the same vertex, 
-		therefore, I am a clone*/
-		this->clone=true;
-	}
-
-}
-/*}}}*/
-void       Vertex::ShowTruePids(int* truepids){/*{{{*/
-
-	/*Are we a clone? : */
-	if(this->clone)return;
-
-	/*Ok, we are not a clone, just plug our pid into truepids: */
-	truepids[this->sid]=this->pid;
-}
-/*}}}*/
 int        Vertex::Sid(void){ return sid; }/*{{{*/
-/*}}}*/
-void       Vertex::UpdateClonePids(int* alltruepids){/*{{{*/
-
-	/*If we are not a clone, don't update, we already have pids: */
-	if(!this->clone)return;
-
-	/*Ok, we are a clone node, but we did not create the pid for this vertex 
-	 * Therefore, our pid is garbage right now. Go pick it up in the alltruepids: */
-	this->pid=alltruepids[this->sid];
-}
 /*}}}*/
 void       Vertex::UpdatePosition(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* surface,IssmDouble* bed){/*{{{*/
Index: /issm/trunk-jpl/src/c/classes/Vertex.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Vertex.h	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Vertex.h	(revision 23599)
@@ -51,5 +51,4 @@
 		/*Vertex management:*/ 
 		int        Connectivity(void); 
-		void       DistributePids(int* ppidcount);
 		IssmDouble GetLatitude(void); 
 		IssmDouble GetLongitude(void); 
@@ -58,11 +57,7 @@
 		IssmDouble GetY(void); 
 		IssmDouble GetZ(void); 
-		void       OffsetPids(int pidcount);
 		int        Pid(void); 
 		int        Lid(void); 
-		void       SetClone(int* minranks);
-		void       ShowTruePids(int* borderpids);
 		int        Sid(void); 
-		void       UpdateClonePids(int* allborderpids);
 		void       UpdatePosition(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
 		void       VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,bool spherical=false);
Index: /issm/trunk-jpl/src/c/classes/Vertices.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Vertices.cpp	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Vertices.cpp	(revision 23599)
@@ -127,68 +127,4 @@
 }
 /*}}}*/
-void  Vertices::DistributePids(int numberofobjects){/*{{{*/
-
-	int num_procs;
-	int my_rank;
-
-	int  i;
-	int  pidcount    = 0;
-	int *allpidcount = NULL;
-	int *truepids    = NULL;
-	int *alltruepids = NULL;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-	num_procs=IssmComm::GetSize();
-
-	/*Go through objects, and distribute pids locally, from 0 to numberofpidsperobject*/
-	for (i=0;i<this->Size();i++){
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		vertex->DistributePids(&pidcount);
-	}
-
-	/* Now every object has distributed pids, but locally, and with a pid count starting from 
-	 * 0. This means the pids between all the cpus are not unique. We now offset the pids of each
-	 * cpus by the total last pids of the previus cpu, starting from 0.
-	 * First: get number of pids for each cpu*/
-	allpidcount=xNew<int>(num_procs);
-	ISSM_MPI_Gather(&pidcount,1,ISSM_MPI_INT,allpidcount,1,ISSM_MPI_INT,0,IssmComm::GetComm());
-	ISSM_MPI_Bcast(allpidcount,num_procs,ISSM_MPI_INT,0,IssmComm::GetComm());
-
-	/* Every cpu should start its own pid count at the end of the pidcount from cpu-1*/
-	pidcount=0;
-	if(my_rank!=0){
-		for(i=0;i<my_rank;i++){
-			pidcount+=allpidcount[i];
-		}
-	}
-	for (i=0;i<this->Size();i++){
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		vertex->OffsetPids(pidcount);
-	}
-
-	/* Finally, remember that cpus may have skipped some objects, because they were clones. For every 
-	 * object that is not a clone, tell them to show their pids, so that later on, they can get picked 
-	 * up by their clones: */
-	truepids   =xNewZeroInit<int>(numberofobjects);
-	alltruepids=xNewZeroInit<int>(numberofobjects);
-	for (i=0;i<this->Size();i++){
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		vertex->ShowTruePids(truepids);
-	}
-	ISSM_MPI_Allreduce((void*)truepids,(void*)alltruepids,numberofobjects,ISSM_MPI_INT,ISSM_MPI_MAX,IssmComm::GetComm());
-
-	/* Now every cpu knows the true pids of everyone else that is not a clone*/
-	for(i=0;i<this->Size();i++){
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		vertex->UpdateClonePids(alltruepids);
-	}
-
-	/* Free ressources: */
-	xDelete<int>(allpidcount);
-	xDelete<int>(truepids);
-	xDelete<int>(alltruepids);
-}
-/*}}}*/
 int Vertices::NumberOfVertices(void){/*{{{*/
 
@@ -197,5 +133,5 @@
 	int vertex_max_sid;
 
-	if (this->Size()==0)return 0;
+	if(this->Size()==0) return 0;
 
 	for(i=0;i<this->Size();i++){
Index: /issm/trunk-jpl/src/c/classes/Vertices.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Vertices.h	(revision 23598)
+++ /issm/trunk-jpl/src/c/classes/Vertices.h	(revision 23599)
@@ -29,5 +29,4 @@
 
 		/*numerics:*/
-		void  DistributePids(int numberofnodes);
 		int   NumberOfVertices(void);
 		void  LatLonList(IssmDouble** lat,IssmDouble** lon);
