<!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>
Dear all,<BR>
<BR>
Somewhere in my boundary element solver I have a console progress bar which prints to screen the progress of an operation.<BR>
It looks like this:<BR>
INFO : 50% [------------> ]<BR>
<BR>
The function is very simple:<BR>
//i is the current iteration number <BR>
//n is the total number of iterations<BR>
void progressBar(int x, int n)<BR>
{<BR>
<BR>
if ( x % (n/100) != 0 ) return;<BR>
<BR>
// Calculate the ratio of complete-to-incomplete.<BR>
float ratio = x/(float)n;<BR>
int c = ratio * 80<BR>
<BR>
// Show the percentage complete.<BR>
printf("INFO :\t%3d%% [", (int)(ratio*100) );<BR>
<BR>
// Show the load bar.<BR>
for (int x=0; x<c-1; x++)<BR>
printf("-");<BR>
<BR>
printf(">");<BR>
<BR>
for (int x=c; x<pBarWidth; x++)<BR>
printf(" ");<BR>
<BR>
// ANSI Control codes to go back to the<BR>
// previous line and clear it.<BR>
printf("]\n\033[F\033[J");<BR>
}<BR>
<BR>
<BR>
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).<BR>
I tried to play with fflush(stdout) commands without any success.<BR>
<BR>
Any ideas ?<BR>
<BR>
Thanks,<BR>
Thomas Leissing
</BODY>
</HTML>