Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

MPI delayed stdout

italo1337
Beginner
1,397 Views

When I run my MPI code, the printf's are not displayed immediately. They are displayed all at once when the program terminates.

 Is there a way to remove this delay and print things immediately?

0 Kudos
6 Replies
James_T_Intel
Moderator
1,397 Views
It italo, Does your operating system buffer output? Sincerely, James Tullos Technical Consulting Engineer Intel® Cluster Tools
0 Kudos
italo1337
Beginner
1,397 Views
When I run the program without mpiexec, it doesn't buffer. It displays the output immediately. When I use mpiexec, it only shows the result when the program finishes. It happens only on Windows 7. On Linux it's ok.
0 Kudos
James_T_Intel
Moderator
1,397 Views
Hi italo, Got it. I'm seeing the same behavior, let me see if there's a simple fix for this. Sincerely, James Tullos Technical Consulting Engineer Intel® Cluster Tools
0 Kudos
James_T_Intel
Moderator
1,397 Views
Hi italo, Are you flushing stdout after your printf calls? Sincerely, James Tullos Technical Consulting Engineer Intel® Cluster Tools
0 Kudos
italo1337
Beginner
1,397 Views
Thank you. fflush(stdout) worked.
0 Kudos
James_T_Intel
Moderator
1,397 Views
Hi italo, Good. Please feel free to contact us again if there are any future concerns. Sincerely, James Tullos Technical Consulting Engineer Intel® Cluster Tools
0 Kudos
Reply