Changeset 13604


Ignore:
Timestamp:
10/10/12 23:06:05 (12 years ago)
Author:
Eric.Larour
Message:

CHG: more changes to switch from MPI_COMM_WORLD to IssmComm::GetComm()

Location:
issm/trunk-jpl/src/c/Container
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Container/Constraints.cpp

    r12365 r13604  
    4949        /*figure out total number of constraints combining all the cpus (no clones here)*/
    5050        #ifdef _HAVE_MPI_
    51                 MPI_Reduce(&localconstraints,&numberofconstraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    52                 MPI_Bcast(&numberofconstraints,1,MPI_INT,0,MPI_COMM_WORLD);
     51                MPI_Reduce(&localconstraints,&numberofconstraints,1,MPI_INT,MPI_SUM,0,IssmComm::GetComm() );
     52                MPI_Bcast(&numberofconstraints,1,MPI_INT,0,IssmComm::GetComm());
    5353        #else
    5454                numberofconstraints=localconstraints;
  • issm/trunk-jpl/src/c/Container/Elements.cpp

    r13594 r13604  
    126126        /*Synchronize across cluster, so as to not end up with different sizes for each patch on each cpu: */
    127127        #ifdef _HAVE_MPI_
    128         MPI_Reduce (&numvertices,&max_numvertices,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    129         MPI_Bcast(&max_numvertices,1,MPI_INT,0,MPI_COMM_WORLD);
     128        MPI_Reduce (&numvertices,&max_numvertices,1,MPI_INT,MPI_MAX,0,IssmComm::GetComm() );
     129        MPI_Bcast(&max_numvertices,1,MPI_INT,0,IssmComm::GetComm());
    130130        numvertices=max_numvertices;
    131131
    132         MPI_Reduce (&numnodes,&max_numnodes,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    133         MPI_Bcast(&max_numnodes,1,MPI_INT,0,MPI_COMM_WORLD);
     132        MPI_Reduce (&numnodes,&max_numnodes,1,MPI_INT,MPI_MAX,0,IssmComm::GetComm() );
     133        MPI_Bcast(&max_numnodes,1,MPI_INT,0,IssmComm::GetComm());
    134134        numnodes=max_numnodes;
    135135        #endif
     
    202202                if(this->Size()) rank=my_rank2;
    203203                else rank=num_procs2;
    204                 MPI_Allreduce (&rank,&minrank,1,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
     204                MPI_Allreduce (&rank,&minrank,1,MPI_INT,MPI_MIN,IssmComm::GetComm());
    205205                #else
    206206                minrank=my_rank2;
     
    214214                }
    215215                #ifdef _HAVE_MPI_
    216                 MPI_Bcast(&numberofresults,1,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
     216                MPI_Bcast(&numberofresults,1,MPI_DOUBLE,minrank,IssmComm::GetComm());
    217217                #endif
    218218
     
    226226                        resultssteps=xNew<int>(numberofresults);
    227227                }
    228                 MPI_Bcast(resultsenums,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
    229                 MPI_Bcast(resultssizes,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
    230                 MPI_Bcast(resultstimes,numberofresults,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
    231                 MPI_Bcast(resultssteps,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
     228                MPI_Bcast(resultsenums,numberofresults,MPI_INT,minrank,IssmComm::GetComm());
     229                MPI_Bcast(resultssizes,numberofresults,MPI_INT,minrank,IssmComm::GetComm());
     230                MPI_Bcast(resultstimes,numberofresults,MPI_DOUBLE,minrank,IssmComm::GetComm());
     231                MPI_Bcast(resultssteps,numberofresults,MPI_INT,minrank,IssmComm::GetComm());
    232232                #endif
    233233
     
    304304        local_nelem=this->Size();
    305305        #ifdef _HAVE_MPI_
    306         MPI_Allreduce ( (void*)&local_nelem,(void*)&numberofelements,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
     306        MPI_Allreduce ( (void*)&local_nelem,(void*)&numberofelements,1,MPI_INT,MPI_SUM,IssmComm::GetComm());
    307307        #else
    308308        numberofelements=local_nelem;
  • issm/trunk-jpl/src/c/Container/Loads.cpp

    r12365 r13604  
    6464        /*figure out total number of loads combining all the cpus (no clones here)*/
    6565        #ifdef _HAVE_MPI_
    66         MPI_Reduce(&localloads,&numberofloads,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    67         MPI_Bcast(&numberofloads,1,MPI_INT,0,MPI_COMM_WORLD);
     66        MPI_Reduce(&localloads,&numberofloads,1,MPI_INT,MPI_SUM,0,IssmComm::GetComm() );
     67        MPI_Bcast(&numberofloads,1,MPI_INT,0,IssmComm::GetComm());
    6868        #else
    6969        numberofloads=localloads;
  • issm/trunk-jpl/src/c/Container/Nodes.cpp

    r13594 r13604  
    9090        alldofcount=xNew<int>(num_procs2);
    9191        #ifdef _HAVE_MPI_
    92         MPI_Gather(&dofcount,1,MPI_INT,alldofcount,1,MPI_INT,0,MPI_COMM_WORLD);
    93         MPI_Bcast(alldofcount,num_procs2,MPI_INT,0,MPI_COMM_WORLD);
     92        MPI_Gather(&dofcount,1,MPI_INT,alldofcount,1,MPI_INT,0,IssmComm::GetComm());
     93        MPI_Bcast(alldofcount,num_procs2,MPI_INT,0,IssmComm::GetComm());
    9494        #else
    9595        alldofcount[0]=dofcount;
     
    129129
    130130        #ifdef _HAVE_MPI_
    131         MPI_Allreduce((void*)truedofs,(void*)alltruedofs,numnodes*maxdofspernode,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
     131        MPI_Allreduce((void*)truedofs,(void*)alltruedofs,numnodes*maxdofspernode,MPI_INT,MPI_MAX,IssmComm::GetComm());
    132132        #else
    133133        for(i=0;i<numnodes*maxdofspernode;i++)alltruedofs[i]=truedofs[i];
     
    174174         * order of cpu rank. This is also why we initialized this array to num_procs.*/
    175175        #ifdef _HAVE_MPI_
    176         MPI_Allreduce((void*)ranks,(void*)minranks,numnodes,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
     176        MPI_Allreduce((void*)ranks,(void*)minranks,numnodes,MPI_INT,MPI_MIN,IssmComm::GetComm());
    177177        #else
    178178        for(i=0;i<numnodes;i++)minranks[i]=ranks[i];
     
    221221        /*Grab max of all cpus: */
    222222        #ifdef _HAVE_MPI_
    223         MPI_Allreduce ( (void*)&max,(void*)&allmax,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
     223        MPI_Allreduce ( (void*)&max,(void*)&allmax,1,MPI_INT,MPI_MAX,IssmComm::GetComm());
    224224        max=allmax;
    225225        #endif
     
    255255        /*Gather from all cpus: */
    256256        #ifdef _HAVE_MPI_
    257         MPI_Allreduce ( (void*)&numdofs,(void*)&allnumdofs,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
     257        MPI_Allreduce ( (void*)&numdofs,(void*)&allnumdofs,1,MPI_INT,MPI_SUM,IssmComm::GetComm());
    258258        #else
    259259        allnumdofs=numdofs;
     
    282282        /*Gather from all cpus: */
    283283        #ifdef _HAVE_MPI_
    284         MPI_Allreduce ( (void*)&numnodes,(void*)&allnumnodes,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
     284        MPI_Allreduce ( (void*)&numnodes,(void*)&allnumnodes,1,MPI_INT,MPI_SUM,IssmComm::GetComm());
    285285        #else
    286286        allnumnodes=numnodes;
     
    312312
    313313        #ifdef _HAVE_MPI_
    314         MPI_Reduce (&max_sid,&node_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    315         MPI_Bcast(&node_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
     314        MPI_Reduce (&max_sid,&node_max_sid,1,MPI_INT,MPI_MAX,0,IssmComm::GetComm() );
     315        MPI_Bcast(&node_max_sid,1,MPI_INT,0,IssmComm::GetComm());
    316316        max_sid=node_max_sid;
    317317        #endif
  • issm/trunk-jpl/src/c/Container/Vertices.cpp

    r13594 r13604  
    6666        allpidcount=xNew<int>(num_procs2);
    6767        #ifdef _HAVE_MPI_
    68         MPI_Gather(&pidcount,1,MPI_INT,allpidcount,1,MPI_INT,0,MPI_COMM_WORLD);
    69         MPI_Bcast(allpidcount,num_procs2,MPI_INT,0,MPI_COMM_WORLD);
     68        MPI_Gather(&pidcount,1,MPI_INT,allpidcount,1,MPI_INT,0,IssmComm::GetComm());
     69        MPI_Bcast(allpidcount,num_procs2,MPI_INT,0,IssmComm::GetComm());
    7070        #else
    7171        allpidcount[0]=pidcount;
     
    9494        }
    9595        #ifdef _HAVE_MPI_
    96         MPI_Allreduce((void*)truepids,(void*)alltruepids,numberofobjects,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
     96        MPI_Allreduce((void*)truepids,(void*)alltruepids,numberofobjects,MPI_INT,MPI_MAX,IssmComm::GetComm());
    9797        #else
    9898        for(i=0;i<numberofobjects;i++)alltruepids[i]=truepids[i];
     
    137137         * order of cpu rank. This is also why we initialized this array to num_procs.*/
    138138        #ifdef _HAVE_MPI_
    139         MPI_Allreduce ( (void*)ranks,(void*)minranks,numberofobjects,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
     139        MPI_Allreduce ( (void*)ranks,(void*)minranks,numberofobjects,MPI_INT,MPI_MIN,IssmComm::GetComm());
    140140        #else
    141141        for(i=0;i<numberofobjects;i++)minranks[i]=ranks[i];
     
    169169
    170170        #ifdef _HAVE_MPI_
    171         MPI_Reduce (&max_sid,&vertex_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    172         MPI_Bcast(&vertex_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
     171        MPI_Reduce (&max_sid,&vertex_max_sid,1,MPI_INT,MPI_MAX,0,IssmComm::GetComm() );
     172        MPI_Bcast(&vertex_max_sid,1,MPI_INT,0,IssmComm::GetComm());
    173173        max_sid=vertex_max_sid;
    174174        #endif
Note: See TracChangeset for help on using the changeset viewer.