Paired with the comment about MPI_Init(), this comment is right on track.
LAM is setup to forward I/O back to the stdout/stderr of mpirun. It is
not setup to send I/O to the console of each machine. Using tricks like
this (reopening fd's 0 and 1 to /dev/console, or something along those
lines) is really the only way you can do that.
You'll likely have permissions issues, though -- /dev/console may or may
not allow you to open it, depending on the user who owns it (e.g., who is
logged in at the time).
On Wed, 23 Jun 2004, Davide Cesari wrote:
> 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;
>> }
>> ----------------------------
>
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|