Changeset 16137 for issm/trunk/src/c/classes/Patch.cpp
- Timestamp:
- 09/16/13 09:43:55 (12 years ago)
- Location:
- issm/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:ignore
-
old new 1 nightlylog 2 configure.sh 1 3 par 2 4 ad
-
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 15397-15401,15403-15487,15489-15701,15704-15735,15737-16076,16082-16133
- Property svn:ignore
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/c
- Property svn:ignore
-
old new 14 14 probe.results 15 15 stXXXX* 16 16 .deps 17 .dirstamp
-
- Property svn:ignore
-
issm/trunk/src/c/classes
-
Property svn:ignore
set to
.deps
.dirstamp
-
Property svn:ignore
set to
-
issm/trunk/src/c/classes/Patch.cpp
r15396 r16137 111 111 int node_numrows; 112 112 IssmDouble *total_values = NULL; 113 #ifdef _HAVE_MPI_ 114 MPI_Status status; 115 #endif 113 ISSM_MPI_Status status; 116 114 117 115 /*recover my_rank:*/ … … 120 118 121 119 /*First, figure out total number of rows combining all the cpus: */ 122 #ifdef _HAVE_MPI_ 123 MPI_Reduce(&this->numrows,&total_numrows,1,MPI_INT,MPI_SUM,0,IssmComm::GetComm() ); 124 MPI_Bcast(&total_numrows,1,MPI_INT,0,IssmComm::GetComm()); 125 #else 126 total_numrows=this->numrows; 127 #endif 120 ISSM_MPI_Reduce(&this->numrows,&total_numrows,1,ISSM_MPI_INT,ISSM_MPI_SUM,0,IssmComm::GetComm() ); 121 ISSM_MPI_Bcast(&total_numrows,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 128 122 129 123 /*return if patch empty*/ … … 141 135 142 136 /*Now, ask other nodes to send their values: */ 143 #ifdef _HAVE_MPI_144 137 for(int i=1;i<num_procs;i++){ 145 138 if (my_rank==i){ 146 MPI_Send(&this->numrows,1,MPI_INT,0,1,IssmComm::GetComm());147 if (this->numrows) MPI_Send(this->values,this->numrows*this->numcols,MPI_DOUBLE,0,1,IssmComm::GetComm());139 ISSM_MPI_Send(&this->numrows,1,ISSM_MPI_INT,0,1,IssmComm::GetComm()); 140 if (this->numrows)ISSM_MPI_Send(this->values,this->numrows*this->numcols,ISSM_MPI_DOUBLE,0,1,IssmComm::GetComm()); 148 141 } 149 142 if (my_rank==0){ 150 MPI_Recv(&node_numrows,1,MPI_INT,i,1,IssmComm::GetComm(),&status);151 if (node_numrows) MPI_Recv(total_values+count,node_numrows*this->numcols,MPI_DOUBLE,i,1,IssmComm::GetComm(),&status);143 ISSM_MPI_Recv(&node_numrows,1,ISSM_MPI_INT,i,1,IssmComm::GetComm(),&status); 144 if (node_numrows)ISSM_MPI_Recv(total_values+count,node_numrows*this->numcols,ISSM_MPI_DOUBLE,i,1,IssmComm::GetComm(),&status); 152 145 count+=node_numrows*this->numcols; 153 146 } 154 147 } 155 #endif156 148 157 149 /*Now, node 0 has total_values, of size total_numrows*this->numcols. Update the fields in the patch, to reflect this new … … 162 154 this->values=total_values; 163 155 } 164 #ifdef _HAVE_MPI_165 156 else{ 166 157 this->numrows=0; 167 158 xDelete<IssmDouble>(this->values); 168 159 } 169 #endif170 160 }/*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.