Changeset 2489
- Timestamp:
- 10/22/09 11:53:24 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/parallel/diagnostic.cpp
r2409 r2489 45 45 DataSet* parameters=NULL; 46 46 47 /*time*/ 48 double start, finish; 49 double start_core, finish_core; 50 double start_init, finish_init; 51 47 52 MODULEBOOT(); 48 53 … … 51 56 #endif 52 57 58 /*Initialize Petsc and get start time*/ 53 59 PetscInitialize(&argc,&argv,(char *)0,""); 60 MPI_Barrier(MPI_COMM_WORLD); start=MPI_Wtime(); 54 61 55 62 /*Size and rank: */ … … 63 70 64 71 /*Initialize model structure: */ 72 MPI_Barrier(MPI_COMM_WORLD); start_init=MPI_Wtime(); 65 73 model=new Model(); 66 74 … … 106 114 results=new DataSet(ResultsEnum()); 107 115 116 MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime(); 117 108 118 /*are we running the solution sequence, or a qmu wrapper around it? : */ 109 119 if(!qmu_analysis){ … … 111 121 /*run diagnostic analysis: */ 112 122 _printf_("call computational core:\n"); 123 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 113 124 diagnostic_core(results,model,inputs); 125 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 114 126 115 127 /*Add analysis_type to results: */ … … 123 135 /*run control analysis: */ 124 136 _printf_("call computational core:\n"); 137 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 125 138 control_core(results,model,inputs); 139 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 126 140 127 141 /*Add analysis_type and control_type to results: */ … … 145 159 146 160 #ifdef _HAVE_DAKOTA_ 161 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 147 162 Qmux(model,inputs,DiagnosticAnalysisEnum(),NoneAnalysisEnum()); 163 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 148 164 #else 149 165 throw ErrorException(__FUNCT__," Dakota not present, cannot do qmu!"); … … 164 180 delete processed_results; 165 181 182 /*Get finish time and close*/ 183 MPI_Barrier(MPI_COMM_WORLD); finish = MPI_Wtime( ); 184 _printf_("\n %-34s %f seconds \n","Model initialization elapsed time:",finish_init-start_init); 185 _printf_(" %-34s %f seconds \n","Core solution elapsed time:",finish_core-start_core); 186 _printf_(" %-34s %f seconds\n\n","Total elapsed time:",finish-start); 166 187 _printf_("closing MPI and Petsc\n"); 167 188 PetscFinalize();
Note:
See TracChangeset
for help on using the changeset viewer.