LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2005-02-09 09:45:35


On Feb 9, 2005, at 9:17 AM, Eiso AB wrote:

> I installed the svn tarball, compiled using FC=ifort (intel-8.0)
> then recompiled cyana using the new mpif77, and tried again.
> Alas it still gives me the cyana prompt instead of executing
> the commands from erract to EOF
>
> this is the script I'm trying to run
> ===================================
> #!/bin/sh
> cd /home/eiso/BUG
> date +'%d-%b-%Y %H:%M:%S'
> lamboot -v $NODEFILE
> cyana -t intel-lam -c 'mpirun -x CYANALIB -np 5' << EOF

I'm afraid that I don't know anything about cyana. I can tell you that
all LAM does is redirect the stdin of mpirun, not of your cyana
program. So your <<EOF stuff should work properly to the top-level
cyana application, as far as I can tell (but not necessarily to
mpirun).

But then again, cyana could be doing some odd things with its stdin; I
really have no idea what it is *supposed* to do when you <<EOF things
to it...?

You can test the basic functionality of the stdin redirection in LAM
with the following simple program:

-----
#include <stdio.h>
#include <mpi.h>

int main(int argc, char* argv[])
{
     int rank;
     char str[BUFSIZ];

     MPI_Init(NULL, NULL);
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
     if (0 == rank) {
         while (fgets(str, BUFSIZ, stdin)) {
             printf("MCW rank 0 got string: %s", str);
         }
         printf("EOF detected -- goodbye!\n");
     }
     MPI_Barrier(MPI_COMM_WORLD);
     MPI_Finalize();
     return 0;
}
-----

For example:

-----
[9:41] queeg:~/mpi % mpicc string.c -o string
[9:41] queeg:~/mpi % mpirun -np 1 ./string << EOF
? foo
? bar
? baz
? EOF
MCW rank 0 got string: foo
MCW rank 0 got string: bar
MCW rank 0 got string: baz
EOF detected -- goodbye!
[9:41] queeg:~/mpi %
-----

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/