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;
/**
*/
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);
/**
*/
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