[mpich-discuss] help me rectify this mpi error please
Pavan Balaji
balaji at mcs.anl.gov
Mon Oct 31 06:07:21 CDT 2011
Please keep mpich-discuss cc'ed.
Can you use the command I provided below?
-- Pavan
On 10/31/2011 02:44 AM, Mohammad Zulqurnain wrote:
> thanks Pavan
> after i used gdb following is shown:
> mpiexec -np 2 gdb ./psp
> GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.1)
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i386-redhat-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.1)
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i386-redhat-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /home/grad/oowojaiy/MPI/psp...Reading symbols from
> /home/grad/oowojaiy/MPI/psp...(no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (gdb) (gdb) Ctrl-C caught... cleaning up processes
>
> now please tell me how to put the debugging symbols in my code
>
> > Date: Sun, 30 Oct 2011 10:18:57 -0500
> > From: balaji at mcs.anl.gov
> > To: mpich-discuss at mcs.anl.gov
> > CC: prodigiousguy at hotmail.com
> > Subject: Re: [mpich-discuss] help me rectify this mpi error please
> >
> >
> > It looks like your application exited with a seg mentation fault. Trying
> > running it using a debugger such as "ddd" or "gdb".
> >
> > % mpiexec -np 2 ddd ./application
> >
> > or
> >
> > % mpiexec -np 2 xterm -e gdb ./application
> >
> > -- Pavan
> >
> > On 10/30/2011 03:22 AM, Mohammad Zulqurnain wrote:
> > > i am unable to detect an error in this code can someone please help me
> > > with this:
> > > Following error is encountered when i execute this code:
> > >
> =====================================================================================
> > > = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
> > > = EXIT CODE: 11
> > > = CLEANING UP REMAINING PROCESSES
> > > = YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
> > > ====================================================
> > > =================================
> > > APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault
> (signal 1 1)
> > >
> > >
> > > code:
> > > long fitness(
> > > /* The chromosome to be judged */
> > > chromosome_t* c,
> > > /* Historic prices */
> > > unsigned int* h
> > > )
> > > {
> > > int rank = MPI::COMM_WORLD.Get_rank();
> > > int size = MPI::COMM_WORLD.Get_size();
> > > long total_price = 0;
> > > long avg_price;
> > > long price;
> > > long shares = 0;
> > > long cash = 0;
> > > unsigned int t;
> > > MPI_Status status;
> > > /*we apply parallelism here*/
> > > if(rank!=0)
> > > {
> > > for(int t=((rank-1)*(HISTORY_LENGTH/size)); t<((rank)*(
> > > HISTORY_LENGTH/size)); t++)
> > > {
> > > price = h[t];
> > > total_price += price;
> > > avg_price = total_price / (t + 1);
> > >
> > > /* Make price relative to average */
> > > price -= avg_price;
> > >*> > /* Convert price to percentage value */
> > > price = price * 100 / avg_price;
> > >
> > > if(-price >= (long)Gray_to_bin(c->buy_price))
> > > {
> > > /* Buy another share */
> > > ++shares;
> > > cash -= (long)h[t];
> > > }
> > > else if(price >= (long)Gray_to_bin(c->sell_price))
> > > {
> > > /* Sell another share */
> > > --shares;
> > > < font class="Apple-style-span" face="Tahoma" size="2"> cash +=
> (long)h[t];
> > > }
> > > }
> > > /* Cash out of holdings at the end for comparisons */
> > > cash += shares * (long)h[t-1];
> > > printf("processor %d gave cash= %d .\n",rank,cash);
> > > //sendCash(0, 0,0,cash);
> > > MPI_Send(&cash,1,MPI_LONG,0,0, MPI_COMM_WORLD);
> > >
> > > }
> > > //MPI_Barrier(MPI_COMM_WORLD);
> > > if(rank==0)
> > > {
> > >
> > > lo ng recieved_cash;
> > > for(int i=1; i<size; i++)
> > > {
> > >
> > > long cas h_recieved;
> > > //cash+=recieveCash(i, 0,0,recieved_cash);
> > > MPI_Recv(&cash_recieved,1, MPI_LONG,i, 0, MPI_COMM_WORLD, &status);
> > > cash+=cash_recieved;
> > > printf("master processor is taking cash from the slave processor %d
> ",i);
> > >
> > > }
> > > MPI_Barrier(MPI_COMM_WORLD);
> > > }
> > >
> > >
> > >
> > > // MPI_Barrier(MPI_COMM_WORLD);
> > > return cash;
> > > }
> > >
> > >
> > > _______________________________________________
> > > 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
> >
> > --
> > Pavan Balaji
> > http://www.mcs.anl.gov/~balaji
> *
> **
--
Pavan Balaji
http://www.mcs.anl.gov/~balaji
More information about the mpich-discuss
mailing list