Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] Segmentation faults
From: arep isa (arepisa_at_[hidden])
Date: 2011-03-08 00:48:16

I need to use Open MPI to distribute 2d-array in the PGM file among 10
working computers. Then I need to manipulate each value of the array
to get a negative image (255-i) and then print the output back. I'm
thinking of using mpi_scatterv and mpi_gatherv to distribute the data.
After i compile the program, it got segmentation faults. I dont know
what is the problem whether my code wrong or compiler. I integrate the
code to read/write pgm from pgm_RW_1.c and the MPI code in exmpi_2.c.

--I install OPEN MPI version 1.4.1-2 via Synaptic Package Manager on
UBUNTU 10.04.

--I compile with :
       mpicc -o exmpi_2 exmpi_2.c
--I run for testing (segmentation faults):
       mpirun -np 10 ./exmpi_2 2.pgm out.pgm
--Then I run with hostfile:
       mpirun -np 10 --hostfile .mpi_hostfile ./exmpi_2 2.pgm out.pgm

Here is the error:
arep_at_ubuntu:~/Desktop/fyp$ mpirun -np 10 ./exmpi_2 2.pgm out.pgm
[ubuntu:02948] *** Process received signal ***
[ubuntu:02948] Signal: Segmentation fault (11)
[ubuntu:02948] Signal code: Address not mapped (1)
[ubuntu:02948] Failing at address: (nil)
[ubuntu:02948] [ 0] [0x792410]
[ubuntu:02948] [ 1] ./exmpi_2(main+0x1f6) [0x8048d2a]
[ubuntu:02948] [ 2]
/lib/tls/i686/cmov/ [0x126bd6]
[ubuntu:02948] [ 3] ./exmpi_2() [0x8048aa1]
[ubuntu:02948] *** End of error message ***
mpirun noticed that process rank 0 with PID 2948 on node ubuntu exited
on signal 11 (Segmentation fault).

Here is the input 2.pgm image :

TQ for your help.