Index: /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 13591)
+++ /issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 13592)
@@ -21,5 +21,5 @@
 
 	int        i,j,k;
-	extern int my_rank;
+	int        my_rank2;
 	bool       process_units = true;
 
@@ -36,4 +36,5 @@
 	/*retrieve npart: */
 	parameters->FindParam(&npart,QmuNumberofpartitionsEnum);
+	my_rank2=IssmComm::GetRank();
 
 	/*save the d_responses pointer: */
@@ -56,5 +57,5 @@
 
 			/*Copy onto our dakota responses: */
-			if(my_rank==0){
+			if(my_rank2==0){
 				/*plug response: */
 				for(i=0;i<npart;i++)responses_pointer[i]=qmu_response[i];
@@ -77,5 +78,5 @@
 			Responsex(&femmodel_response,elements,nodes, vertices,loads,materials, parameters,root,process_units,0);//0 is the index for weights
 			
-			if(my_rank==0){
+			if(my_rank2==0){
 				/*plug response: */
 				responses_pointer[0]=femmodel_response;
@@ -96,5 +97,5 @@
 			Responsex(&femmodel_response,elements,nodes, vertices,loads,materials, parameters,root,process_units,0);//0 is the weight index
 
-			if(my_rank==0){
+			if(my_rank2==0){
 				/*plug response: */
 				responses_pointer[0]=femmodel_response;
@@ -109,5 +110,5 @@
 
 	/*Synthesize echo: {{{*/
-	if(my_rank==0){
+	if(my_rank2==0){
 		_printString_("   responses: " << d_numresponses << ": ");
 		for(i=0;i<d_numresponses-1;i++)_printString_(d_responses[i] << "|");
Index: /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13591)
+++ /issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 13592)
@@ -13,5 +13,5 @@
 	
 
-	extern int my_rank;
+	int my_rank2;
 	int i;
 
@@ -25,4 +25,5 @@
 	/*retrieve element we are interested in: */
 	parameters->FindParam(&index,IndexEnum);
+	my_rank2=IssmComm::GetRank();
 
 	/*now, go through our elements, and retrieve the one with this id: index: */
@@ -31,5 +32,5 @@
 		if (element->Id()==index){
 			found=1;
-			cpu_found=my_rank;
+			cpu_found=my_rank2;
 			break;
 		}
@@ -43,5 +44,5 @@
 
 	/*Ok, we found the element, compute responseocity: */
-	if(my_rank==cpu_found){
+	if(my_rank2==cpu_found){
 		element->ElementResponse(&response,response_enum,IuToExtEnum);
 	}
Index: /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13591)
+++ /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 13592)
@@ -15,5 +15,5 @@
 
 	extern int num_procs;
-	extern int my_rank;
+	int my_rank2;
 
 	/*output*/
@@ -27,4 +27,7 @@
 	Variogram    *variogram    = NULL;
 	Observations *observations = NULL;
+
+	/*Get my_rank2: */
+	my_rank2=IssmComm::GetRank();
 
 	/*Get some Options*/
@@ -55,5 +58,5 @@
 
 		/*partition loop across threads: */
-		for(int idx=my_rank;idx<n_interp;idx+=num_procs){
+		for(int idx=my_rank2;idx<n_interp;idx+=num_procs){
 			_pprintLine_("      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
 			observations->InterpolationKriging(&predictions[idx],&error[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,variogram);
@@ -73,5 +76,5 @@
 
 		/*partition loop across threads: */
-		for(int idx=my_rank;idx<n_interp;idx+=num_procs){
+		for(int idx=my_rank2;idx<n_interp;idx+=num_procs){
 			_pprintLine_("      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
 			observations->InterpolationNearestNeighbor(&predictions[idx],x_interp[idx],y_interp[idx],radius);
@@ -90,5 +93,5 @@
 
 		/*partition loop across threads: */
-		for(int idx=my_rank;idx<n_interp;idx+=num_procs){
+		for(int idx=my_rank2;idx<n_interp;idx+=num_procs){
 			_pprintLine_("      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
 			observations->InterpolationIDW(&predictions[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,power);
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 13591)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 13592)
@@ -22,5 +22,5 @@
 	int i;
 
-	extern int my_rank;
+	int my_rank2;
 	extern int num_procs;
 	int    numberofelements;
@@ -46,4 +46,7 @@
 	IssmDouble* riftinfo=NULL;
 	IssmDouble* vertex_pairing=NULL;
+
+	/*Get my_rank2:*/
+	my_rank2=IssmComm::GetRank();
 
 	/*Fetch parameters: */
@@ -99,5 +102,5 @@
 
 		/*!All elements have been partitioned above, only deal with elements for this cpu: */
-		if(my_rank==epart[i]){ 
+		if(my_rank2==epart[i]){ 
 
 			my_elements[i]=true;
Index: /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 13591)
+++ /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 13592)
@@ -12,5 +12,5 @@
 void NodalValuex( IssmDouble* pnodalvalue, int natureofdataenum,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units){
 
-	extern int my_rank;
+	int my_rank2;
 	int i;
 	int index;
@@ -20,4 +20,7 @@
 	int sumfound;
 	int cpu_found;
+
+	/*Get my_rank2:*/
+	my_rank2=IssmComm::GetRank();
 
 	/*retrieve element we are interested in: */
@@ -30,5 +33,5 @@
 		found=element->NodalValue(&value,index,natureofdataenum,process_units);
 		if (found){
-			cpu_found=my_rank;
+			cpu_found=my_rank2;
 			break;
 		}
Index: /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 13591)
+++ /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 13592)
@@ -23,5 +23,5 @@
 
 	char line [1000];
-	extern int my_rank;
+	int my_rank2;
 	int i;
 
@@ -35,5 +35,8 @@
 	int   stringlength;
 
-	if(my_rank==0){
+	/*Get my_rank2:*/
+	my_rank2=IssmComm::GetRank();
+
+	if(my_rank2==0){
 
 		/*Now, go through lines and figure out how many analyses we have: */
@@ -97,5 +100,5 @@
  	#ifdef _HAVE_MPI_
 	MPI_Bcast(&numanalyses,1,MPI_INT,0,IssmComm::GetComm());
-	if(my_rank!=0){
+	if(my_rank2!=0){
 		analyses=xNew<IssmPDouble>(numanalyses);
 		strings=xNew<char*>(numanalyses);
@@ -105,13 +108,13 @@
 	for(i=0;i<numanalyses;i++){
 		char* string=strings[i];
-		if(my_rank==0){
+		if(my_rank2==0){
 			if(string==NULL) _error_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
 		}
-		if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
+		if(my_rank2==0)stringlength=(strlen(string)+1)*sizeof(char);
 		#ifdef _HAVE_MPI_
 		MPI_Bcast(&stringlength,1,MPI_INT,0,IssmComm::GetComm());
-		if(my_rank!=0)string=xNew<char>(stringlength);
+		if(my_rank2!=0)string=xNew<char>(stringlength);
 		MPI_Bcast(string,stringlength,MPI_CHAR,0,IssmComm::GetComm());
-		if(my_rank!=0)strings[i]=string;
+		if(my_rank2!=0)strings[i]=string;
 		#endif
 	}
