PaCO++  0.05
DistributionBloc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static unsigned blockSize (unsigned glen, unsigned total)
static unsigned computeBlockBoundInf (unsigned glen, unsigned rank, unsigned total)
static unsigned computeBlockBoundInf0 (unsigned bsz, unsigned rank)
static void computeBlockBounds (unsigned *low, unsigned *high, unsigned glen, unsigned rank, unsigned total)
static void computeBlockBoundsO (unsigned long *low, unsigned long *high, unsigned glen, unsigned rank, unsigned bsz)
static unsigned computeBlockBoundSup (unsigned glen, unsigned rank, unsigned total)
static unsigned computeBlockBoundSup0 (unsigned glen, unsigned bsz, unsigned rank)
static unsigned localBlockLength (unsigned glen, unsigned rank, unsigned total)
static unsigned localBlockLengthO (unsigned glen, unsigned rank, unsigned total, unsigned bsz)

Function Documentation

static unsigned blockSize ( unsigned  glen,
unsigned  total 
) [inline, static]

Definition at line 37 of file PC/DistributionBloc.h.

Referenced by computeBlockBoundInf(), computeBlockBounds(), computeBlockBoundSup(), and localBlockLength().

                                                                  {
    return (glen+total-1)/total;
  }
static unsigned computeBlockBoundInf ( unsigned  glen,
unsigned  rank,
unsigned  total 
) [inline, static]

Definition at line 78 of file PC/DistributionBloc.h.

References blockSize(), and computeBlockBoundInf0().

                                                                                            {
    return  computeBlockBoundInf0(rank,blockSize(glen, total));
  }

Here is the call graph for this function:

static unsigned computeBlockBoundInf0 ( unsigned  bsz,
unsigned  rank 
) [inline, static]

Definition at line 74 of file PC/DistributionBloc.h.

Referenced by computeBlockBoundInf().

                                                                            {
    return  rank * bsz;
  }
static void computeBlockBounds ( unsigned *  low,
unsigned *  high,
unsigned  glen,
unsigned  rank,
unsigned  total 
) [inline, static]

Definition at line 64 of file PC/DistributionBloc.h.

References blockSize().

                                              {

    unsigned bsz = blockSize(glen, total);
    unsigned tmp = (rank+1) * bsz;

    *low =  rank * bsz;    
    *high = ((glen <= tmp)?glen:tmp); // min
  }

Here is the call graph for this function:

static void computeBlockBoundsO ( unsigned long *  low,
unsigned long *  high,
unsigned  glen,
unsigned  rank,
unsigned  bsz 
) [inline, static]

Definition at line 58 of file PC/DistributionBloc.h.

                                             {
    unsigned long tmp = (rank+1) * bsz;
    *low =  rank * bsz;    
    *high = ((glen <= tmp)?glen:tmp); // min
  }
static unsigned computeBlockBoundSup ( unsigned  glen,
unsigned  rank,
unsigned  total 
) [inline, static]

Definition at line 88 of file PC/DistributionBloc.h.

References blockSize(), and computeBlockBoundSup0().

                                                                                            {
    unsigned bsz = blockSize(glen, total);
    return computeBlockBoundSup0(glen, bsz, rank);
  }

Here is the call graph for this function:

static unsigned computeBlockBoundSup0 ( unsigned  glen,
unsigned  bsz,
unsigned  rank 
) [inline, static]

Definition at line 82 of file PC/DistributionBloc.h.

Referenced by computeBlockBoundSup().

                                                                                           {
    unsigned tmp = (rank+1) * bsz;
    return ((glen <= tmp)?glen:tmp); // min

  }
static unsigned localBlockLength ( unsigned  glen,
unsigned  rank,
unsigned  total 
) [inline, static]

Definition at line 49 of file PC/DistributionBloc.h.

References blockSize().

                                                                                        {
    if (rank == total - 1) {
      return glen - rank * blockSize(glen, total);
    } else {
      return blockSize(glen, total);
    }
  }

Here is the call graph for this function:

static unsigned localBlockLengthO ( unsigned  glen,
unsigned  rank,
unsigned  total,
unsigned  bsz 
) [inline, static]

Definition at line 42 of file PC/DistributionBloc.h.

Referenced by computeReceiveDataBlock1DServer(), and computeSendDataBlock1DClient().

                                                                                                       {
    if (rank == total - 1) {
      return glen - rank * bsz;
    } else {
      return bsz;
    }
  }