[mpich2-dev] about (closed) ticket #449 and request access to track

Lisandro Dalcin dalcinl at gmail.com
Wed Mar 11 16:28:18 CDT 2009


First of all, Any chance I could make comments on MPICH2's Trac?

Second, about my recent (and now closed) ticket #449 ...

My patch is the only robust way I can imagine of doing things...

1) MPI guarantees that when COMM_SELF's free keyval callbacks are
called, the MPI environment is intact. So we should be able to call
MPI_Keyval_free() on cleanup callbacks.

2) Eager freeing (after Attr_put) wil NOT work ... I've already tried
this ;-) ... MPICH2 seems to reuse keyval values... If you free() a
keyval, and next create() other... you the new keyval value is the
equal to the former... Try the code below.


IMHO, you closed my ticket too fast ... ;-)
Moreover, take into account that I've really tested the patch before
posting it :-) ...


#include <mpi.h>
#include <stdio.h>
int main( int argc, char ** argv ) {
  int Key1, tmp1, Key2, tmp2;
  MPI_Init(&argc, &argv);

  MPI_Keyval_create(MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN, &Key1,(void *) 0);
  tmp1=Key1;
  MPI_Keyval_free(&tmp1);

  MPI_Keyval_create(MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN, &Key2, (void *) 0);
  tmp2=Key2;
  MPI_Keyval_free(&tmp2);

  MPI_Finalize();

  printf("MPI_KEYVAL_INVALID: %d\n", MPI_KEYVAL_INVALID);

  printf("Key1: %d\n", Key1);
  printf("tmp1: %d\n", tmp1);

  printf("Key2: %d\n", Key2);
  printf("tmp2: %d\n", tmp2);

  return 0;
}


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594


More information about the mpich2-dev mailing list