Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

From: Laurent.POREZ_at_[hidden]
Date: 2006-06-06 05:48:37


Hi,

I'm using Open-MPI 1.0.2 on a debian system.

I'm testing the MPI_recv function with a small C program (source code at the end of the message). And I see that when I'm waiting a message, calling MPI_recv, the CPU is used at 100 %.

Is that normal ?
Is there other ways to use a recv function (irecv, etc) that is not using the CPU ?

        Laurent.

Source code :

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

int main(int argc, char *argv[])
{
        int rc;
        int numtasks, rank;
        int myint = 0;
        
        rc = MPI_Init(&argc, &argv);
        if(rc != 0) {
                printf("open error\n");
                MPI_Abort(MPI_COMM_WORLD, rc);
        }
        
        MPI_Comm_size(MPI_COMM_WORLD, &numtasks);
        MPI_Comm_rank(MPI_COMM_WORLD, &rank);
        
        printf("from cpu_test : number of tasks : %d. My rank :%d\n", numtasks, rank);
        
                
        MPI_Recv(&myint, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, NULL);
        
        printf("message received\n");
        
        MPI_Finalize();
        
        exit(0);
}