Given p processors and each having a unique input size of i where every input is a unique number. Each processor is given a integer range.
Goal: Have each processor only have integers in their range
Currently running into issues in the following circumstances. Each processor wants to export the values that are not in its range
This is the MPI_ALLTOALLV
call I am using:
int *local_overflow = &overflow;
//buckets = local buckets <- contains values not in local range, size of local overflow.
//globalBucket <- size of all overflows from all processors
//offset = Sum of all rank-1 processor's overflow.
MPI_Alltoallv(&buckets,local_overflow,off,MPI_INTEGER,
&globalBucket,offest,local_overflow,
MPI_INTEGER,MPI_COMM_WORLD);
I believe my issue lies in offsetting the values appropriately, corresponds to the 3rd and 7th parameter.
The goal is to have for example if processor 0 has bucket of size 5, and processors 1 has bucket of size 12, I want proc 0's bucket to occupy the firs 5 spaces in the array, and proc 1's bucket to occupy the next twelve in the globalBucket.
I receive error messages such as
*** Process received signal ***
*** Process received signal ***
Signal: Segmentation fault (11)
Signal code: Address not mapped (1)
Failing at address: 0xc355bb0
*** Process received signal ***
Signal: Segmentation fault (11)
Signal code: Address not mapped (1)
Failing at address: 0x1733ae0
MPI_ALLTOALLV
is an uncommon call, more info available at: http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Alltoallv.html
EDIT: I have calculated my offsets correctly -> the values of all previous processor's rank, I am now receiving the same error as above.
local_overflow
should be an array of int, because you want to send the same number of values from this rank to all of the other ranks, all of the elements of local_overflow should have the same value.
int *local_overflow = new int[p];
for (int i = 0; i < p){
local_overflow[i] = overflow;
}