Opened 6 years ago

Last modified 2 years ago

#1566 accepted bug

Buffered data not printed

Reported by: thomas.leissing@… Owned by: balaji
Priority: major Milestone: mpich-3.3
Component: mpich Keywords:
Cc:

Description (last modified by balaji)

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.

Change History (7)

comment:1 Changed 6 years ago by balaji

  • Milestone set to mpich2-1.5
  • Owner set to balaji
  • Status changed from new to accepted

comment:2 Changed 5 years ago by balaji

  • Milestone changed from mpich2-1.5 to mpich2-1.5.1

comment:3 Changed 5 years ago by balaji

  • Milestone changed from mpich2-1.5.1 to mpich-3.0

Milestone mpich2-1.5.1 deleted

comment:4 Changed 5 years ago by balaji

  • Milestone changed from mpich-3.0 to mpich-3.0.1

comment:5 Changed 4 years ago by balaji

  • Description modified (diff)
  • Milestone changed from mpich-3.1 to mpich-3.1.1

comment:6 Changed 3 years ago by balaji

  • Milestone changed from mpich-3.1.4 to mpich-3.2

Milestone mpich-3.1.4 deleted

comment:7 Changed 2 years ago by balaji

  • Milestone changed from mpich-3.2.1 to mpich-3.3

Milestone mpich-3.2.1 deleted

Note: See TracTickets for help on using tickets.