It looks like you have a heterogeneous setup -- the error is complaining that the executable you compiled on one machine will not run on the other because the executable format is different.

You'll probably need to have different executables compiled for each node (there's probably other ways to do it, but this is likely the simplest). You probably also need separate OMPI installations on each node -- make sure that the versions are the same. It is probably easiest if the OMPI that is found in the default path on each node is the one relevant for that platform. For example, see:

    http://www.open-mpi.org/faq/?category=building#where-to-install

Also, if you build two different pi programs, you might want to do something like this:

   hardy$ mpicc pi.c -o pi.hardy

   lenny$ mpicc pi.c -o pi.lenny
lenny$ mpiexec -np 2 --host lenny pi.lenny : -np 1 --host hardy pi.hardy

Where the ":" effectively separates clauses on the mpiexec command line; you end up launching pi.lenny on the lenny box and pi.hardy on the hardy box.


On May 9, 2009, at 11:42 AM, Venu Gopal wrote:

I am venu,

I have tried to setup a simple 2 node openmpi system.

on two machines one is running debian lenny (ip 10.0.3.1)
other is running ubuntu hardy (ip 10.0.3.3)

I am getting error when i try to execute a file using mpiexec, i am sure password is correct. as ssh is working and the file pi3 is in directory code which in turn is in my home directory venu.

the file pi.c is below



/* To run this program: */ / *--------------------- */ / * */ / * */ /* Issue: time mpirun -np [nprocs] ./pi (SGI, Beowulf) */ / * */ / * */ /* ------------------------------------------------------------------ */

#include <stdio.h>
#include <stdlib.h>

#include "mpi.h"

int main(int argc, char *argv[])
{
      int    i, n;
      double h, pi, x;

      int    me, nprocs;
      double piece;

/* --------------------------------------------------- */

      MPI_Init (&argc, &argv);

      MPI_Comm_size (MPI_COMM_WORLD, &nprocs);
      MPI_Comm_rank (MPI_COMM_WORLD, &me);

/* --------------------------------------------------- */

      if (me == 0)
      {
         printf("%s", "Input number of intervals:\n");
         scanf ("%d", &n);
      }

/* --------------------------------------------------- */

      MPI_Bcast (&n, 1, MPI_INT,
                 0, MPI_COMM_WORLD);

/* --------------------------------------------------- */

      h     = 1. / (double) n;

      piece = 0.;

      for (i=me+1; i <= n; i+=nprocs)
      {
           x     = (i-1)*h;

           piece = piece + (
                                   4/
                              (1+(x)*(x))
                                   +
                                   4/
                              (1+(x+h)*(x+h))
                                               ) / 2 * h;
      }

      printf("%d: pi = %25.15f\n", me, piece);

/* --------------------------------------------------- */

      MPI_Reduce (&piece, &pi, 1, MPI_DOUBLE,
                  MPI_SUM, 0, MPI_COMM_WORLD);

/* --------------------------------------------------- */

      if (me == 0)
      {
         printf("pi = %25.15f\n", pi);
      }

/* --------------------------------------------------- */

      MPI_Finalize();

      return 0;
}



the code directory is nfs shared and mounted on the client system which is 10.0.3.3.
the server system is 10.0.3.1

i can ping the client from server and also server from client. ssh is working bothways.

the /etc/openmpi/openmpi-default-hostfile is having the line on the first node ie. 10.0.3.1

10.0.3.3 slots=2


the other nodes file is just empty. i mean only comments are there.


this is the error is get when i execute.


venu@mainframe:~$ mpiexec -np 3 ./code/pi3
venu@10.0.3.3's password:
--------------------------------------------------------------------------
Could not execute the executable "./code/pi3": Exec format error

This could mean that your PATH or executable name is wrong, or that you do not have the necessary permissions. Please ensure that the executable is able to be
found and executed.

--------------------------------------------------------------------------
--------------------------------------------------------------------------
Could not execute the executable "./code/pi3": Exec format error

This could mean that your PATH or executable name is wrong, or that you do not have the necessary permissions. Please ensure that the executable is able to be
found and executed.

--------------------------------------------------------------------------
--------------------------------------------------------------------------
Could not execute the executable "./code/pi3": Exec format error

This could mean that your PATH or executable name is wrong, or that you do not have the necessary permissions. Please ensure that the executable is able to be
found and executed.

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



now, when i remove that line from /etc/openmpi/openmpi-default- hostfile on the first node

the program compiles and executes on the first node node.

same, when i compile it and execute it on the second node, it works.

only problem is when i try to run it on both.

i get the error mesage as above.


someone, please help me. as i am trying to setup this system for the first time.

and i am stuck.

i am fairly good with linux. so i know my way around linux. but am stuck with open mpi.
--

Regards,

Venu Gopal



_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users


--
Jeff Squyres
Cisco Systems

Reply via email to