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

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

Go to the source code of this file.

Functions

int ring_init (int *indices, int count, int **R, int *nR, int **S, int *nS, int steps, MPI_Comm comm)
 Initialize tables for ring-like communication scheme. More...
 
int ring_reduce (int **R, int *nR, int nRmax, int **S, int *nS, int nSmax, double *val, double *res_val, int steps, MPI_Comm comm)
 Perform a sparse sum reduction (or mapped reduction) using a ring-like communication scheme. More...
 
int alltoallv_reduce (int **R, int *nR, int nRtot, int **S, int *nS, int nStot, double *val, double *res_val, int steps, MPI_Comm comm)
 Perform a sparse sum reduction (or mapped reduction) using an MPI-Alltoallv call. More...
 
int ring_nonblocking_reduce (int **R, int *nR, int **S, int *nS, double *val, double *res_val, int steps, MPI_Comm comm)
 Perform a sparse sum reduction (or mapped reduction) using a ring-like non-blocking communication scheme. More...
 
int ring_noempty_reduce (int **R, int *nR, int nneR, int **S, int *nS, int nneS, double *val, double *res_val, int steps, MPI_Comm comm)
 Perform a sparse sum reduction (or mapped reduction) using a ring-like non-blocking no-empty communication scheme. More...
 
int ring_noempty_step_reduce (int **R, int *nR, int nRmax, int **S, int *nS, int nSmax, double *val, double *res_val, int steps, MPI_Comm comm)
 Perform a sparse sum reduction (or mapped reduction) using a ring-like communication scheme. More...
 

Detailed Description

Implementation of routines for ring-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 ring.c.

Function Documentation

◆ ring_init()

int ring_init ( int *  indices,
int  count,
int **  R,
int *  nR,
int **  S,
int *  nS,
int  steps,
MPI_Comm  comm 
)

Initialize tables for ring-like communication scheme.


This routine set up needed tables for the ring communication scheme. Sending and receiving tabs should be well allocated(at least size of number of steps in ring scheme). Double pointer are partially allocated, the last allocation is performed inside the routine (only for R S are just pointer).

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 ring scheme
commMPI communicator
Todo:
Ring loop and ring table are set from index 1 to size. Should be shift and be set from index 0 to size-1.
Returns
0 if no error

Definition at line 48 of file ring.c.

◆ ring_reduce()

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

Perform a sparse sum reduction (or mapped reduction) using a ring-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 109 of file ring.c.

◆ alltoallv_reduce()

int alltoallv_reduce ( int **  R,
int *  nR,
int  nRtot,
int **  S,
int *  nS,
int  nStot,
double *  val,
double *  res_val,
int  steps,
MPI_Comm  comm 
)

Perform a sparse sum reduction (or mapped reduction) using an MPI-Alltoallv call.

Parameters
Rpointer to receiving maps
nRarray of number of elements in each receiving map
nRtotsize of the receive buffer
Spointer to sending maps
nSarray of number of elements in each sending map
nStotsize of the send buffer
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 157 of file ring.c.

◆ ring_nonblocking_reduce()

int ring_nonblocking_reduce ( int **  R,
int *  nR,
int **  S,
int *  nS,
double *  val,
double *  res_val,
int  steps,
MPI_Comm  comm 
)

Perform a sparse sum reduction (or mapped reduction) using a ring-like non-blocking communication scheme.

Parameters
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
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 234 of file ring.c.

◆ ring_noempty_reduce()

int ring_noempty_reduce ( int **  R,
int *  nR,
int  nneR,
int **  S,
int *  nS,
int  nneS,
double *  val,
double *  res_val,
int  steps,
MPI_Comm  comm 
)

Perform a sparse sum reduction (or mapped reduction) using a ring-like non-blocking no-empty communication scheme.

Parameters
Rpointer to receiving maps
nRarray of number of elements in each receiving map
nneRnumber of no-empty receiving messages
Spointer to sending maps
nSarray of number of elements in each sending map
nneSnumber of no-empty sending messages
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 298 of file ring.c.

◆ ring_noempty_step_reduce()

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

Perform a sparse sum reduction (or mapped reduction) using a ring-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 380 of file ring.c.