Commit 62e2ab25 authored by Johannes Spazier's avatar Johannes Spazier
Browse files

Write output file to disk before printing last progress.

parent fee0295a
......@@ -123,14 +123,6 @@ int main( int argc, char **argv )
elapsed = ((int)clock())/CLOCKS_PER_SEC;
if( Par.outProgress ) {
if( lastProgress >= Par.outProgress ) {
printf( "Model time = %s, elapsed: %ld msec\n", utlTimeSplitString(Par.time), clock()/(CLOCKS_PER_SEC/1000) );
Log.print( "Model time = %s, elapsed: %ld msec", utlTimeSplitString(Par.time), clock()/(CLOCKS_PER_SEC/1000) );
lastProgress = 0;
}
}
if( Par.outPropagation ) {
if( lastPropagation >= Par.outPropagation ) {
Node.copyIntermediate();
......@@ -139,31 +131,28 @@ int main( int argc, char **argv )
}
}
fflush( stdout );
if( Par.outDump ) {
if( (elapsed-lastDump) >= Par.outDump ) {
if( Par.outDump && (elapsed-lastDump) >= Par.outDump || Par.time >= Par.timeMax ) {
Node.copyIntermediate();
/* FIXME: needs tArr as well */
Node.copyFromGPU();
ewDumpPOIs();
ewDump2D();
lastDump = elapsed;
}
if( Par.outProgress ) {
if( lastProgress >= Par.outProgress ) {
printf( "Model time = %s, elapsed: %ld msec\n", utlTimeSplitString(Par.time), clock()/(CLOCKS_PER_SEC/1000) );
Log.print( "Model time = %s, elapsed: %ld msec", utlTimeSplitString(Par.time), clock()/(CLOCKS_PER_SEC/1000) );
lastProgress = 0;
}
}
fflush( stdout );
} // main loop
clock_gettime(CLOCK_MONOTONIC, &end);
Log.print("Finishing main loop");
/* TODO: check if theses calls can be combined */
Node.copyIntermediate();
Node.copyFromGPU();
// Final output
Log.print("Final dump...");
ewDumpPOIs();
ewDump2D();
Node.freeMem();
printf_v("Runtime: %.3lf\n", diff(start, end) * 1000.0);
......
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