Changeset 13592


Ignore:
Timestamp:
10/10/12 21:03:38 (13 years ago)
Author:
Eric.Larour
Message:

CHG: starting transition from extern int my_rank to my_rank2 where my_rank2 is
recovered with IssmComm:GetRank()

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  
    2121
    2222        int        i,j,k;
    23         extern int my_rank;
     23        int        my_rank2;
    2424        bool       process_units = true;
    2525
     
    3636        /*retrieve npart: */
    3737        parameters->FindParam(&npart,QmuNumberofpartitionsEnum);
     38        my_rank2=IssmComm::GetRank();
    3839
    3940        /*save the d_responses pointer: */
     
    5657
    5758                        /*Copy onto our dakota responses: */
    58                         if(my_rank==0){
     59                        if(my_rank2==0){
    5960                                /*plug response: */
    6061                                for(i=0;i<npart;i++)responses_pointer[i]=qmu_response[i];
     
    7778                        Responsex(&femmodel_response,elements,nodes, vertices,loads,materials, parameters,root,process_units,0);//0 is the index for weights
    7879                       
    79                         if(my_rank==0){
     80                        if(my_rank2==0){
    8081                                /*plug response: */
    8182                                responses_pointer[0]=femmodel_response;
     
    9697                        Responsex(&femmodel_response,elements,nodes, vertices,loads,materials, parameters,root,process_units,0);//0 is the weight index
    9798
    98                         if(my_rank==0){
     99                        if(my_rank2==0){
    99100                                /*plug response: */
    100101                                responses_pointer[0]=femmodel_response;
     
    109110
    110111        /*Synthesize echo: {{{*/
    111         if(my_rank==0){
     112        if(my_rank2==0){
    112113                _printString_("   responses: " << d_numresponses << ": ");
    113114                for(i=0;i<d_numresponses-1;i++)_printString_(d_responses[i] << "|");
  • issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp

    r13590 r13592  
    1313       
    1414
    15         extern int my_rank;
     15        int my_rank2;
    1616        int i;
    1717
     
    2525        /*retrieve element we are interested in: */
    2626        parameters->FindParam(&index,IndexEnum);
     27        my_rank2=IssmComm::GetRank();
    2728
    2829        /*now, go through our elements, and retrieve the one with this id: index: */
     
    3132                if (element->Id()==index){
    3233                        found=1;
    33                         cpu_found=my_rank;
     34                        cpu_found=my_rank2;
    3435                        break;
    3536                }
     
    4344
    4445        /*Ok, we found the element, compute responseocity: */
    45         if(my_rank==cpu_found){
     46        if(my_rank2==cpu_found){
    4647                element->ElementResponse(&response,response_enum,IuToExtEnum);
    4748        }
  • issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp

    r13590 r13592  
    1515
    1616        extern int num_procs;
    17         extern int my_rank;
     17        int my_rank2;
    1818
    1919        /*output*/
     
    2727        Variogram    *variogram    = NULL;
    2828        Observations *observations = NULL;
     29
     30        /*Get my_rank2: */
     31        my_rank2=IssmComm::GetRank();
    2932
    3033        /*Get some Options*/
     
    5558
    5659                /*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){
    5861                        _pprintLine_("      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
    5962                        observations->InterpolationKriging(&predictions[idx],&error[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,variogram);
     
    7376
    7477                /*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){
    7679                        _pprintLine_("      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
    7780                        observations->InterpolationNearestNeighbor(&predictions[idx],x_interp[idx],y_interp[idx],radius);
     
    9093
    9194                /*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){
    9396                        _pprintLine_("      interpolation progress: "<<setw(6)<<setprecision(2)<<double(idx)/double(n_interp)*100<<"%");
    9497                        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  
    2222        int i;
    2323
    24         extern int my_rank;
     24        int my_rank2;
    2525        extern int num_procs;
    2626        int    numberofelements;
     
    4646        IssmDouble* riftinfo=NULL;
    4747        IssmDouble* vertex_pairing=NULL;
     48
     49        /*Get my_rank2:*/
     50        my_rank2=IssmComm::GetRank();
    4851
    4952        /*Fetch parameters: */
     
    99102
    100103                /*!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]){
    102105
    103106                        my_elements[i]=true;
  • issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp

    r13590 r13592  
    1212void NodalValuex( IssmDouble* pnodalvalue, int natureofdataenum,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units){
    1313
    14         extern int my_rank;
     14        int my_rank2;
    1515        int i;
    1616        int index;
     
    2020        int sumfound;
    2121        int cpu_found;
     22
     23        /*Get my_rank2:*/
     24        my_rank2=IssmComm::GetRank();
    2225
    2326        /*retrieve element we are interested in: */
     
    3033                found=element->NodalValue(&value,index,natureofdataenum,process_units);
    3134                if (found){
    32                         cpu_found=my_rank;
     35                        cpu_found=my_rank2;
    3336                        break;
    3437                }
  • issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp

    r13590 r13592  
    2323
    2424        char line [1000];
    25         extern int my_rank;
     25        int my_rank2;
    2626        int i;
    2727
     
    3535        int   stringlength;
    3636
    37         if(my_rank==0){
     37        /*Get my_rank2:*/
     38        my_rank2=IssmComm::GetRank();
     39
     40        if(my_rank2==0){
    3841
    3942                /*Now, go through lines and figure out how many analyses we have: */
     
    97100        #ifdef _HAVE_MPI_
    98101        MPI_Bcast(&numanalyses,1,MPI_INT,0,IssmComm::GetComm());
    99         if(my_rank!=0){
     102        if(my_rank2!=0){
    100103                analyses=xNew<IssmPDouble>(numanalyses);
    101104                strings=xNew<char*>(numanalyses);
     
    105108        for(i=0;i<numanalyses;i++){
    106109                char* string=strings[i];
    107                 if(my_rank==0){
     110                if(my_rank2==0){
    108111                        if(string==NULL) _error_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
    109112                }
    110                 if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
     113                if(my_rank2==0)stringlength=(strlen(string)+1)*sizeof(char);
    111114                #ifdef _HAVE_MPI_
    112115                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);
    114117                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;
    116119                #endif
    117120        }
Note: See TracChangeset for help on using the changeset viewer.