Commit 2c7d3af5 authored by Florian Wittkamp's avatar Florian Wittkamp

Changed time measurement

parent 8b4f49df
...@@ -121,11 +121,6 @@ int main(int argc, char **argv){ ...@@ -121,11 +121,6 @@ int main(int argc, char **argv){
setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0);
/* initialize clock for estimating runtime of program */
if (MYID == 0){
time1=MPI_Wtime();
clock();
}
/* print program name, version, author etc to stdout*/ /* print program name, version, author etc to stdout*/
if (MYID == 0) info(stdout); if (MYID == 0) info(stdout);
...@@ -768,13 +763,8 @@ int main(int argc, char **argv){ ...@@ -768,13 +763,8 @@ int main(int argc, char **argv){
zb[0]=1; zb[1]=NZ; zb[0]=1; zb[1]=NZ;
} }
if (MYID==0){
time2=MPI_Wtime();
fprintf(FP,"\n\n\n **************************************************\n");
fprintf(FP," *********** STARTING TIME STEPPING ***************\n");
fprintf(FP," **************************************************\n");
fprintf(FP," real time before starting time loop: %4.2f s.\n",time2-time1);
}
for (ishot=1;ishot<=nshots;ishot++){ for (ishot=1;ishot<=nshots;ishot++){
...@@ -829,6 +819,23 @@ int main(int argc, char **argv){ ...@@ -829,6 +819,23 @@ int main(int argc, char **argv){
lsamp=NDTSHIFT+1; lsamp=NDTSHIFT+1;
nlsamp=1; nlsamp=1;
/* initialize clock for estimating runtime of program */
if (MYID == 0){
time1=MPI_Wtime();
clock();
}
if (MYID==0){
time2=MPI_Wtime();
fprintf(FP,"\n\n\n **************************************************\n");
fprintf(FP," *********** STARTING TIME STEPPING ***************\n");
fprintf(FP," **************************************************\n");
fprintf(FP," real time before starting time loop: %4.2f s.\n",time2-time1);
}
for (nt=1;nt<=NT;nt++){ for (nt=1;nt<=NT;nt++){
time_v_update[nt]=0.0; time_v_update[nt]=0.0;
...@@ -978,6 +985,14 @@ int main(int argc, char **argv){ ...@@ -978,6 +985,14 @@ int main(int argc, char **argv){
} /* end of loop over timesteps */ } /* end of loop over timesteps */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
if (MYID==0){
fprintf(FP,"\n **Info from main (written by PE %d): \n",MYID);
time4=MPI_Wtime();
fprintf(FP," Total real time of the FD-Code: %4.2f seconds.\n",time4-time1);
}
fprintf(FP, "\n\n *********** Finish TIME STEPPING ****************\n"); fprintf(FP, "\n\n *********** Finish TIME STEPPING ****************\n");
fprintf(FP, " **************************************************\n\n"); fprintf(FP, " **************************************************\n\n");
...@@ -1383,8 +1398,8 @@ int main(int argc, char **argv){ ...@@ -1383,8 +1398,8 @@ int main(int argc, char **argv){
if (MYID==0){ if (MYID==0){
fprintf(FP,"\n **Info from main (written by PE %d): \n",MYID); fprintf(FP,"\n **Info from main (written by PE %d): \n",MYID);
time4=MPI_Wtime(); time4=MPI_Wtime();
fprintf(FP," Total real time of program: %4.2f seconds.\n\n",time4-time1); fprintf(FP," Total real time of program: %4.2f seconds.\n\n",time4-time1);
fprintf(FP," ******************************************************\n"); fprintf(FP," ******************************************************\n");
fprintf(FP," **************** SOFI3D has finished *****************\n"); fprintf(FP," **************** SOFI3D has finished *****************\n");
fprintf(FP," ******************************************************\n\n"); fprintf(FP," ******************************************************\n\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment