LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Davide Cesari (dcesari_at_[hidden])
Date: 2004-06-23 04:58:03


Well, if the output should really go to the local console, rather that to the
server, then you should fopen a local device (like /dev/console) and fprintf
to that rather than printing to stdout, which otherwise flows to the stdout of
the main MPI process at the server console.
        best wishes, Davide

On 23 Jun 2004, Henning Martinussen wrote:

>
> On Wed, 2004-06-23 at 07:28, thiranji perera wrote:
> > To whom it may concern,
> >
> > I'm tryinng to display results of my parallel application on all
> > the machines. I'm using LAM version 6.5.8 on Linux platform. Normally
> > the results are displayed only at the server console( the machine your
> > are running your program).
> >
> > // my LAM program
> >
> > int main (int argc, char * argv[]){
> > int myId,p;
> >
> > MPI_Comm_size(MPI_COMM_WORLD, &p);
> > MPI_Comm_rank(MPI_COMM_WORLD, &myId);
> >
> > printf("Hello World.... from processes %d \n", myId);
> >
> > MPI_Finalize();
> > return 0;
> > }
> >
> > This is the main of the program I need to run by creating 2 processes
> > on two different machines. Both machines should print Hello World ...
> > from processes Id on console in own machine. If U have any idea of how
> > to do this please mail me.
>
>
> You need to call MPI_Init before calling any other MPI-functions.
> Add that line and you should be up and running :-)
>
> -----------------------------------------
> #include <stdio.h>
> #include "mpi.h"
>
>
> int main (int argc, char **argv) {
> int myId,p;
>
> MPI_Init(&argc, &argv);
> MPI_Comm_size(MPI_COMM_WORLD, &p);
> MPI_Comm_rank(MPI_COMM_WORLD, &myId);
>
> printf("Hello World.... from processes %d \n", myId);
>
> MPI_Finalize();
> return 0;
> }
> ----------------------------