LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Pushkar Pradhan (pushkar_at_[hidden])
Date: 2004-06-20 13:11:19


Maybe C++ support wasn't build when compiling.
If you have lam 7.x.x version, you can run laminfo and find out if you have
C++ support built?
Pushkar

> -----Original Message-----
> From: lam-bounces_at_[hidden] [mailto:lam-bounces_at_[hidden]]On Behalf
> Of Hiroshi Higuchi (2247990)
> Sent: Sunday, June 20, 2004 9:41 AM
> To: lam_at_[hidden]
> Subject: LAM: Running C++ MPI application on multiple nodes
>
>
> Hi,
>
> I have a problem running mpi C++ executable on multiple nodes.
>
> I wrote a simple HellowWorld application in C++. Unfortunately, it only
> runs on the local node and does not run on remote nodes. The exact same
> program in C works fine on multiple nodes.
>
> <Output from running C helloworld>
> $ mpicc hello.c -o helloC
> $ mpirun -np 5 helloC
> Hello, world! I am 0 of 5.
> Hello, world! I am 1 of 5.
> Hello, world! I am 3 of 5.
> Hello, world! I am 2 of 5.
> Hello, world! I am 4 of 5.
>
> <Output from running C++ helloworld>
> $ mpic++ hello.cpp -o helloCpp
> $ mpirun -np 5 helloCpp
> Hello, I am 0 of 1
>
>
> I found a similar problem in the mailing list
> (http://www.lam-mpi.org/MailArchives/lam/msg04970.php), however I can
> run individual executable on each node and mpirun does not throw any
> error message at all.
>
> All nodes run the same LAM version and file system on Linux kernel 2.4.26.
> I also attached output from lamboot and lamnodes and C/C++ hello world
> program at the end of this mail.
>
> I want to develop C++ application, so I really appreciate if
> somebody could
> help me out here.
>
> Thank you.
> Hiroshi
>
> $ lamboot -v hostfile
>
> LAM 7.0.6/MPI 2 C++/ROMIO - Indiana University
>
> n-1<8803> ssi:boot:base:linear: booting n0 (weill.cse.unsw.edu.au)
> n-1<8803> ssi:boot:base:linear: booting n1 (vina01.cse.unsw.edu.au)
> n-1<8803> ssi:boot:base:linear: booting n2 (vina02.cse.unsw.edu.au)
> n-1<8803> ssi:boot:base:linear: booting n3 (vina03.cse.unsw.edu.au)
> n-1<8803> ssi:boot:base:linear: booting n4 (vina04.cse.unsw.edu.au)
> n-1<8803> ssi:boot:base:linear: finished
>
> $ lamnodes
> n0 weill.orchestra.cse.unsw.EDU.AU:1:origin,this_node
> n1 vina01.orchestra.cse.unsw.EDU.AU:1:
> n2 vina02.orchestra.cse.unsw.EDU.AU:1:
> n3 vina03.orchestra.cse.unsw.EDU.AU:1:
> n4 vina04.orchestra.cse.unsw.EDU.AU:1:
>
> hello.c
> ----------------------------------------------------------------------
> #include <stdlib.h>
> #include <mpi.h>
>
> int main(int argc, char *argv[]) {
> int rank, size;
>
> MPI_Init(&argc, &argv);
> MPI_Comm_rank(MPI_COMM_WORLD, &rank);
> MPI_Comm_size(MPI_COMM_WORLD, &size);
>
> printf("Hello, world! I am %d of %d.\n", rank, size);
>
> MPI_Finalize();
> return 0;
> }
> ----------------------------------------------------------------------
>
> hello.cpp
> ----------------------------------------------------------------------
> #include <iostream>
> #include <mpi.h>
>
> using namespace std;
>
> int main(int argc, char* argv[]) {
> MPI::Init(argc, argv);
> cout << "Hello, I am " << MPI::COMM_WORLD.Get_rank();
> cout << " of " << MPI::COMM_WORLD.Get_size();
>
> MPI::Finalize();
> return 0;
> }
> ----------------------------------------------------------------------
>
> ----------------------------------------------------
> Hiroshi Higuchi <hiroshih_at_[hidden]>
> ----------------------------------------------------
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/