Ignore:
Timestamp:
01/02/19 19:56:44 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: remove Flag Clones method of vertices, now that this is done by the constructor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Nodes.cpp

    r23575 r23586  
    207207}
    208208/*}}}*/
    209 void  Nodes::FlagClones(int analysis_type){/*{{{*/
    210 
    211         int i;
    212         int num_procs;
    213         int numnodes;
    214 
    215         /*recover num_procs: */
    216         num_procs=IssmComm::GetSize();
    217 
    218         /*Figure out number of nodes for this analysis: */
    219         numnodes=this->NumberOfNodes(analysis_type);
    220 
    221         /*Allocate ranks: */
    222         int* ranks    = xNew<int>(numnodes);
    223         int* minranks = xNew<int>(numnodes);
    224         for(i=0;i<numnodes;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.
    225 
    226         /*Now go through all our objects and ask them to report to who they belong (which rank): */
    227         Ranks(ranks,analysis_type);
    228 
    229         /*We need to take the minimum rank for each vertex, and every cpu needs to get that result. That way,
    230          * when we start building the dof list for all vertexs, a cpu can check whether its vertex already has been
    231          * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing
    232          * order of cpu rank. This is also why we initialized this array to num_procs.*/
    233         ISSM_MPI_Allreduce((void*)ranks,(void*)minranks,numnodes,ISSM_MPI_INT,ISSM_MPI_MIN,IssmComm::GetComm());
    234 
    235         /*Now go through all objects, and use minranks to flag which objects are cloned: */
    236         for(i=0;i<this->Size();i++){
    237 
    238                 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
    239                 _assert_(node->InAnalysis(analysis_type));
    240 
    241                 /*For this object, decide whether it is a clone: */
    242                 node->SetClone(minranks);
    243         }
    244 
    245         /*Free ressources: */
    246         xDelete<int>(ranks);
    247         xDelete<int>(minranks);
    248 
    249 }
    250 /*}}}*/
    251209int   Nodes::MaximumId(){/*{{{*/
    252210
Note: See TracChangeset for help on using the changeset viewer.