<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.32.1">
</HEAD>
<BODY>
Sure, ticket # is 1566.<BR>
Thomas<BR>
<BR>
<BR>
-------- Message initial --------<BR>
<B>De</B>: Pavan Balaji <<A HREF="mailto:Pavan%20Balaji%20%3cbalaji@mcs.anl.gov%3e">balaji@mcs.anl.gov</A>><BR>
<B>À</B>: <A HREF="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</A><BR>
<B>Cc</B>: Thomas Leissing <<A HREF="mailto:Thomas%20Leissing%20%3cthomas.leissing@cstb.fr%3e">thomas.leissing@cstb.fr</A>><BR>
<B>Sujet</B>: Re: [mpich-discuss] MPI_Init() and console output<BR>
<B>Date</B>: Tue, 27 Dec 2011 02:24:01 -0600<BR>
<BR>
<PRE>
Hi Thomas,
I looked through the code. Our internal code seems to be buffering data
in this case and not writing it out. I wrote that piece of code, but
don't remember why it is this way. Maybe it's just a bug. But I'll
need to think through it some more.
Can you file a ticket so we don't lose track of this issue?
<A HREF="https://trac.mcs.anl.gov/projects/mpich2/newticket">https://trac.mcs.anl.gov/projects/mpich2/newticket</A>
-- Pavan
On 12/14/2011 06:43 AM, Thomas Leissing wrote:
> Dear all,
>
> Somewhere in my boundary element solver I have a console progress bar
> which prints to screen the progress of an operation.
> It looks like this:
> INFO : 50% [------------> ]
>
> The function is very simple:
> //i is the current iteration number
> //n is the total number of iterations
> void progressBar(int x, int n)
> {
>
> if ( x % (n/100) != 0 ) return;
>
> // Calculate the ratio of complete-to-incomplete.
> float ratio = x/(float)n;
> int c = ratio * 80
>
> // Show the percentage complete.
> printf("INFO :\t%3d%% [", (int)(ratio*100) );
>
> // Show the load bar.
> for (int x=0; x<c-1; x++)
> printf("-");
>
> printf(">");
>
> for (int x=c; x<pBarWidth; x++)
> printf(" ");
>
> // ANSI Control codes to go back to the
> // previous line and clear it.
> printf("]\n\033[F\033[J");
> }
>
>
> My problem is that the progress bar doesn't print to screen as soon as I
> call the MPI_Init() function (it works fine otherwise).
> I tried to play with fflush(stdout) commands without any success.
>
> Any ideas ?
>
> Thanks,
> Thomas Leissing
>
>
> _______________________________________________
> mpich-discuss mailing list <A HREF="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</A>
> To manage subscription options or unsubscribe:
> <A HREF="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</A>
</PRE>
</BODY>
</HTML>