Hi Raymond,

Raymond wrote:

>
> Hi Heitor,
>
>
> Heitor Florido wrote:
> > I have installed OpenMPI on both computers and my application works on on
> > both of them, but when I try to communicate between them, the method
> > MPI_Lookup_name can't resolve the name published by the other machine.
> >
> > I've tried to run the example from mpi-forum that uses MPI_Open_port too,
> > but it didn't work either.
> > After reading about it on some FAQs e some other threads from the forum,
> I
> > believe that I need to config my ssh options.
> >
> >
>
> Honestly, when I installed Open MPI, I didn't perform any configuration
> of the ssh options, as far as I can remember.  I'm not sure if someone
> else can help you.  I can imagine networks being set up incorrectly, but
> I can't imagine what incorrect ssh option there would be to prevent one
> computer from finding another.  In addition to some FAQs, Gus suggested
> running a simple example called hello_c.c.  Have you tried that?
>

Yes, I've tried to execute hello_c.c and it worked fine.
Here's the outcome :

heitor@heitor-desktop:~/Desktop/untitled folder$ mpiexec -n 3 hello
Hello, world, I am 1 of 3
Hello, world, I am 0 of 3
Hello, world, I am 2 of 3

It might help if you ran some existing code
> (such as http://mpi.deino.net/mpi_functions/MPI_Lookup_name.html), too.
>
> Ray
>

I've executed the code example from
http://mpi.deino.net/mpi_functions/MPI_Lookup_name.html
and it didn't wrote anything on the terminal. Reading the code I've realized
that it shouldn't be any printf.
I believe that's OK.
<http://mpi.deino.net/mpi_functions/MPI_Lookup_name.html>
>
>

> It is hard to give any suggestions unless you give more information such
> as a shortened version of your source code and what is the command line
> that you ran mpirun with.


Here's some pieces of my code:

Server:
void Servidor::iniciaServidor(){

    bool sair = false;
    int valorRecebido, valorEnviado;
    MPI_Status s;
    char porta[MPI_MAX_PORT_NAME];
    char nomeServico[25];

    strcpy (nomeServico,"GEAR-TRAINING_CENTER" );
    MPI_Open_port(MPI_INFO_NULL, porta);
    MPI_Publish_name(nomeServico, MPI_INFO_NULL, porta);
    printf ("%s\n", porta);

    while (true){

        MPI_Comm_accept(porta, MPI_INFO_NULL, 0, MPI_COMM_WORLD,
&comunicadorInterface);
        printf ("Conexao aceitada!\n");

...

}

Client:
void InterfaceUsuario::conectaServidor (){

    char porta[MPI_MAX_PORT_NAME];
    char nomeServico[25];

    strcpy (nomeServico, "GEAR-TRAINING_CENTER");
    MPI_Lookup_name(nomeServico, MPI_INFO_NULL, porta);
    MPI_Comm_connect( porta, MPI_INFO_NULL, 0, MPI_COMM_WORLD,
&this->comunicadorServidor );

}

If you need the rest of the code, just tell me and I will post it. :D

[]s

Heitor

Reply via email to