Changeset 23586
- Timestamp:
- 01/02/19 19:56:44 (6 years ago)
- 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 208 208 ./modules/NodesDofx/NodesDofx.cpp\ 209 209 ./modules/NodalValuex/NodalValuex.cpp\ 210 ./modules/VerticesDofx/VerticesDofx.cpp\211 210 ./modules/VertexCoordinatesx/VertexCoordinatesx.cpp\ 212 211 ./modules/OutputResultsx/OutputResultsx.cpp\ -
TabularUnified issm/trunk-jpl/src/c/classes/FemModel.cpp ¶
r23585 r23586 25 25 /*module includes: {{{*/ 26 26 #include "../modules/ModelProcessorx/ModelProcessorx.h" 27 #include "../modules/VerticesDofx/VerticesDofx.h"28 27 #include "../modules/SpcNodesx/SpcNodesx.h" 29 28 #include "../modules/ConfigureObjectsx/ConfigureObjectsx.h" … … 353 352 analysis_type=output->analysis_type_list[i]; 354 353 output->SetCurrentConfiguration(analysis_type); 355 //if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices356 354 SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters,analysis_type); 357 355 NodesDofx(output->nodes_list[i],output->parameters,analysis_type); … … 442 440 443 441 if(i==0){ 444 // if(VerboseMProcessor()) _printf0_(" creating vertex PIDs\n");445 // VerticesDofx(vertices,parameters);446 447 442 if(VerboseMProcessor()) _printf0_(" detecting active vertices\n"); 448 443 GetMaskOfIceVerticesLSMx0(this); … … 530 525 analysis_type=this->analysis_type_list[i]; 531 526 SetCurrentConfiguration(analysis_type); 532 //if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices533 527 SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters,analysis_type); 534 528 NodesDofx(this->nodes_list[i],this->parameters,analysis_type); … … 2731 2725 2732 2726 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 vertices2735 }2736 2727 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 !*/2738 2728 NodesDofx(new_nodes_list[i],this->parameters,analysis_type); 2739 2729 } -
TabularUnified issm/trunk-jpl/src/c/classes/Nodes.cpp ¶
r23575 r23586 207 207 } 208 208 /*}}}*/ 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 been231 * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing232 * 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 /*}}}*/251 209 int Nodes::MaximumId(){/*{{{*/ 252 210 -
TabularUnified issm/trunk-jpl/src/c/classes/Nodes.h ¶
r23574 r23586 34 34 /*numerics*/ 35 35 void DistributeDofs(int analysis_type,int SETENUM); 36 void FlagClones(int analysis_type);37 36 int MaximumId(void); 38 37 int MaxNumDofs(int analysis_type,int setenum); -
TabularUnified issm/trunk-jpl/src/c/classes/Vertices.cpp ¶
r23572 r23586 191 191 } 192 192 /*}}}*/ 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 been215 * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing216 * 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 }/*}}}*/231 193 int Vertices::NumberOfVertices(void){/*{{{*/ 232 194 -
TabularUnified issm/trunk-jpl/src/c/classes/Vertices.h ¶
r23521 r23586 30 30 /*numerics:*/ 31 31 void DistributePids(int numberofnodes); 32 void FlagClones(int numberofnodes);33 32 int NumberOfVertices(void); 34 33 void LatLonList(IssmDouble** lat,IssmDouble** lon); -
TabularUnified issm/trunk-jpl/src/c/modules/NodesDofx/NodesDofx.cpp ¶
r23576 r23586 18 18 if(VerboseModule()) _printf0_(" Renumbering degrees of freedom\n"); 19 19 20 /*Ensure that only for each cpu, the partition border nodes only will be taken into account once21 * across the cluster. To do so, we flag all the clone nodes: */22 //nodes->FlagClones(configuration_type); /*Not needed anymore!*/23 24 20 /*Go through all nodes, and build degree of freedom lists. Each node gets a fixed number of dofs. When 25 21 *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 98 98 #include "./ThicknessAcrossGradientx/ThicknessAcrossGradientx.h" 99 99 #include "./UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h" 100 #include "./VerticesDofx/VerticesDofx.h"101 100 #include "./VertexCoordinatesx/VertexCoordinatesx.h" 102 101 #include "./VecMergex/VecMergex.h"
Note:
See TracChangeset
for help on using the changeset viewer.