I am trying to understand how communicator attributes work, so I found http://stackoverflow.com/questions/25198353/callbacks-provided-in-mpi-comm-create-keyval-are-not-called, which contains a nice example (the code in http://stackoverflow.com/a/25205611/2189128).

However, the posted output of this code is:

$ mpirun -np 1 ./comm-attr
In ibcast_copy: keyval = 10
In ibcast_delete: keyval = 10
In ibcast_delete: keyval = 10

Whereas I observe:

$ mpirun -np 1 ./a.out
In ibcast_copy: keyval = -1539309568
In ibcast_delete: keyval = -1539309568

Can anyone help me understand what the correct output of this program is?  If it is not what I am seeing, is this a bug in MPICH or am I doing something wrong?

I am using MPICH git from November 2015, so I will git pull && ./autogen.sh && $CONFIGUREMAKEINSTALL and try again just to be sure.

Thanks,

Jeff

$ mpirun --version
HYDRA build details:
    Version:                                 3.2
    Release Date:                            unreleased development copy
    CC:                              icc    
    CXX:                             icpc    
    F77:                             ifort  
    F90:                             ifort  
    Configure options:                       '--disable-option-checking' '--prefix=/opt/mpich/dev/intel/default' 'CC=icc' 'CXX=icpc' 'FC=ifort' 'F77=ifort' '--enable-cxx' '--enable-fortran' '--enable-threads=runtime' '--enable-g=dbg' '--with-pm=hydra' '--enable-wrapper-rpath' '--enable-static' '--enable-shared' '--cache-file=/dev/null' '--srcdir=../../../../src/pm/hydra' 'CFLAGS= -g -O2' 'LDFLAGS=' 'LIBS=-lpthread ' 'CPPFLAGS= -I/Users/jrhammon/Work/MPI/MPICH/git/build/src/mpl/include -I/Users/jrhammon/Work/MPI/MPICH/git/src/mpl/include -I/Users/jrhammon/Work/MPI/MPICH/git/src/openpa/src -I/Users/jrhammon/Work/MPI/MPICH/git/build/src/openpa/src -D_REENTRANT -I/Users/jrhammon/Work/MPI/MPICH/git/build/src/mpi/romio/include'
    Process Manager:                         pmi
    Launchers available:                     ssh rsh fork slurm ll lsf sge manual persist
    Topology libraries available:            hwloc
    Resource management kernels available:   user slurm ll lsf sge pbs cobalt
    Checkpointing libraries available:      
    Demux engines available:                 poll select


--
Jeff Hammond
jeff.science@gmail.com
http://jeffhammond.github.io/