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

Reply via email to