Changeset 23522


Ignore:
Timestamp:
12/08/18 09:23:04 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: turning off VerticesDofx, PIDs are distributed by constructor

Location:
issm/trunk-jpl/src/c
Files:
4 edited

Legend:

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

    r23501 r23522  
    353353                analysis_type=output->analysis_type_list[i];
    354354                output->SetCurrentConfiguration(analysis_type);
    355                 if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices
     355                //if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices
    356356                SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters,analysis_type);
    357357                NodesDofx(output->nodes_list[i],output->parameters,analysis_type);
     
    442442
    443443                if(i==0){
    444                         if(VerboseMProcessor()) _printf0_("      creating vertex PIDs\n");
    445                         VerticesDofx(vertices,parameters);
     444                //      if(VerboseMProcessor()) _printf0_("      creating vertex PIDs\n");
     445                //      VerticesDofx(vertices,parameters);
    446446
    447447                        if(VerboseMProcessor()) _printf0_("      detecting active vertices\n");
     
    530530                        analysis_type=this->analysis_type_list[i];
    531531                        SetCurrentConfiguration(analysis_type);
    532                         if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices
     532                        //if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices
    533533                        SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters,analysis_type);
    534534                        NodesDofx(this->nodes_list[i],this->parameters,analysis_type);
  • issm/trunk-jpl/src/c/classes/Vertex.cpp

    r23519 r23522  
    2020}
    2121/*}}}*/
    22 Vertex::Vertex(int vertex_id, int vertex_sid,int vertex_lid,bool vertex_clone, IoModel* iomodel){/*{{{*/
     22Vertex::Vertex(int vertex_id, int vertex_sid,int vertex_lid,int vertex_pid,bool vertex_clone, IoModel* iomodel){/*{{{*/
    2323
    2424        /*Checks in debugging mode*/
    2525        _assert_(vertex_sid>=0 && vertex_sid<iomodel->numberofvertices);
    2626
    27         this->id           = vertex_id;
    28         this->sid          = vertex_sid;
    29         this->pid          = UNDEF;
    30         this->lid          = vertex_lid;
    31 
     27        /*IDs*/
     28        this->id  = vertex_id;
     29        this->sid = vertex_sid;
     30        this->pid = vertex_pid;
     31        this->lid = vertex_lid;
     32
     33        /*Coordinates*/
    3234        _assert_(iomodel->Data("md.mesh.x") && iomodel->Data("md.mesh.y") && iomodel->Data("md.mesh.z"));
    3335        this->x            = iomodel->Data("md.mesh.x")[vertex_sid];
     
    3537        this->z            = iomodel->Data("md.mesh.z")[vertex_sid];
    3638        this->domaintype   = iomodel->domaintype;
    37 
    3839        if(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long")){
    3940                this->latitute     = iomodel->Data("md.mesh.lat")[vertex_sid];
  • issm/trunk-jpl/src/c/classes/Vertex.h

    r23519 r23522  
    3737                /*Vertex constructors, destructors {{{*/
    3838                Vertex();
    39                 Vertex(int id, int sid,int lid,bool clone, IoModel* iomodel);
     39                Vertex(int id, int sid,int lid,int pid,bool clone, IoModel* iomodel);
    4040                ~Vertex();
    4141                /*}}}*/
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp

    r23519 r23522  
    382382        xDelete<int>(vertices_proc_count);
    383383
     384        /*Final step: prepare pids (parallel ids), first count number of masters for each proc*/
     385        int*  num_masters = xNewZeroInit<int>(num_procs);
     386        for(int i=0;i<iomodel->numberofvertices;i++){
     387                num_masters[vertices_ranks[MAXCONNECTIVITY*i+0]]++;
     388        }
     389        /*Now count offsets for each procs (by taking the sum of masters of procs<my_rank)*/
     390        int* rank_offsets  = xNewZeroInit<int>(num_procs);
     391        for(int i=0;i<num_procs;i++){
     392                for(int j=i+1;j<num_procs;j++) rank_offsets[i]+=num_masters[j];
     393        }
     394        xDelete<int>(num_masters);
     395        /*Now create pids*/
     396        int* vertices_pids = xNew<int>(iomodel->numberofvertices);
     397        int* rank_counters = xNewZeroInit<int>(iomodel->numberofvertices);
     398        for(int i=0;i<iomodel->numberofvertices;i++){
     399                int rank_master = vertices_ranks[MAXCONNECTIVITY*i+0];
     400                vertices_pids[i] = rank_offsets[rank_master]+rank_counters[rank_master];
     401                rank_counters[rank_master]++;
     402        }
     403        xDelete<int>(rank_counters);
     404        xDelete<int>(rank_offsets);
     405
     406        /*Go ahead and create vertices now that we have all we need*/
    384407        for(int i=0;i<iomodel->numberofvertices;i++){
    385408                if(vertices_lids[i]!=-1){
    386409                        bool isclone = (vertices_ranks[MAXCONNECTIVITY*i+0]!=my_rank);
    387                         vertices->AddObject(new Vertex(i+1,i,vertices_lids[i],isclone,iomodel));
     410                        vertices->AddObject(new Vertex(i+1,i,vertices_lids[i],vertices_pids[i],isclone,iomodel));
    388411                }
    389412        }
    390413        xDelete<int>(vertices_ranks);
    391414        xDelete<int>(vertices_lids);
     415        xDelete<int>(vertices_pids);
    392416
    393417        /*Free data: */
Note: See TracChangeset for help on using the changeset viewer.