Matheus Lara
Matheus Lara

Reputation: 61

Error when making a fortran MPI_Allgather code

I have a Fortran code that compiles okay, but returns error when executing this MPI_Allgather routine

call MPI_Allgather(rank, 1, MPI_INTEGER,            
                   allranks(0:np-1), np, MPI_INTEGER, MPI_COMM_WORLD, erro)

rank is an integer variable, allranks is an integer array with np positions labeled from 0 to np-1

The error is

malloc.c:4630: _int_malloc: Assertion `(unsigned long)(size) >= (unsigned long)(nb)' failed.

Does anyone have an idea of the cause of the error? If so, how I can solve this?

Upvotes: 0

Views: 298

Answers (1)

haraldkl
haraldkl

Reputation: 3819

The 5th argument states the number of elements to receive from any process. That is in your case this should be 1. That is recvcount should state how many entries you expect from each process. The MPI standard states:

The type signature associated with sendcount, sendtype at a process must be equal to the type signature associated with recvcount, recvtype at any other process.

Upvotes: 2

Related Questions