Changeset 13593
- Timestamp:
- 10/10/12 21:09:15 (13 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
r13592 r13593 14 14 int pKrigingx(double** ppredictions,double **perror,double* obs_x, double* obs_y, double* obs_list, int obs_length,double* x_interp,double* y_interp,int n_interp,Options* options){ 15 15 16 extern int num_procs;16 int num_procs2; 17 17 int my_rank2; 18 18 … … 30 30 /*Get my_rank2: */ 31 31 my_rank2=IssmComm::GetRank(); 32 num_procs2=IssmComm::GetSize(); 32 33 33 34 /*Get some Options*/ … … 58 59 59 60 /*partition loop across threads: */ 60 for(int idx=my_rank2;idx<n_interp;idx+=num_procs ){61 for(int idx=my_rank2;idx<n_interp;idx+=num_procs2){ 61 62 _pprintLine_(" interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%"); 62 63 observations->InterpolationKriging(&predictions[idx],&error[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,variogram); … … 76 77 77 78 /*partition loop across threads: */ 78 for(int idx=my_rank2;idx<n_interp;idx+=num_procs ){79 for(int idx=my_rank2;idx<n_interp;idx+=num_procs2){ 79 80 _pprintLine_(" interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%"); 80 81 observations->InterpolationNearestNeighbor(&predictions[idx],x_interp[idx],y_interp[idx],radius); … … 93 94 94 95 /*partition loop across threads: */ 95 for(int idx=my_rank2;idx<n_interp;idx+=num_procs ){96 for(int idx=my_rank2;idx<n_interp;idx+=num_procs2){ 96 97 _pprintLine_(" interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%"); 97 98 observations->InterpolationIDW(&predictions[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,power); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
r13592 r13593 23 23 24 24 int my_rank2; 25 extern int num_procs;25 int num_procs2; 26 26 int numberofelements; 27 27 int numberofvertices; … … 49 49 /*Get my_rank2:*/ 50 50 my_rank2=IssmComm::GetRank(); 51 num_procs2=IssmComm::GetSize(); 51 52 52 53 /*Fetch parameters: */ … … 76 77 } 77 78 78 MeshPartitionx(&epart, &npart,numberofelements,numberofvertices,elements, numberofelements2d,numberofvertices2d,elements2d,numlayers,elements_width, dim,num_procs );79 MeshPartitionx(&epart, &npart,numberofelements,numberofvertices,elements, numberofelements2d,numberofvertices2d,elements2d,numlayers,elements_width, dim,num_procs2); 79 80 80 81 /*Free elements and elements2d: */ -
issm/trunk-jpl/src/c/solutions/DakotaSpawnCore.cpp
r13591 r13593 45 45 46 46 int i; 47 extern int my_rank;48 47 49 48 char **responses_descriptors = NULL; //these are our! there are only numresponsedescriptors of them, not d_numresponses!!! … … 104 103 105 104 int i; 106 extern int my_rank;105 int my_rank2; 107 106 108 107 /*inputs and outputs: */ … … 116 115 int string_length; 117 116 117 /*recover my_rank2:*/ 118 my_rank2=IssmComm::GetRank(); 118 119 119 120 /*recover inputs from pointers: */ … … 127 128 128 129 /*variables:*/ 129 if(my_rank !=0)variables=xNew<double>(numvariables);130 if(my_rank2!=0)variables=xNew<double>(numvariables); 130 131 MPI_Bcast(variables,numvariables,MPI_DOUBLE,0,IssmComm::GetComm()); 131 132 132 133 /*variables_descriptors: */ 133 if(my_rank !=0){134 if(my_rank2!=0){ 134 135 variables_descriptors=xNew<char*>(numvariables); 135 136 } 136 137 for(i=0;i<numvariables;i++){ 137 if(my_rank ==0){138 if(my_rank2==0){ 138 139 string=variables_descriptors[i]; 139 140 string_length=(strlen(string)+1)*sizeof(char); 140 141 } 141 142 MPI_Bcast(&string_length,1,MPI_INT,0,IssmComm::GetComm()); 142 if(my_rank !=0)string=xNew<char>(string_length);143 if(my_rank2!=0)string=xNew<char>(string_length); 143 144 MPI_Bcast(string,string_length,MPI_CHAR,0,IssmComm::GetComm()); 144 if(my_rank !=0)variables_descriptors[i]=string;145 if(my_rank2!=0)variables_descriptors[i]=string; 145 146 } 146 147 … … 159 160 160 161 int i; 161 extern int my_rank;162 int my_rank2; 162 163 163 164 double *variables = NULL; … … 171 172 responses_descriptors=*presponses_descriptors; 172 173 174 /*recover my_rank2:*/ 175 my_rank2=IssmComm::GetRank(); 173 176 174 177 /*Free variables and variables_descriptors only on cpu !=0*/ 175 if(my_rank !=0){178 if(my_rank2!=0){ 176 179 xDelete<double>(variables); 177 180 for(i=0;i<numvariables;i++){
Note:
See TracChangeset
for help on using the changeset viewer.