[mpich-discuss] command line ordering of hosts matters?

David_Lowinger at ea.epson.com David_Lowinger at ea.epson.com
Tue Jun 29 17:53:07 CDT 2010


Hi,
When running a very basic "hello world" app, I've found that the app's 
behavior depends on the order I use for hosts in the command line.  For 
example, if I use:

mpiexec -hosts 2 10.0.0.6 1 10.0.0.101 1 helloworld.exe

The program executes flawlessly.  But, if I use:

mpiexec -hosts 2 10.0.0.101 1 10.0.0.6 1 helloworld.exe

then the program never gets past the call to "MPI_Bcast()".  Here is my 
code:

-------------------

#include "mpi.h"

#define MPI_FLUSH()             fflush(stdout)

int main( int argc, char* argv[] )
{
        int g_Thread_ID, g_Num_Threads;
        int test = 0;

        /**************************************************\ 
         * MPI Initialization   *
        \**************************************************/
    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &g_Thread_ID);
    MPI_Comm_size(MPI_COMM_WORLD, &g_Num_Threads);

        printf("thread %d: main: About to execute MPI_Bcast\n", 
g_Thread_ID);
        MPI_FLUSH();

        // Broadcast integer
        int err = MPI_Bcast(&test, 1, MPI_INT, 0, MPI_COMM_WORLD);

        printf("thread %d: completed MPI_Bcast\n", g_Thread_ID);
        MPI_FLUSH();

        MPI_Finalize();
}

------------------

I am running Windows Vista on both machines.  Has anyone seen this before? 
 Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20100629/86b5ac0e/attachment.htm>


More information about the mpich-discuss mailing list