AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  Help in MPI Programming on AIX 5.3

    Posted Wed June 21, 2006 10:09 AM

    Originally posted by: SystemAdmin


    I simplified my program to the following using MPI on AIX 5.3 on power5+ with POE 4.2.2 and IBM Visuage C/C++ 8.0 compilers. However, i get a segmentation fault and the debugger trace is also shown below. Any one has a clue where went wrong? Thanks a lot...
    #include <mpi.h>
    #include <stdio.h>

    typedef struct _buffer
    {
    int id;
    char* name;
    }buffer;

    int main ( int argc, char* argv[])
    {
    int id, np;
    MPI_Status reqstat;
    buffer* rbuf;
    buffer* sbuf;
    /**
    • Initialize MPI
    */
    MPI_Init(&argc, &argv);

    MPI_Comm_size(MPI_COMM_WORLD, &np);
    MPI_Comm_rank(MPI_COMM_WORLD, &id);

    sbuf = (buffer*) malloc(sizeof(buffer));
    rbuf = (buffer*) malloc(np*sizeof(buffer));

    MPI_Allgather(sbuf, sizeof(buffer), MPI_BYTE, rbuf, sizeof(buffer), MPI_BYTE, MPI_COMM_WORLD);

    /**
    • Terminate MPI
    */
    MPI_Finalize();
    }

    debugger shows
    1:.() at 0xf410
    1:@mpi_env.REG_fmemcpy(??, ??, ??) at 0x9000000007522e4
    1:allgather_pipe_b(??) at 0x90000000070e434
    1:_mpi_allgather(??, ??, ??, ??, ??, ??, ??, ??) at 0x90000000072302c
    1:MPI__Allgather(??, ??, ??, ??, ??, ??, ??) at 0x900000000709e88
    1:main(argc = 1, argv = 0x0ffffffffffff650), line 29 in "main.c"

    Any clues?
    #AIX-Forum


  • 2.  Re: Solved: Help in MPI Programming on AIX 5.3

    Posted Wed June 21, 2006 11:15 PM

    Originally posted by: SystemAdmin


    I have found the mistakes. The problem is on the malloc function. You have to include the stdlib.h for it to work properly.
    #AIX-Forum