Hi,

I'm starting to code with MPI and decided to use openmpi. I'm using
Ubuntu Linux with GCC version 4.2.3  and OpenMPI 1.2.5 (distribution
package). The output of "ompi_info -- all" is attached. I'm also
sending a copy of the source code I'm trying to run.

What I'm trying to do is selecting process with rank 0 as the main
process, which you send data to all others processes with non-blocking
MPI_Isend. After all functions calls are performed, it will wait with
MPI_Waitall() and the print a ending message. The compile command is :

$ mpicc.openmpi -fopenmp mpi.c -o mpi

And I'm running with :

$ mpirun.openmpi -np 2 ./mpi

The problem is that after the output below, the processes halt,
without the ending message.

jmhal@galileo:~/$ mpirun.openmpi -np 2 ./mpi
Main process: 0.
1 - received value, rc value: 100 0

If I start more processes, for example 3, this what I get:

jmhal@galileo:~/$ mpirun.openmpi -np 3 ./mpi
Main process: 0.
End.
1 - received value, rc value: 100 0
2 - received value, rc value: 100 0
[galileo:15807] *** Process received signal ***
[galileo:15807] Signal: Segmentation fault (11)
[galileo:15807] Signal code: Address not mapped (1)
[galileo:15807] Failing at address: 0xd
[galileo:15807] [ 0] [0xb7f2a440]
[galileo:15807] [ 1] /usr/lib/openmpi/lib/openmpi/mca_pml_ob1.so [0xb7b49da8]
[galileo:15807] [ 2] /usr/lib/libmpi.so.0(mca_pml_base_close+0x90) [0xb7efd830]
[galileo:15807] [ 3] /usr/lib/libmpi.so.0(ompi_mpi_finalize+0x1d6) [0xb7ec48d6]
[galileo:15807] [ 4] /usr/lib/libmpi.so.0(PMPI_Finalize+0x56) [0xb7ee27d6]
[galileo:15807] [ 5] ./mpi(main+0x1bc) [0x8048a60]
[galileo:15807] [ 6]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0) [0xb7c47450]
[galileo:15807] [ 7] ./mpi [0x8048841]
[galileo:15807] *** End of error message ***
mpirun.openmpi noticed that job rank 0 with PID 15807 on node galileo
exited on signal 11 (Segmentation fault).
2 additional processes aborted (not shown)


Which is ok since all messages were print, but what about the error message?

-- 
__________________________________
João Marcelo Uchôa de Alencar
Computer Science BSc.
jmarcelo.alencar(at)gmail.com
Linux User 398939
__________________________________

Attachment: ompi_info.txt.gz
Description: GNU Zip compressed data

#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>

int main( int argc, char *argv[] )
{
   int  numtasks, rank, rc; 

   rc = MPI_Init(&argc,&argv);
   if (rc != MPI_SUCCESS) {
     printf ("Error starting MPI program. Terminating.\n");
     MPI_Abort(MPI_COMM_WORLD, rc);
   }

   MPI_Comm_size(MPI_COMM_WORLD,&numtasks);
   MPI_Comm_rank(MPI_COMM_WORLD,&rank);

   if (rank == 0) {
	printf("Main process: %d.\n", rank);
	int a = 100;
	int i;			

	MPI_Request *reqs;
	reqs = (MPI_Request *) malloc((numtasks - 1)*sizeof(MPI_Request));	
	MPI_Status *stats;
	stats = (MPI_Status *) malloc((numtasks - 1)*sizeof(MPI_Status));

	for ( i = 1; i < numtasks; ++i){
		rc = MPI_Isend(&a , 1 , MPI_INT , i , 0 , MPI_COMM_WORLD , &reqs[i]);		
	}

	MPI_Waitall(numtasks - 1 , reqs , stats);		

        free(reqs);
	free(stats);
		
	printf("End.\n");
      
   } else {
	int b;
	int rc;
	MPI_Status status;
	rc = MPI_Recv( &b , 1 , MPI_INT , MPI_ANY_SOURCE , 0, MPI_COMM_WORLD , &status);
	printf("%d - received value, rc value: %d %d\n", rank , b, rc);
	
   }

   MPI_Finalize();
   return 0;
}

Reply via email to