MIDAPACK - MIcrowave Data Analysis PACKage  1.1b
Parallel software tools for high performance CMB DA analysis
butterfly.c File Reference

Implementation of routines for butterfly-like communication scheme. More...

Go to the source code of this file.

Functions

int butterfly_init (int *indices, int count, int **R, int *nR, int **S, int *nS, int **com_indices, int *com_count, int steps, MPI_Comm comm)
 Initialize tables for butterfly-like communication scheme This routine set up needed tables for the butterfly communication scheme. Sending and receiving tabs should be well allocated(at least size of number of steps in butterfly scheme). Double pointer are partially allocated, the last allocation is performed inside the routine. com_indices and com_count are also allocated inside the routine, thus they are passing by reference. They represent indices which have to be communicated an their number. Algotithm is based 2 parts. The first one identify intersection between processors indices, using 3 successives butterfly communication schemes : bottom up, top down, and top down again. The second part works locally to build sets of indices to communicate. More...
 
int butterfly_reduce (int **R, int *nR, int nRmax, int **S, int *nS, int nSmax, double *val, int steps, MPI_Comm comm)
 Perform a sparse sum reduction (or mapped reduction) using a butterfly-like communication scheme. More...
 
int butterfly_blocking_2instr_reduce (int **R, int *nR, int nRmax, int **S, int *nS, int nSmax, double *val, int steps, MPI_Comm comm)
 Perform a sparse sum reduction (or mapped reduction) using a butterfly-like communication scheme. More...
 
int butterfly_blocking_1instr_reduce (int **R, int *nR, int nRmax, int **S, int *nS, int nSmax, double *val, int steps, MPI_Comm comm)
 Perform a sparse sum reduction (or mapped reduction) using a butterfly-like communication scheme. More...
 

Detailed Description

Implementation of routines for butterfly-like communication scheme.

Note
Copyright (c) 2010-2012 APC CNRS Université Paris Diderot. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/lgpl.html
For more information about ANR MIDAS'09 project see http://www.apc.univ-paris7.fr/APC_CS/Recherche/Adamis/MIDAS09/index.html
ACKNOWLEDGMENT: This work has been supported in part by the French National Research Agency (ANR) through COSINUS program (project MIDAS no. ANR-09-COSI-009).
Author
Pierre Cargemel
Date
April 2012

Definition in file butterfly.c.

Function Documentation

◆ butterfly_init()

int butterfly_init ( int *  indices,
int  count,
int **  R,
int *  nR,
int **  S,
int *  nS,
int **  com_indices,
int *  com_count,
int  steps,
MPI_Comm  comm 
)

Initialize tables for butterfly-like communication scheme This routine set up needed tables for the butterfly communication scheme. Sending and receiving tabs should be well allocated(at least size of number of steps in butterfly scheme). Double pointer are partially allocated, the last allocation is performed inside the routine. com_indices and com_count are also allocated inside the routine, thus they are passing by reference. They represent indices which have to be communicated an their number. Algotithm is based 2 parts. The first one identify intersection between processors indices, using 3 successives butterfly communication schemes : bottom up, top down, and top down again. The second part works locally to build sets of indices to communicate.

Parameters
indicesset of indices(monotony) handle by a process.
countnumber of elements
Rpointer to receiving maps
nRarray of number of elements in each receiving map
Spointer to sending maps
nSarray of number of elements in each sending map
com_indicesset of indices(monotony) communicated by a process
com_countnumber of elements
stepsnumber of communication exchange in the butterfly scheme
commMPI communicator
Returns
0 if no error

Definition at line 52 of file butterfly.c.

◆ butterfly_reduce()

int butterfly_reduce ( int **  R,
int *  nR,
int  nRmax,
int **  S,
int *  nS,
int  nSmax,
double *  val,
int  steps,
MPI_Comm  comm 
)

Perform a sparse sum reduction (or mapped reduction) using a butterfly-like communication scheme.

Parameters
Rpointer to receiving maps
nRarray of number of elements in each receiving map
nRmaxmaximum size of received message
Spointer to sending maps
nSarray of number of elements in each sending map
nSmaxmaximum size of sent message
valset of values (typically values associated to communicated indices)
stepsnumber of communication exchange in the butterfly scheme
commMPI communicator
Returns
0 if no error

Definition at line 236 of file butterfly.c.

◆ butterfly_blocking_2instr_reduce()

int butterfly_blocking_2instr_reduce ( int **  R,
int *  nR,
int  nRmax,
int **  S,
int *  nS,
int  nSmax,
double *  val,
int  steps,
MPI_Comm  comm 
)

Perform a sparse sum reduction (or mapped reduction) using a butterfly-like communication scheme.

Parameters
Rpointer to receiving maps
nRarray of number of elements in each receiving map
nRmaxmaximum size of received message
Spointer to sending maps
nSarray of number of elements in each sending map
nSmaxmaximum size of sent message
valset of values (typically values associated to communicated indices)
stepsnumber of communication exchange in the butterfly scheme
commMPI communicator
Returns
0 if no error

Definition at line 290 of file butterfly.c.

◆ butterfly_blocking_1instr_reduce()

int butterfly_blocking_1instr_reduce ( int **  R,
int *  nR,
int  nRmax,
int **  S,
int *  nS,
int  nSmax,
double *  val,
int  steps,
MPI_Comm  comm 
)

Perform a sparse sum reduction (or mapped reduction) using a butterfly-like communication scheme.

Parameters
Rpointer to receiving maps
nRarray of number of elements in each receiving map
nRmaxmaximum size of received message
Spointer to sending maps
nSarray of number of elements in each sending map
nSmaxmaximum size of sent message
valset of values (typically values associated to communicated indices)
stepsnumber of communication exchange in the butterfly scheme
commMPI communicator
Returns
0 if no error

Definition at line 340 of file butterfly.c.