Changeset 13592
- Timestamp:
- 10/10/12 21:03:38 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/modules
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
r13056 r13592 21 21 22 22 int i,j,k; 23 extern int my_rank;23 int my_rank2; 24 24 bool process_units = true; 25 25 … … 36 36 /*retrieve npart: */ 37 37 parameters->FindParam(&npart,QmuNumberofpartitionsEnum); 38 my_rank2=IssmComm::GetRank(); 38 39 39 40 /*save the d_responses pointer: */ … … 56 57 57 58 /*Copy onto our dakota responses: */ 58 if(my_rank ==0){59 if(my_rank2==0){ 59 60 /*plug response: */ 60 61 for(i=0;i<npart;i++)responses_pointer[i]=qmu_response[i]; … … 77 78 Responsex(&femmodel_response,elements,nodes, vertices,loads,materials, parameters,root,process_units,0);//0 is the index for weights 78 79 79 if(my_rank ==0){80 if(my_rank2==0){ 80 81 /*plug response: */ 81 82 responses_pointer[0]=femmodel_response; … … 96 97 Responsex(&femmodel_response,elements,nodes, vertices,loads,materials, parameters,root,process_units,0);//0 is the weight index 97 98 98 if(my_rank ==0){99 if(my_rank2==0){ 99 100 /*plug response: */ 100 101 responses_pointer[0]=femmodel_response; … … 109 110 110 111 /*Synthesize echo: {{{*/ 111 if(my_rank ==0){112 if(my_rank2==0){ 112 113 _printString_(" responses: " << d_numresponses << ": "); 113 114 for(i=0;i<d_numresponses-1;i++)_printString_(d_responses[i] << "|"); -
issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp
r13590 r13592 13 13 14 14 15 extern int my_rank;15 int my_rank2; 16 16 int i; 17 17 … … 25 25 /*retrieve element we are interested in: */ 26 26 parameters->FindParam(&index,IndexEnum); 27 my_rank2=IssmComm::GetRank(); 27 28 28 29 /*now, go through our elements, and retrieve the one with this id: index: */ … … 31 32 if (element->Id()==index){ 32 33 found=1; 33 cpu_found=my_rank ;34 cpu_found=my_rank2; 34 35 break; 35 36 } … … 43 44 44 45 /*Ok, we found the element, compute responseocity: */ 45 if(my_rank ==cpu_found){46 if(my_rank2==cpu_found){ 46 47 element->ElementResponse(&response,response_enum,IuToExtEnum); 47 48 } -
issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
r13590 r13592 15 15 16 16 extern int num_procs; 17 extern int my_rank;17 int my_rank2; 18 18 19 19 /*output*/ … … 27 27 Variogram *variogram = NULL; 28 28 Observations *observations = NULL; 29 30 /*Get my_rank2: */ 31 my_rank2=IssmComm::GetRank(); 29 32 30 33 /*Get some Options*/ … … 55 58 56 59 /*partition loop across threads: */ 57 for(int idx=my_rank ;idx<n_interp;idx+=num_procs){60 for(int idx=my_rank2;idx<n_interp;idx+=num_procs){ 58 61 _pprintLine_(" interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%"); 59 62 observations->InterpolationKriging(&predictions[idx],&error[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,variogram); … … 73 76 74 77 /*partition loop across threads: */ 75 for(int idx=my_rank ;idx<n_interp;idx+=num_procs){78 for(int idx=my_rank2;idx<n_interp;idx+=num_procs){ 76 79 _pprintLine_(" interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%"); 77 80 observations->InterpolationNearestNeighbor(&predictions[idx],x_interp[idx],y_interp[idx],radius); … … 90 93 91 94 /*partition loop across threads: */ 92 for(int idx=my_rank ;idx<n_interp;idx+=num_procs){95 for(int idx=my_rank2;idx<n_interp;idx+=num_procs){ 93 96 _pprintLine_(" interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%"); 94 97 observations->InterpolationIDW(&predictions[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,power); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
r13283 r13592 22 22 int i; 23 23 24 extern int my_rank;24 int my_rank2; 25 25 extern int num_procs; 26 26 int numberofelements; … … 46 46 IssmDouble* riftinfo=NULL; 47 47 IssmDouble* vertex_pairing=NULL; 48 49 /*Get my_rank2:*/ 50 my_rank2=IssmComm::GetRank(); 48 51 49 52 /*Fetch parameters: */ … … 99 102 100 103 /*!All elements have been partitioned above, only deal with elements for this cpu: */ 101 if(my_rank ==epart[i]){104 if(my_rank2==epart[i]){ 102 105 103 106 my_elements[i]=true; -
issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp
r13590 r13592 12 12 void NodalValuex( IssmDouble* pnodalvalue, int natureofdataenum,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units){ 13 13 14 extern int my_rank;14 int my_rank2; 15 15 int i; 16 16 int index; … … 20 20 int sumfound; 21 21 int cpu_found; 22 23 /*Get my_rank2:*/ 24 my_rank2=IssmComm::GetRank(); 22 25 23 26 /*retrieve element we are interested in: */ … … 30 33 found=element->NodalValue(&value,index,natureofdataenum,process_units); 31 34 if (found){ 32 cpu_found=my_rank ;35 cpu_found=my_rank2; 33 36 break; 34 37 } -
issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
r13590 r13592 23 23 24 24 char line [1000]; 25 extern int my_rank;25 int my_rank2; 26 26 int i; 27 27 … … 35 35 int stringlength; 36 36 37 if(my_rank==0){ 37 /*Get my_rank2:*/ 38 my_rank2=IssmComm::GetRank(); 39 40 if(my_rank2==0){ 38 41 39 42 /*Now, go through lines and figure out how many analyses we have: */ … … 97 100 #ifdef _HAVE_MPI_ 98 101 MPI_Bcast(&numanalyses,1,MPI_INT,0,IssmComm::GetComm()); 99 if(my_rank !=0){102 if(my_rank2!=0){ 100 103 analyses=xNew<IssmPDouble>(numanalyses); 101 104 strings=xNew<char*>(numanalyses); … … 105 108 for(i=0;i<numanalyses;i++){ 106 109 char* string=strings[i]; 107 if(my_rank ==0){110 if(my_rank2==0){ 108 111 if(string==NULL) _error_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found"); 109 112 } 110 if(my_rank ==0)stringlength=(strlen(string)+1)*sizeof(char);113 if(my_rank2==0)stringlength=(strlen(string)+1)*sizeof(char); 111 114 #ifdef _HAVE_MPI_ 112 115 MPI_Bcast(&stringlength,1,MPI_INT,0,IssmComm::GetComm()); 113 if(my_rank !=0)string=xNew<char>(stringlength);116 if(my_rank2!=0)string=xNew<char>(stringlength); 114 117 MPI_Bcast(string,stringlength,MPI_CHAR,0,IssmComm::GetComm()); 115 if(my_rank !=0)strings[i]=string;118 if(my_rank2!=0)strings[i]=string; 116 119 #endif 117 120 }
Note:
See TracChangeset
for help on using the changeset viewer.