[mpich-discuss] scanf with MPICH2 for Win7

Alejandro Allievi alejandro.allievi at gmail.com
Thu Mar 22 16:25:49 CDT 2012


Hi,

I'm running a Get-input(...) function that takes input from stdin with
the following code  snippet
......

   if (my_rank == 0) {
      printf("Enter a, b, and n\n");
      scanf("%lf %lf %d", a_p, b_p, n_p);
...
}

It compiles and runs giving the right result, no problem. HOWEVER, the
scanf seems to execute before the printf. In other words, when I run
the program I need to enter a, b and n and then "Enter a, b, and n"
appears on my screen, and the program runs correctly to completion. It
does not happen in UNIX, only happens in MPICH2 for Win7 64bit.

Has anybody encountered this problem or has any hints on its cause???

Thank you.

Alex


More information about the mpich-discuss mailing list