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.

Subject: [OMPI users] MPI_Comm_dup hangs
From: Prentice Bisbal (prentice_at_[hidden])
Date: 2010-02-03 13:59:20

I have a problem with MPI_Comm_dup. When I call it in a function, it
causes my application to hang. Are they any common causes for a problem
like this? I'm using OpenMPI 1.2.8. Are there any known bugs that could
be causing this?

My program seems to hang when it gets to MPI_Comm_dup. Here's an example
of how I'm using it.

#include "foo.h"

/* MPI variables */
int my_rank;
int num_proc;
MPI_Comm euclid_comm;

void foo(long *arg1, long *arg2, MPI_Comm old_comm);

int main (int argc, char** argv) {

  /* get options */

  MPI_Init(&argc, &argv);
  MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
  MPI_Comm_size(MPI_COMM_WORLD, &num_proc);

 /* read in some data, yadda, yadda yadda */

 foo(&arg1, &arg2, MPI_COMM_WORLD);

 / *print results from foo */



void foo(long *arg1, long *arg2, MPI_Comm old_comm)
  MPI_Comm foo_comm;
  int foo_my_rank;
  int foo_num_proc;

  MPI_Comm_dup(old_comm, &foo_comm);
  MPI_Comm_rank(foo_comm, &foo_my_rank);
  MPI_Comm_size(foo_comm, &foo_num_proc);

  /* do stuff */