[mpich-discuss] I: Re: Problem to run MPICH2 on Windows 7 with user interface
Nicolas Rosner
nrosner at gmail.com
Mon Apr 18 11:41:36 CDT 2011
Ciao Rosa,
> Unfortuntely my problem is not with I/O on files, but with
> standard output and with user interface.
If you're running into problems when trying to run the simplest case
you've described (a basic "hello world" program that only uses
stdout), may I suggest it could be a good idea to focus exclusively on
that before mixing in additional issues?
Although it is possible for an MPI-enhanced program to use a GUI
library, it may not be trivial to get that right initially. And, while
creating and writing to files is usually easier than GUI stuff, it's
still not as trivial as simply writing to standard output.
The latter is indeed trivial, and should be handled automagically for
you, including the multiplexing of each rank's stdout (i.e. output
should look as if your main mpiexec process had carried out each
printf locally).
If your simplest example still fails to work properly when run under
mpiexec, could you please retry with a copy of the standard "hellow.c"
code (see below) to see whether any problems persist?
Regards,
Nicolás
#include <stdio.h>
#include "mpi.h"
int main( int argc, char *argv[] )
{
int rank, size;
MPI_Init( 0, 0 );
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
printf( "Hello world from process %d of %d\n", rank, size );
MPI_Finalize();
return 0;
}
>> I write the "hello word" test program. The MPICH2 library is linked
>> and there is no problem to run the program (without call mpiexec)
>> from my compiler, obviously it starts with only 1 process and it
>> prints "Hello word from node 0" on stdout.
>> If I try to start the program from command line (MS-DOS shell) with
>> the following command
>> mpiexec -n 4 Test.exe
>> 4 processes of test.exe start (I can see them in the Windows Task
>> Manager) but the output does not appear, the command prompt is
>> indefinitely locked until I press CTRL-C to stop processes.
More information about the mpich-discuss
mailing list