Changeset 13554
- Timestamp:
- 10/05/12 11:22:30 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r13549 r13554 343 343 ./modules/InputConvergencex/InputConvergencex.cpp\ 344 344 ./modules/InputConvergencex/InputConvergencex.h\ 345 ./solutions/PrintBanner.cpp\ 345 346 ./solutions/convergence.cpp\ 346 347 ./solutions/ProcessArguments.cpp\ -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r13553 r13554 171 171 delete parameters; 172 172 delete results; 173 174 /*Before we delete the profiler, report statistics for this run: */ 175 profiler->Tag(Finish); //final tagging 176 _pprintLine_(""); 177 _pprintLine_(" "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<profiler->DeltaTime(StartInit,FinishInit)); 178 _pprintLine_(" "<<setw(40)<<left<<"Core solution elapsed time:"<<profiler->DeltaTime(StartCore,FinishCore)); 179 _pprintLine_(""); 180 _pprintLine_(" Total elapsed time:" 181 <<profiler->DeltaTimeModHour(Start,Finish)<<" hrs " 182 <<profiler->DeltaTimeModMin(Start,Finish)<<" min " 183 <<profiler->DeltaTimeModSec(Start,Finish)<<" sec" 184 ); 185 _pprintLine_(""); 186 187 /*Now delete: */ 173 188 delete profiler; 174 189 … … 177 192 178 193 /*Object management*/ 194 /*FUNCTION FemModel::OutputResults {{{*/ 195 void FemModel::OutputResults(void){ 196 197 _pprintLine_("write results to disk:"); 198 199 /*Just call the OutputResultsx module: */ 200 OutputResultsx(this->elements, this->nodes, this->vertices, this->loads, this->materials, this->parameters,this->results); 201 202 } 203 /*}}}*/ 179 204 /*FUNCTION FemModel::Solve {{{*/ 180 205 void FemModel::Solve(void){ 181 206 207 /*profiling: */ 208 bool profiling = false; 209 IssmDouble solution_time; 210 IssmDouble solution_flops; 211 IssmDouble solution_memory; 212 213 /*solution: */ 182 214 int solution_type; 183 215 void (*solutioncore)(FemModel*)=NULL; //core solution function pointer … … 186 218 187 219 /*Retrieve solution_type from parameters: */ 188 this->parameters->FindParam(&solution_type,SolutionTypeEnum);220 parameters->FindParam(&solution_type,SolutionTypeEnum); 189 221 190 222 /*Figure out which solution core we are going to run with the current solution type: */ … … 201 233 profiler->Tag(FinishAdCore); 202 234 235 /*some profiling results for the core: */ 236 parameters->FindParam(&profiling,DebugProfilingEnum); 237 if(profiling){ 238 239 solution_time=profiler->DeltaTime(StartCore,FinishCore); 240 solution_flops=profiler->DeltaFlops(StartCore,FinishCore); 241 solution_memory=profiler->Memory(FinishCore); 242 243 _pprintLine_("Solution elapsed time : " << solution_time << " Seconds"); 244 _pprintLine_("Solution elapsed flops : " << solution_flops << " Flops"); 245 _pprintLine_("Solution memory used : " << solution_memory << " Bytes"); 246 247 /*Add to results: */ 248 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingSolutionTimeEnum, solution_time, 1, 0)); 249 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentMemEnum, solution_memory, 1, 0)); 250 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentFlopsEnum, solution_flops, 1, 0)); 251 } 203 252 204 253 } -
issm/trunk-jpl/src/c/classes/FemModel.h
r13553 r13554 54 54 void Echo(); 55 55 void Solve(void); 56 void OutputResults(void); 56 57 57 58 /*Fem: */ -
issm/trunk-jpl/src/c/issm.h
r12835 r13554 12 12 #endif 13 13 14 #include "./include/globals.h" //only include this header file once! 14 15 #include "./include/include.h" 15 16 #include "./shared/shared.h" -
issm/trunk-jpl/src/c/solutions/issm.cpp
r13553 r13554 1 1 /*!\file: issm.cpp 2 * \brief: ISSM main p arallel program2 * \brief: ISSM main program 3 3 */ 4 4 5 5 #include "../issm.h" 6 #include "../include/globals.h"7 6 8 void ProfilerEcho(Profiler* profiler);9 void ProfilerEnd(Profiler* profiler, Results* results, Parameters* parameters);10 11 7 int main(int argc,char **argv){ 12 8 13 /*FemModel: */ 14 FemModel *femmodel = NULL; 15 16 /*Print starting banner: {{{*/ 17 _pprintLine_(""); 18 _pprintLine_("Ice Sheet System Model (" << PACKAGE_NAME << ") version " << PACKAGE_VERSION); 19 _pprintLine_("(website: " << PACKAGE_URL << " contact: " << PACKAGE_BUGREPORT << ")"); 20 _pprintLine_(""); 21 /*}}}*/ 9 /*Print starting banner:*/ 10 PrintBanner(); 22 11 23 12 /*Initialize exception trapping: */ … … 28 17 29 18 /*Initialize femmodel from arguments provided command line: */ 30 femmodel=new FemModel(argc,argv);19 FemModel *femmodel = new FemModel(argc,argv); 31 20 32 21 /*Solve: */ 33 22 femmodel->Solve(); 34 23 35 /*Some profiling: */ 36 ProfilerEnd(femmodel->profiler,femmodel->results,femmodel->parameters); 37 38 _pprintLine_("write results to disk:"); 39 OutputResultsx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results); 40 41 /*Profiling at the end: */ 42 femmodel->profiler->Tag(Finish); 43 ProfilerEcho(femmodel->profiler); 24 /*Output results: */ 25 femmodel->OutputResults(); 44 26 45 27 /*Wrap up: */ … … 55 37 return 0; 56 38 } 57 58 void ProfilerEcho(Profiler* profiler){ /*{{{*/59 60 _pprintLine_("");61 _pprintLine_(" "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<profiler->DeltaTime(StartInit,FinishInit));62 _pprintLine_(" "<<setw(40)<<left<<"Core solution elapsed time:"<<profiler->DeltaTime(StartCore,FinishCore));63 _pprintLine_("");64 _pprintLine_(" Total elapsed time:"65 <<profiler->DeltaTimeModHour(Start,Finish)<<" hrs "66 <<profiler->DeltaTimeModMin(Start,Finish)<<" min "67 <<profiler->DeltaTimeModSec(Start,Finish)<<" sec"68 );69 _pprintLine_("");70 71 } /*}}}*/72 void ProfilerEnd(Profiler* profiler, Results* results, Parameters* parameters){ /*{{{*/73 74 bool profiling = false;75 76 IssmDouble solution_time;77 IssmDouble solution_flops;78 IssmDouble solution_memory;79 80 parameters->FindParam(&profiling,DebugProfilingEnum);81 82 if(profiling){83 84 solution_time=profiler->DeltaTime(StartCore,FinishCore);85 solution_flops=profiler->DeltaFlops(StartCore,FinishCore);86 solution_memory=profiler->Memory(FinishCore);87 88 _pprintLine_("Solution elapsed time : " << solution_time << " Seconds");89 _pprintLine_("Solution elapsed flops : " << solution_flops << " Flops");90 _pprintLine_("Solution memory used : " << solution_memory << " Bytes");91 92 /*Add to results: */93 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingSolutionTimeEnum, solution_time, 1, 0));94 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentMemEnum, solution_memory, 1, 0));95 results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentFlopsEnum, solution_flops, 1, 0));96 }97 98 } /*}}}*/ -
issm/trunk-jpl/src/c/solutions/kriging.cpp
r13534 r13554 4 4 5 5 #include "../issm.h" 6 #include "../include/globals.h"7 6 8 7 /*Local prototypes*/ -
issm/trunk-jpl/src/c/solutions/solutions.h
r13545 r13554 50 50 void EnvironmentFinalize(void); 51 51 int DakotaSpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* femmodel,int counter); 52 void PrintBanner(void); 52 53 53 54 //solution configuration
Note:
See TracChangeset
for help on using the changeset viewer.