[mpich-discuss] Problem Regarding MPI Program

Darius Buntinas buntinas at mcs.anl.gov
Thu May 31 10:48:00 CDT 2012


You can see where the segfault is happening by generating a core file and opening it in a debugger.  E.g., 

   ulimit -c unlimited
   mpiexec ...
   gdb a.out core.XXXX
where a.out is the name of your executable, and core.XXXX is the name of one of the core files.  In gdb, the 'bt' command will show you the stack trace.  Note that in order to get meaningful information from the debugger, you need to make sure your application was compiled with debugging symbols, e.g., with the -g flag.

It's not clear to me what your application is trying to do, though.  You only have one process calling MPI_Bcast().  Every process in the communicator needs to call bcast (you can't use MPI_Recv to receive a message sent with MPI_Bcast).

I hope this helps.
-d


On May 31, 2012, at 9:01 AM, Tushar Patil wrote:

> Hello ..
>  I am student in the university of pune doing project using parallel computing.
>  Here i do a programe it takes input from 3 diffrent file in double
> dimension array.
>  i want to arrange(or permut) each column row-wise. i use the
> function boradcast and gather
>  and create the process as number of columns.
>  But it gives the following error
> ---------------------------------------------------------------------------------------------------------------
>  " rank 2 in job 3  tusharpucsd_48541   caused collective abort of all ranks
>  exit status of rank 2: killed by signal 11
> rank 1 in job 3  tusharpucsd_48541   caused collective abort of all ranks
>  exit status of rank 1: killed by signal 11
> rank 0 in job 3  tusharpucsd_48541   caused collective abort of all ranks
>  exit status of rank 0: killed by signal 11
> ---------------------------------------------------------------------------------------------------------------
> 
> Here i paste the code
> 
> 
>   int main(int argc , char *argv[])
> {
>  int row_count,col_count,r,c,i=0,p;
>  char f1[25];
>  char f2[25];
>  char f3[25];
> 
>  int rank,size;
>  MPI_Status status;
> 
>  MPI_Init(&argc,&argv);
>  MPI_Comm_rank(MPI_COMM_WORLD,&rank);
>  MPI_Comm_size(MPI_COMM_WORLD,&size);
> void step2()
>  {
>    int i,j,revcnt,procCNT=col_count,k=0,p,c;
>    int send_cnt = (row_count * col_count);
>    int recv_cnt = (row_count * col_count);
> 
>    if(rank == 0)
>      {
>        MPI_Bcast(&a,send_cnt,MPI_DOUBLE,0,MPI_COMM_WORLD);
>      }
> 
>    for(p=0;p<procCNT;p++)
>      {
>        if(rank = p)
>          {
>            MPI_Recv(&temp1,recv_cnt,MPI_DOUBLE,0,1,MPI_COMM_WORLD,&status);
>            printf("Process:%d\n",rank);
> 
>            for(i=0;i<row_count;i=i+col_count)
>              {
>                for(j=0;j<col_count;j++)
>                  {
>                    temp1[k][j] = a[i+j][p];
> 
> //MPI_Gather(&a,send_cnt,MPI_DOUBLE,&temp1[k][j],recv_cnt,MPI_DOUBLE,MPI_COMM_WORLD);
>                  }
>                k = k+1;
>              }
>          }
>        MPI_Gather(&a,send_cnt,MPI_DOUBLE,&temp1,recv_cnt,MPI_DOUBLE,0/*(root
> process)*/,MPI_COMM_WORLD);
>      }
>    MPI_Finalize();
> return 0;
> }
> ---------------------------------------------------------------------------------------------------------
> and also attach the whole programe file and expected output file.
> 
> please give me reply as soon as possible
> -- 
> Thanks and Ragards!
>   -Tushar Patil.
>      Msc (Computer Science)
>      Deptt. Of Computer Science
>      University Of Pune-411007
>      Cell- = 7798789759
> <2905.c><output.txt1>_______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list