Problem 1644 - G4MTcoutDestination does not flush output streams
Summary: G4MTcoutDestination does not flush output streams
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: global/management (show other problems)
Version: 10.0
Hardware: All All
: P5 trivial
Assignee: Andrea Dotti
URL:
Depends on:
Blocks:
 
Reported: 2014-06-23 00:07 CEST by Andrea Dotti
Modified: 2014-07-21 18:34 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Andrea Dotti 2014-06-23 00:07:12 CEST
G4MTcoutDestination::ReceiveCout and ReceiveCerr do not add std::flush after adding to output. This may cause issues (apparent missing output) if the application is started with buffering of cout/cerr (for example if application is started in a python wrapper).
Methods should be modified adding:

       finalcout<<prefix<<id
     //         <<" "<<G4StateManager::GetStateManager()->GetStateString(sta)
-             <<" > "<<msg;
+	       <<" > "<<msg<<std::flush

I do realize this is quite a corner case. But we should fix that.

Andrea
Comment 1 Andrea Dotti 2014-06-23 00:08:00 CEST
I will take care of fixing this issue.
I report here for book-keeping.

Andrea
Comment 2 Andrea Dotti 2014-07-01 23:32:35 CEST
Tag global-V10-00-26 proposed for testing.
Comment 3 Andrea Dotti 2014-07-21 18:34:03 CEST
Fix implemented in tag global-V10-00-26.