Index: /issm/trunk-jpl/NEWS
===================================================================
--- /issm/trunk-jpl/NEWS	(revision 11524)
+++ /issm/trunk-jpl/NEWS	(revision 11525)
@@ -1,3 +1,2 @@
-
 please go to the ISSM website for the latest news:
 
Index: /issm/trunk-jpl/README
===================================================================
--- /issm/trunk-jpl/README	(revision 11524)
+++ /issm/trunk-jpl/README	(revision 11525)
@@ -9,13 +9,12 @@
 Jet Propulsion Laboratory
 
-Eric          Eric Larour (Project Manager)
-Mathieu       Mathieu Morlighem (Core Developer, Anisotropic Meshing, Control Methods)
-Helene        Helene Seroussi (Core Develper Coupling 2D-3D, Multi-model, full-Stokes)
-Nicole        Nicole Schlegel (Developer, Atmospheric Forcing)
-Chris         Christopher Borstad (Developer, Rifting/Faulting/Crack Propagation)
-Feras         Feras Habbal (Developer, Solver Technologies)
-Daria         Daria Halkides (Analyst, Atmospheric Forcing)
-Ala           Ala Khazendar (Analyst, Ice Sheet Processes)
-
+Eric    Larour (Project Manager)
+Mathieu Morlighem (Core Developer, Anisotropic Meshing, Control Methods)
+Helene  Seroussi (Core Develper Coupling 2D-3D, Multi-model, full-Stokes)
+Nicole  Schlegel (Developer, Atmospheric Forcing)
+Chris   Borstad (Developer, Rifting/Faulting/Crack Propagation)
+Feras   Habbal (Developer, Solver Technologies)
+Daria   Halkides (Analyst, Atmospheric Forcing)
+Ala     Khazendar (Analyst, Ice Sheet Processes)
 
 Email: issm@jpl.nasa.gov
@@ -39,14 +38,14 @@
 modification, are permitted provided that the following conditions are met:
 
-    1. Redistributions of source code must retain the above copyright notice,
-       this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-       notice, this list of conditions and the following disclaimer in the
-       documentation and/or other materials provided with the distribution.
-    3. Neither the name of the California Institute of Technology (Caltech),
-       its operating division the Jet Propulsion Laboratory (JPL), the National
-       Aeronautics and Space Administration (NASA), nor the names of its
-       contributors may be used to endorse or promote products derived from
-       this software without specific prior written permission.
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the California Institute of Technology (Caltech),
+   its operating division the Jet Propulsion Laboratory (JPL), the National
+   Aeronautics and Space Administration (NASA), nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -61,3 +60,2 @@
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ------------------------------------------------------------------------------
-
Index: /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh	(revision 11524)
+++ /issm/trunk-jpl/externalpackages/mpich2/install-1.4-macosx32.sh	(revision 11525)
@@ -14,8 +14,8 @@
 #Configure mpich2
 cd src
-export CFLAGS=" -arch i386"
+export FFLAGS=" -m32"
+export CFLAGS=" -m32"
 export CXXFLAGS=" -arch i386"
 export CPPFLAGS=" -arch i386"
-export FFLAGS=" -arch i386"
 ./configure \
 	--prefix="$ISSM_TIER/externalpackages/mpich2/install" \
@@ -23,5 +23,5 @@
 	--enable-sharedlibs=osx-gcc \
 	--enable-shared \
-	--enable-fc="/usr/local/bin/gfortran"
+	--enable-fc
 
 #Compile mpich2
Index: /issm/trunk-jpl/src/c/Container/Elements.cpp
===================================================================
--- /issm/trunk-jpl/src/c/Container/Elements.cpp	(revision 11524)
+++ /issm/trunk-jpl/src/c/Container/Elements.cpp	(revision 11525)
@@ -180,4 +180,6 @@
 	int    numberofvertices,numberofelements;
 	int    numberofresults,vectorsize;
+	int    rank;
+	int    minrank;
 
 	/*Recover parameters: */
@@ -190,14 +192,20 @@
 		/*No patch here, we prepare vectors*/
 
+		/*Get rank of first cpu that has results*/
+		if(this->Size()) rank=my_rank;
+		else rank=num_procs;
+		MPI_Allreduce (&rank,&minrank,1,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
+
 		/*see what the first element of this partition has in stock (this is common to all partitions)*/
-		if(my_rank==0){
-			if(this->Size()==0) _error_("Cannot write results because first partition has no element. Maybe too many cpus were requested");
+		if(my_rank==minrank){
+			if(this->Size()==0) _error_("Cannot write results because there is no element??");
 			Element* element=(Element*)this->GetObjectByOffset(0);
 			element->ListResultsInfo(&resultsenums,&resultssizes,&resultstimes,&resultssteps,&numberofresults);
 		}
-		MPI_Bcast(&numberofresults,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
+		MPI_Bcast(&numberofresults,1,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
+
 		/*Get out if there is no results. Otherwise broadcast info*/
 		if(!numberofresults) return;
-		if(my_rank!=0){
+		if(my_rank!=minrank){
 			resultsenums=(int*)xmalloc(numberofresults*sizeof(int));
 			resultssizes=(int*)xmalloc(numberofresults*sizeof(int));
@@ -205,8 +213,8 @@
 			resultssteps=(int*)xmalloc(numberofresults*sizeof(int));
 		}
-		MPI_Bcast(resultsenums,numberofresults,MPI_INT,0,MPI_COMM_WORLD);
-		MPI_Bcast(resultssizes,numberofresults,MPI_INT,0,MPI_COMM_WORLD);
-		MPI_Bcast(resultstimes,numberofresults,MPI_DOUBLE,0,MPI_COMM_WORLD);
-		MPI_Bcast(resultssteps,numberofresults,MPI_INT,0,MPI_COMM_WORLD);
+		MPI_Bcast(resultsenums,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
+		MPI_Bcast(resultssizes,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
+		MPI_Bcast(resultstimes,numberofresults,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
+		MPI_Bcast(resultssteps,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
 
 		/*Loop over all results and get nodal vector*/
Index: /issm/trunk-jpl/src/m/classes/inversion.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/inversion.m	(revision 11524)
+++ /issm/trunk-jpl/src/m/classes/inversion.m	(revision 11525)
@@ -116,5 +116,5 @@
 			fielddisplay(obj,'control_parameters','parameter where inverse control is carried out; ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
 			fielddisplay(obj,'nsteps','number of optimization searches');
-			fielddisplay(obj,'cost_functions','indicate the type of response for each optimization steps');
+			fielddisplay(obj,'cost_functions','indicate the type of response for each optimization step');
 			fielddisplay(obj,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
 			fielddisplay(obj,'cost_function_threshold','misfit convergence criterion. Default is 1%, NaN if not applied');
Index: /issm/trunk-jpl/src/m/utils/OS/issmscpin.m
===================================================================
--- /issm/trunk-jpl/src/m/utils/OS/issmscpin.m	(revision 11524)
+++ /issm/trunk-jpl/src/m/utils/OS/issmscpin.m	(revision 11525)
@@ -52,9 +52,13 @@
 		%just use standard unix scp
 		%string to copy multiple files using scp: 
-		string='\{';
-		for i=1:numel(packages)-1,
-			string=[string packages{i} ','];
+		if numel(packages)==1,
+			string=packages{1};
+		else
+			string='\{';
+			for i=1:numel(packages)-1,
+				string=[string packages{i} ','];
+			end
+			string=[string packages{end} '\}'];
 		end
-		string=[string packages{end} '\}'];
 
 
