Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

From: Chevchenkovic Chevchenkovic (chevchenkovic_at_[hidden])
Date: 2006-11-09 01:42:44


Hi,
here is a sample code that I ran to allocate memory using MPI_Alloc_mem
call.
*************
 #include "mpi.h"
#include <stdio.h>

int main( int argc, char *argv[] )
{
    int err;
    int j, count = 100;
    char *ap;

    MPI_Init( &argc, &argv );
    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );

        err = MPI_Alloc_mem( count, MPI_INFO_NULL, &ap );
        if (err) {
            int errclass;
            printf("\n Inside error!");
            printf("allocation failed");
          }
        else {
            printf("\n I m here in else part");
            /* Access all of this memory */
            MPI_Free_mem( ap );
        }
    MPI_Finalize();
    return 0;
}
**********
>mpirun -np 1 -hostfile nodelist ./memalloc
>Signal:11 info.si_errno:0(Success) si_code:1(SEGV_MAPERR)
>Failing at addr:0x38
>[0] func:/usr/local/ofed/mpi/gcc/openmpi-1.1b1-1/lib64/libopal.so.0
[0x2aaaaadceb36]
>[1] func:/lib64/libpthread.so.0 [0x33da90c380]
>[2] func:/usr/local/ofed/mpi/gcc/openmpi-1.1b1-1/lib64/openmpi/mca_mpool_openib.so(mca_mpool_openib_free+0x12)

>[0x2aaaac7d246c]
>[3] func:/usr/local/ofed/mpi/gcc/openmpi-1.1b1-1/lib64/libmpi.so.0(mca_mpool_base_free+0x135)
[0x2aaaaab3c346]
>[4] func:/usr/local/ofed/mpi/gcc/openmpi-1.1b1-1/lib64/libmpi.so.0(PMPI_Free_mem+0x1a)
[0x2aaaaab1f9ba]
>[5] func:./memalloc(main+0x78) [0x400a30]
>[6] func:/lib64/libc.so.6(__libc_start_main+0xdc) [0x33da01c4cc]
>[7] func:./memalloc [0x400929]
> *** End of error message ***