[GE users] Question concerning MPI_UNIVERSE_SIZE

Rainer M Krug r.m.krug at gmail.com
Wed Nov 26 09:36:48 GMT 2008


Hi

I have the following C program:

## C_rainer.c
#include <stdio.h>
#include "mpi.h"

int main(int argc, char** argv)
{
    int rank, size, nameLen;
    char processorName[MPI_MAX_PROCESSOR_NAME];

    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    MPI_Get_processor_name(processorName, &nameLen);

    int *MPI_Universe_Size;
    int univ_flag;
    MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE,
&MPI_Universe_Size, &univ_flag);

    printf("Hello, rank %d, size %d on processor %s\n", rank,
size,processorName);
    printf("Universe Size %d\n", *MPI_Universe_Size);
    MPI_Finalize();
    return 0;
}

when I compile it with mpicc (openmpi_gnu) and execute it, I get the
following output:

rkrug at head001:~/Documents/examples/C_MPI> ./mpi_rainer
Hello, rank 0, size 0 on processor head001
Universe Size 1
rkrug at head001:~/Documents/examples/C_MPI>

Should that not be Universe Size equals the number of nodes? Because
this is the reason why I don't get Rmpi in R to work: it only sees the master
(head001).

When I use qsub, I get the following:
Hello, rank 0, size 0 on processor comp019
Universe Size 1
Hello, rank 0, size 0 on processor comp019
Universe Size 1
Hello, rank 0, size 0 on processor comp019
Universe Size 1
Hello, rank 0, size 0 on processor comp004
Universe Size 1
Hello, rank 0, size 0 on processor comp019
Universe Size 1
Hello, rank 0, size 0 on processor comp004
Universe Size 1
Hello, rank 0, size 0 on processor comp019
Universe Size 1
Hello, rank 0, size 0 on processor comp004
Universe Size 1
Hello, rank 0, size 0 on processor comp019
Universe Size 1
Hello, rank 0, size 0 on processor comp019
Universe Size 1
Hello, rank 0, size 0 on processor comp004
Universe Size 1
Hello, rank 0, size 0 on processor comp019
Universe Size 1
Hello, rank 0, size 0 on processor comp004
Universe Size 1
Hello, rank 0, size 0 on processor comp004
Universe Size 1
Hello, rank 0, size 0 on processor comp004
Universe Size 1
Hello, rank 0, size 0 on processor comp004
Universe Size 1

which is more or less what I expected (only that each node has a
quadcore, and I would somehow expect to get 4 for the Universe size)

Is this a setup issue of openMPI?

Thanks

Rainer
-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Faculty of Science
Natural Sciences Building
Private Bag X1
University of Stellenbosch
Matieland 7602
South Africa

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=89913

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list