Changeset 23586


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

Location:
issm/trunk-jpl/src/c
Files:
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/c/Makefile.am

    r23551 r23586  
    208208                                        ./modules/NodesDofx/NodesDofx.cpp\
    209209                                        ./modules/NodalValuex/NodalValuex.cpp\
    210                                         ./modules/VerticesDofx/VerticesDofx.cpp\
    211210                                        ./modules/VertexCoordinatesx/VertexCoordinatesx.cpp\
    212211                                        ./modules/OutputResultsx/OutputResultsx.cpp\
  • TabularUnified issm/trunk-jpl/src/c/classes/FemModel.cpp

    r23585 r23586  
    2525/*module includes: {{{*/
    2626#include "../modules/ModelProcessorx/ModelProcessorx.h"
    27 #include "../modules/VerticesDofx/VerticesDofx.h"
    2827#include "../modules/SpcNodesx/SpcNodesx.h"
    2928#include "../modules/ConfigureObjectsx/ConfigureObjectsx.h"
     
    353352                analysis_type=output->analysis_type_list[i];
    354353                output->SetCurrentConfiguration(analysis_type);
    355                 //if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices
    356354                SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters,analysis_type);
    357355                NodesDofx(output->nodes_list[i],output->parameters,analysis_type);
     
    442440
    443441                if(i==0){
    444                 //      if(VerboseMProcessor()) _printf0_("      creating vertex PIDs\n");
    445                 //      VerticesDofx(vertices,parameters);
    446 
    447442                        if(VerboseMProcessor()) _printf0_("      detecting active vertices\n");
    448443                        GetMaskOfIceVerticesLSMx0(this);
     
    530525                        analysis_type=this->analysis_type_list[i];
    531526                        SetCurrentConfiguration(analysis_type);
    532                         //if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices
    533527                        SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters,analysis_type);
    534528                        NodesDofx(this->nodes_list[i],this->parameters,analysis_type);
     
    27312725
    27322726                ConfigureObjectsx(new_elements,this->loads,new_nodes_list[i],new_vertices,new_materials,this->parameters);
    2733                 if(i==0){
    2734                         VerticesDofx(new_vertices,this->parameters); //only call once, we only have one set of vertices
    2735                 }
    27362727                SpcNodesx(new_nodes_list[i],new_constraints_list[i],this->parameters,analysis_type);
    2737                 new_nodes_list[i]->FlagClones(analysis_type);/*FIXME: should be removed !*/
    27382728                NodesDofx(new_nodes_list[i],this->parameters,analysis_type);
    27392729        }
  • TabularUnified 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
  • TabularUnified issm/trunk-jpl/src/c/classes/Nodes.h

    r23574 r23586  
    3434                /*numerics*/
    3535                void  DistributeDofs(int analysis_type,int SETENUM);
    36                 void  FlagClones(int analysis_type);
    3736                int   MaximumId(void);
    3837                int   MaxNumDofs(int analysis_type,int setenum);
  • TabularUnified issm/trunk-jpl/src/c/classes/Vertices.cpp

    r23572 r23586  
    191191}
    192192/*}}}*/
    193 void  Vertices::FlagClones(int numberofobjects){/*{{{*/
    194 
    195         /*Some checks in debug mode*/
    196         if(numberofobjects==0) return;
    197         _assert_(numberofobjects>0);
    198 
    199         /*recover num_procs and rank*/
    200         int num_procs = IssmComm::GetSize();
    201         int my_rank   = IssmComm::GetRank();
    202 
    203         /*Allocate ranks: */
    204         int *ranks    = xNew<int>(numberofobjects);
    205         for(int i=0;i<numberofobjects;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.
    206 
    207         /*Go through a dataset, and for each object, report it cpu: */
    208         for(int i=0;i<this->Size();i++){
    209                 Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
    210                 ranks[vertex->Sid()]=my_rank;
    211         }
    212 
    213         /*We need to take the minimum rank for each vertex, and every cpu needs to get that result. That way,
    214          * when we start building the dof list for all vertexs, a cpu can check whether its vertex already has been
    215          * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing
    216          * order of cpu rank. This is also why we initialized this array to num_procs.*/
    217         int *minranks = xNew<int>(numberofobjects);
    218         ISSM_MPI_Allreduce((void*)ranks,(void*)minranks,numberofobjects,ISSM_MPI_INT,ISSM_MPI_MIN,IssmComm::GetComm());
    219         xDelete<int>(ranks);
    220 
    221         /*Now go through all objects, and use minranks to flag which objects are cloned: */
    222         for(int i=0;i<this->Size();i++){
    223                 /*For this object, decide whether it is a clone: */
    224                 Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
    225                 vertex->SetClone(minranks);
    226         }
    227 
    228         /*Free ressources: */
    229         xDelete<int>(minranks);
    230 }/*}}}*/
    231193int Vertices::NumberOfVertices(void){/*{{{*/
    232194
  • TabularUnified issm/trunk-jpl/src/c/classes/Vertices.h

    r23521 r23586  
    3030                /*numerics:*/
    3131                void  DistributePids(int numberofnodes);
    32                 void  FlagClones(int numberofnodes);
    3332                int   NumberOfVertices(void);
    3433                void  LatLonList(IssmDouble** lat,IssmDouble** lon);
  • TabularUnified issm/trunk-jpl/src/c/modules/NodesDofx/NodesDofx.cpp

    r23576 r23586  
    1818        if(VerboseModule()) _printf0_("   Renumbering degrees of freedom\n");
    1919
    20         /*Ensure that only for each cpu, the partition border nodes only will be taken into account once
    21          * across the cluster. To do so, we flag all the clone nodes: */
    22         //nodes->FlagClones(configuration_type); /*Not needed anymore!*/
    23 
    2420        /*Go through all nodes, and build degree of freedom lists. Each node gets a fixed number of dofs. When
    2521         *a  node has already been distributed dofs on one cpu, all other cpus with the same node cannot distribute it
  • TabularUnified issm/trunk-jpl/src/c/modules/modules.h

    r22625 r23586  
    9898#include "./ThicknessAcrossGradientx/ThicknessAcrossGradientx.h"
    9999#include "./UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h"
    100 #include "./VerticesDofx/VerticesDofx.h"
    101100#include "./VertexCoordinatesx/VertexCoordinatesx.h"
    102101#include "./VecMergex/VecMergex.h"
Note: See TracChangeset for help on using the changeset viewer.