Changeset 3454
- Timestamp:
- 04/08/10 08:14:48 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.cpp
r3446 r3454 715 715 } 716 716 /*}}}*/ 717 /*FUNCTION DataSet::NodeRank{{{1*/ 718 void DataSet::NodeRank(int* ranks){ 719 720 /*Go through a dataset, and find a Node* object. For this object, 721 * ask it to report its cpu rank: */ 722 723 int node_rank; 717 /*FUNCTION DataSet::Ranks{{{1*/ 718 void DataSet::Ranks(int* ranks){ 719 720 /*Go through a dataset, and for each object, report it cpu: */ 721 722 int rank; 724 723 int id; 725 724 vector<Object*>::iterator object; … … 731 730 732 731 /*Ok, this object is a node, ask which rank it has: */ 733 node_rank=(*object)->MyRank();732 rank=(*object)->MyRank(); 734 733 735 734 /*Which id does it have: */ … … 737 736 738 737 /*Plug rank into ranks, according to id: */ 739 ranks[id-1]= node_rank; //Matlab ids start at 1.738 ranks[id-1]=rank; //Matlab ids start at 1. 740 739 } 741 740 } … … 1149 1148 /*}}}*/ 1150 1149 /*FUNCTION DataSet::FlagClones{{{1*/ 1151 void DataSet::FlagClones(int numberof nodes){1150 void DataSet::FlagClones(int numberofobjects){ 1152 1151 1153 1152 int i; … … 1158 1157 1159 1158 vector<Object*>::iterator object; 1160 Node* node=NULL;1161 1159 1162 1160 /*Allocate ranks: */ 1163 ranks=(int*)xmalloc(numberof nodes*sizeof(int));1164 minranks=(int*)xmalloc(numberof nodes*sizeof(int));1165 1166 for(i=0;i<numberof nodes;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.1167 1168 /*Now go through all our nodes and ask them to report to who they belong (which rank): */1169 NodeRank(ranks);1170 1171 #ifdef _ISSM_DEBUG_1172 for(i=0;i<numberof nodes;i++){1161 ranks=(int*)xmalloc(numberofobjects*sizeof(int)); 1162 minranks=(int*)xmalloc(numberofobjects*sizeof(int)); 1163 1164 for(i=0;i<numberofobjects;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit. 1165 1166 /*Now go through all our objects and ask them to report to who they belong (which rank): */ 1167 Ranks(ranks); 1168 1169 #ifdef _ISSM_DEBUG_ 1170 for(i=0;i<numberofobjects;i++){ 1173 1171 _printf_("%i\n",ranks[i]); 1174 1172 } 1175 #endif1176 1177 /*We need to take the minimum rank for each node, and every cpu needs to get that result. That way,1178 * when we start building the dof list for all nodes, a cpu can check whether its nodealready has been1173 #endif 1174 1175 /*We need to take the minimum rank for each vertex, and every cpu needs to get that result. That way, 1176 * when we start building the dof list for all vertexs, a cpu can check whether its vertex already has been 1179 1177 * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing 1180 1178 * order of cpu rank. This is also why we initialized this array to num_procs.*/ 1181 MPI_Allreduce ( (void*)ranks,(void*)minranks,numberof nodes,MPI_INT,MPI_MIN,MPI_COMM_WORLD);1182 1183 #ifdef _ISSM_DEBUG_1184 for(i=0;i<numberofnodes;i++){1185 _printf_("%i\n",minranks[i]);1186 }1187 #endif1188 1189 /*Now go through all nodes, and use minranks to flag which nodes are cloned: */1190 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1191 1192 /*Check this is a node: */1179 MPI_Allreduce ( (void*)ranks,(void*)minranks,numberofobjects,MPI_INT,MPI_MIN,MPI_COMM_WORLD); 1180 1181 #ifdef _ISSM_DEBUG_ 1182 for(i=0;i<numberofobjects;i++){ 1183 _printf_("%i\n",minranks[i]); 1184 } 1185 #endif 1186 1187 /*Now go through all objects, and use minranks to flag which objects are cloned: */ 1188 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1189 1190 /*Check this is a vertex: */ 1193 1191 if((*object)->Enum()==NodeEnum()){ 1194 1195 node=(Node*)(*object); 1196 1197 /*Ok, this object is a node, ask it to plug values into partition: */ 1198 node->SetClone(minranks); 1192 1193 /*For this object, decide whether it is a clone: */ 1194 (*object)->SetClone(minranks); 1199 1195 1200 1196 } -
issm/trunk/src/c/DataSet/DataSet.h
r3446 r3454 57 57 int FindResult(Vec* presult,char* name); 58 58 Object* FindParamObject(char* name); 59 void NodeRank(int* ranks);59 void Ranks(int* ranks); 60 60 void DistributeDofs(int numberofnodes,int numdofspernode); 61 61 void CreatePartitioningVector(Vec* ppartition,int numnods,int numdofspernode); -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp
r3453 r3454 15 15 DataSet* constraints = NULL; 16 16 Spc* spc = NULL; 17 int count; 17 18 18 19 /*spc intermediary data: */ -
issm/trunk/src/c/objects/Beam.cpp
r3439 r3454 787 787 } 788 788 /*}}}*/ 789 //*FUNCTION Beam::SetClone {{{1*/ 790 void Beam::SetClone(int* minranks){ 791 792 ISSMERROR("not implemented yet"); 793 } 794 /*}}}1*/ 795 -
issm/trunk/src/c/objects/Beam.h
r3439 r3454 57 57 void Configure(void* loads,void* nodes,void* materials,void* parameters); 58 58 Object* copy(); 59 void SetClone(int* minranks); 60 59 61 /*}}}*/ 60 /* object management: {{{1*/62 /*numerics: {{{1*/ 61 63 void CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type); 62 64 void CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type); -
issm/trunk/src/c/objects/DofVec.cpp
r3332 r3454 418 418 return vector; 419 419 } 420 /*FUNCTION DofVec::SetClone {{{1*/ 421 void DofVec::SetClone(int* minranks){ 422 423 ISSMERROR("not implemented yet"); 424 } 425 /*}}}1*/ -
issm/trunk/src/c/objects/DofVec.h
r2316 r3454 45 45 int MyRank(); 46 46 int Size(); 47 void SetClone(int* minranks); 48 47 49 48 50 Object* copy(); -
issm/trunk/src/c/objects/Element.h
r3180 r3454 21 21 virtual int MyRank()=0; 22 22 virtual void Marshall(char** pmarshalled_dataset)=0; 23 virtual void SetClone(int* minranks)=0; 23 24 virtual int MarshallSize()=0; 24 25 virtual char* GetName()=0; -
issm/trunk/src/c/objects/FemModel.cpp
r3417 r3454 225 225 Mat FemModel::get_Gmn(void){return Gmn;} 226 226 /*}}}*/ 227 /*FUNCTION FemModel::FemModel {{{1*/ 228 void FemModel::SetClone(int* minranks){ 229 230 ISSMERROR("not implemented yet"); 231 } 232 /*}}}1*/ -
issm/trunk/src/c/objects/FemModel.h
r3420 r3454 55 55 int Enum(); 56 56 Object* copy(); 57 void SetClone(int* minranks); 57 58 58 59 int FindParam(double* pscalar,char* name); -
issm/trunk/src/c/objects/Icefront.cpp
r3430 r3454 1478 1478 } 1479 1479 /*}}}*/ 1480 /*FUNCTION Icefront::SetClone {{{1*/ 1481 void Icefront::SetClone(int* minranks){ 1482 1483 ISSMERROR("not implemented yet"); 1484 } 1485 /*}}}1*/ 1480 1486 /*FUNCTION Icefront UpdateFromInputs {{{1*/ 1481 1487 void Icefront::UpdateFromInputs(void* vinputs){ -
issm/trunk/src/c/objects/Icefront.h
r3430 r3454 69 69 int MarshallSize(); 70 70 int MyRank(); 71 void SetClone(int* minranks); 72 71 73 /*}}}*/ 72 74 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Input.cpp
r3397 r3454 301 301 } 302 302 /*}}}*/ 303 304 305 306 307 303 /*FUNCTION Input::SetClone {{{1*/ 304 void Input::SetClone(int* minranks){ 305 306 ISSMERROR("not implemented yet"); 307 } 308 /*}}}1*/ -
issm/trunk/src/c/objects/Input.h
r3180 r3454 39 39 40 40 Object* copy(); 41 void SetClone(int* minranks); 41 42 42 43 /*fill virtual routines: */ -
issm/trunk/src/c/objects/Load.h
r3420 r3454 32 32 virtual void PenaltyCreateKMatrix(Mat Kgg,void* inputs,double kmax,int analysis_type,int sub_analysis_type)=0; 33 33 virtual void PenaltyCreatePVector(Vec pg,void* inputs,double kmax,int analysis_type,int sub_analysis_type)=0; 34 virtual void SetClone(int* minranks)=0; 34 35 35 36 int Enum(); -
issm/trunk/src/c/objects/Material.h
r3420 r3454 21 21 virtual int MyRank()=0; 22 22 virtual void Marshall(char** pmarshalled_dataset)=0; 23 virtual void SetClone(int* minranks)=0; 23 24 virtual int MarshallSize()=0; 24 25 virtual char* GetName()=0; -
issm/trunk/src/c/objects/Matice.cpp
r3420 r3454 13 13 #include <string.h> 14 14 #include "../shared/shared.h" 15 #include "../include/macros.h" 15 16 #include "../EnumDefinitions/EnumDefinitions.h" 16 17 … … 440 441 } 441 442 /*}}}*/ 443 //*FUNCTION Matice::SetClone {{{1*/ 444 void Matice::SetClone(int* minranks){ 445 446 ISSMERROR("not implemented yet"); 447 } 448 /*}}}1*/ 449 -
issm/trunk/src/c/objects/Matice.h
r3420 r3454 44 44 double GetB(); 45 45 double GetN(); 46 void SetClone(int* minranks); 46 47 47 48 }; -
issm/trunk/src/c/objects/Matpar.cpp
r3420 r3454 12 12 #include "stdio.h" 13 13 #include "../shared/shared.h" 14 #include "../include/macros.h" 14 15 #include "./Matpar.h" 15 16 #include <string.h> … … 288 289 } 289 290 /*}}}1*/ 291 /*FUNCTION Matpar::SetClone {{{1*/ 292 void Matpar::SetClone(int* minranks){ 293 294 ISSMERROR("not implemented yet"); 295 } 296 /*}}}1*/ -
issm/trunk/src/c/objects/Matpar.h
r3420 r3454 57 57 double GetMeltingPoint(); 58 58 Object* copy(); 59 void SetClone(int* minranks); 59 60 60 61 }; -
issm/trunk/src/c/objects/Numericalflux.cpp
r3409 r3454 751 751 } 752 752 /*}}}*/ 753 /*FUNCTION Numericalflux::SetClone {{{1*/ 754 void Numericalflux::SetClone(int* minranks){ 755 756 ISSMERROR("not implemented yet"); 757 } 758 /*}}}1*/ -
issm/trunk/src/c/objects/Numericalflux.h
r3378 r3454 48 48 int Enum(); 49 49 int GetId(); 50 void SetClone(int* minranks); 50 51 void GetJacobianDeterminant(double* pJdet,double xyz_list[4][3], double gauss_coord); 51 52 void GetNodalFunctions(double* l1l4, double gauss_coord); -
issm/trunk/src/c/objects/Numpar.cpp
r3332 r3454 245 245 } 246 246 /*}}}*/ 247 /*FUNCTION Numpar::SetClone {{{1*/ 248 void Numpar::SetClone(int* minranks){ 249 250 ISSMERROR("not implemented yet"); 251 } 252 /*}}}1*/ -
issm/trunk/src/c/objects/Numpar.h
r2354 r3454 43 43 int Enum(); 44 44 Object* copy(); 45 void SetClone(int* minranks); 45 46 46 47 void Configure(void* pparametersin); -
issm/trunk/src/c/objects/Object.h
r803 r3454 25 25 virtual void Demarshall(char** pmarshalled_dataset)=0; 26 26 virtual int Enum()=0; 27 virtual void SetClone(int* minranks)=0; 27 28 virtual Object* copy()=0; 28 29 -
issm/trunk/src/c/objects/Param.cpp
r3332 r3454 724 724 } 725 725 /*}}}*/ 726 /*FUNCTION Param::SetClone {{{1*/ 727 void Param::SetClone(int* minranks){ 728 729 ISSMERROR("not implemented yet"); 730 } 731 /*}}}1*/ -
issm/trunk/src/c/objects/Param.h
r2333 r3454 45 45 void Demarshall(char** pmarshalled_dataset); 46 46 int Enum(); 47 void SetClone(int* minranks); 47 48 48 49 void SetDouble(double value); -
issm/trunk/src/c/objects/Pengrid.cpp
r3332 r3454 14 14 #include <string.h> 15 15 #include "../EnumDefinitions/EnumDefinitions.h" 16 #include "../include/macros.h" 16 17 #include "../shared/shared.h" 17 18 #include "../include/typedefs.h" … … 635 636 } 636 637 /*}}}1*/ 638 /*FUNCTION Pengrid::SetClone {{{1*/ 639 void Pengrid::SetClone(int* minranks){ 640 641 ISSMERROR("not implemented yet"); 642 } 643 /*}}}1*/ 637 644 /*FUNCTION Pengrid::UpdateFromInputs {{{1*/ 638 645 void Pengrid::UpdateFromInputs(void* inputs){ -
issm/trunk/src/c/objects/Pengrid.h
r2212 r3454 65 65 void PenaltyConstrain(int* punstable,void* inputs,int analysis_type,int sub_analysis_type); 66 66 void PenaltyConstrainThermal(int* punstable,void* inputs,int analysis_type,int sub_analysis_type); 67 void SetClone(int* minranks); 68 67 69 }; 68 70 -
issm/trunk/src/c/objects/Penpair.cpp
r3430 r3454 14 14 #include <string.h> 15 15 #include "../EnumDefinitions/EnumDefinitions.h" 16 #include "../include/macros.h" 16 17 #include "../shared/shared.h" 17 18 #include "../include/typedefs.h" … … 233 234 } 234 235 /*}}}1*/ 236 /*FUNCTION Penpair::SetClone {{{1*/ 237 void Penpair::SetClone(int* minranks){ 238 239 ISSMERROR("not implemented yet"); 240 } 241 /*}}}1*/ -
issm/trunk/src/c/objects/Penpair.h
r1897 r3454 48 48 void PenaltyCreatePVector(Vec pg,void* inputs,double kmax,int analysis_type,int sub_analysis_type); 49 49 Object* copy(); 50 void SetClone(int* minranks); 51 50 52 }; 51 53 -
issm/trunk/src/c/objects/Penta.cpp
r3420 r3454 4088 4088 } 4089 4089 /*}}}*/ 4090 /* FUNCTION ReduceVectorStokes {{{1*/4090 /**FUNCTION ReduceVectorStokes {{{1*/ 4091 4091 void Penta::ReduceVectorStokes(double* Pe_reduced, double* Ke_temp, double* Pe_temp){ 4092 4092 … … 4130 4130 } 4131 4131 /*}}}*/ 4132 /*FUNCTION Penta::SetClone {{{1*/ 4133 void Penta::SetClone(int* minranks){ 4134 4135 ISSMERROR("not implemented yet"); 4136 } 4137 /*}}}1*/ 4132 4138 /*FUNCTION SurfaceArea {{{1*/ 4133 4139 double Penta::SurfaceArea(void* inputs,int analysis_type,int sub_analysis_type){ -
issm/trunk/src/c/objects/Penta.h
r3420 r3454 62 62 void UpdateFromDakota(void* inputs); 63 63 void UpdateFromInputs(void* inputs); 64 void SetClone(int* minranks); 65 64 66 /*}}}*/ 65 67 /*FUNCTION element numerical routines {{{1*/ -
issm/trunk/src/c/objects/Result.cpp
r3332 r3454 14 14 #include <string.h> 15 15 #include "../EnumDefinitions/EnumDefinitions.h" 16 #include "../include/macros.h" 16 17 #include "./ParameterInputs.h" 17 18 #include "../shared/shared.h" … … 290 291 } 291 292 /*}}}1*/ 293 /*FUNCTION Result::SetClone {{{1*/ 294 void Result::SetClone(int* minranks){ 295 296 ISSMERROR("not implemented yet"); 297 } 298 /*}}}1*/ -
issm/trunk/src/c/objects/Result.h
r1271 r3454 41 41 int Enum(); 42 42 Object* copy(); 43 void SetClone(int* minranks); 43 44 44 45 double GetTime(); -
issm/trunk/src/c/objects/Rgb.cpp
r2907 r3454 14 14 #include "../EnumDefinitions/EnumDefinitions.h" 15 15 #include "../DataSet/DataSet.h" 16 #include "../shared/shared.h" 17 #include "../include/macros.h" 16 18 #include "./objects.h" 17 19 … … 163 165 } 164 166 /*}}}1*/ 167 /*FUNCTION Rgb::SetClone {{{1*/ 168 void Rgb::SetClone(int* minranks){ 169 170 ISSMERROR("not implemented yet"); 171 } 172 /*}}}1*/ -
issm/trunk/src/c/objects/Rgb.h
r803 r3454 32 32 int GetId(); 33 33 int MyRank(); 34 void SetClone(int* minranks); 34 35 35 36 /*non virtual: */ -
issm/trunk/src/c/objects/Riftfront.cpp
r3433 r3454 457 457 } 458 458 /*}}}1*/ 459 /*FUNCTION Riftfront::FreezeConstraints{{{1*/ 460 void Riftfront::FreezeConstraints(void* vinputs, int analysis_type){ 461 462 /*Just set frozen flag to 1: */ 463 this->frozen=1; 464 465 } 466 /*}}}1*/ 459 467 /*FUNCTION Riftfront::GetDofList {{{1*/ 460 468 … … 482 490 char* Riftfront::GetName(void){ 483 491 return "riftfront"; 492 } 493 /*}}}1*/ 494 /*FUNCTION Riftfront::IsFrozen{{{1*/ 495 bool Riftfront::IsFrozen(void){ 496 497 /*Just set frozen flag to 1: */ 498 if(this->frozen)return 1; 499 else return 0; 484 500 } 485 501 /*}}}1*/ … … 791 807 } 792 808 /*}}}1*/ 793 /*FUNCTION Riftfront::PotentialUnstableC 794 * nstraint {{{1*/ 809 /*FUNCTION Riftfront::PotentialUnstableConstraint {{{1*/ 795 810 int Riftfront::PotentialUnstableConstraint(int* punstable, void* vinputs, int analysis_type){ 796 811 … … 894 909 } 895 910 /*}}}1*/ 911 /*FUNCTION Riftfront::SetClone {{{1*/ 912 void Riftfront::SetClone(int* minranks){ 913 914 ISSMERROR("not implemented yet"); 915 } 916 /*}}}1*/ 896 917 /*FUNCTION Riftfront::UpdateFromInputs {{{1*/ 897 918 void Riftfront::UpdateFromInputs(void* vinputs){ … … 908 929 } 909 930 /*}}}1*/ 910 /*FUNCTION Riftfront::FreezeConstraints{{{1*/911 void Riftfront::FreezeConstraints(void* vinputs, int analysis_type){912 913 /*Just set frozen flag to 1: */914 this->frozen=1;915 916 }917 /*}}}1*/918 /*FUNCTION Riftfront::IsFrozen{{{1*/919 bool Riftfront::IsFrozen(void){920 921 /*Just set frozen flag to 1: */922 if(this->frozen)return 1;923 else return 0;924 }925 /*}}}1*/ -
issm/trunk/src/c/objects/Riftfront.h
r3433 r3454 66 66 /*}}}*/ 67 67 /*object management: {{{1*/ 68 void Configure(void* elements,void* nodes,void* materials); 69 Object* copy(); 70 void DeepEcho(); 71 void Demarshall(char** pmarshalled_dataset); 68 72 void Echo(); 69 void DeepEcho(); 73 int Enum(); 74 int GetId(); 75 char* GetName(); 70 76 void Marshall(char** pmarshalled_dataset); 71 77 int MarshallSize(); 72 char* GetName();73 void Demarshall(char** pmarshalled_dataset);74 int Enum();75 int GetId();76 78 int MyRank(); 77 void Configure(void* elements,void* nodes,void* materials);78 Object* copy(); 79 void SetClone(int* minranks); 80 79 81 /*}}}*/ 80 82 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Sing.cpp
r3439 r3454 623 623 } 624 624 /*}}}*/ 625 /*FUNCTION Sing::SetClone {{{1*/ 626 void Sing::SetClone(int* minranks){ 627 628 ISSMERROR("not implemented yet"); 629 } 630 /*}}}1*/ -
issm/trunk/src/c/objects/Sing.h
r3439 r3454 52 52 void Marshall(char** pmarshalled_dataset); 53 53 int MarshallSize(); 54 void SetClone(int* minranks); 54 55 int MyRank(); 55 56 /*}}}*/ -
issm/trunk/src/c/objects/SolPar.h
r2313 r3454 37 37 int Enum(); 38 38 Object* copy(); 39 void SetClone(int* minranks); 39 40 40 41 /*functionality: */ -
issm/trunk/src/c/objects/Spc.cpp
r2908 r3454 12 12 #include "stdio.h" 13 13 #include <string.h> 14 #include "../include/macros.h" 15 #include "../shared/shared.h" 14 16 #include "../EnumDefinitions/EnumDefinitions.h" 15 17 #include "../DataSet/DataSet.h" … … 162 164 } 163 165 /*}}}1*/ 166 /*FUNCTION Spc::SetClone {{{1*/ 167 void Spc::SetClone(int* minranks){ 168 169 ISSMERROR("not implemented yet"); 170 } 171 /*}}}1*/ -
issm/trunk/src/c/objects/Spc.h
r803 r3454 37 37 double GetValue(); 38 38 Object* copy(); 39 void SetClone(int* minranks); 39 40 40 41 }; -
issm/trunk/src/c/objects/Tria.cpp
r3420 r3454 5245 5245 } 5246 5246 /*}}}*/ 5247 /*FUNCTION Tria::SetClone {{{1*/ 5248 void Tria::SetClone(int* minranks){ 5249 5250 ISSMERROR("not implemented yet"); 5251 } 5252 /*}}}1*/ 5247 5253 /*FUNCTION SurfaceNormal{{{1*/ 5248 5254 -
issm/trunk/src/c/objects/Tria.h
r3420 r3454 56 56 int MarshallSize(); 57 57 int MyRank(); 58 void SetClone(int* minranks); 58 59 void UpdateFromDakota(void* inputs); 59 60 void UpdateFromInputs(void* inputs); -
issm/trunk/src/c/objects/Vertex.cpp
r3420 r3454 185 185 } 186 186 /*}}}*/ 187 /*FUNCTION SetClone {{{1*/ 188 void Vertex::SetClone(int* minranks){ 189 190 extern int my_rank; 191 192 if (minranks[id-1]==my_rank){ 193 this->clone=0; 194 } 195 else{ 196 /*!there is a cpu with lower rank that has the same node, 197 therefore, I am a clone*/ 198 this->clone=1; 199 } 200 201 } 202 /*}}}*/ 187 203 /*FUNCTION UpdateFromDakota {{{1*/ 188 204 void Vertex::UpdateFromDakota(void* vinputs){ -
issm/trunk/src/c/objects/Vertex.h
r3420 r3454 42 42 int MarshallSize(); 43 43 int MyRank(); 44 void SetClone(int* minranks); 44 45 void UpdateFromDakota(void* vinputs); 45 46 void UpdateFromInputs(void* vinputs);
Note:
See TracChangeset
for help on using the changeset viewer.