ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
pzgemr2.c File Reference
#include "redist.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>
Include dependency graph for pzgemr2.c:

Go to the source code of this file.

Data Types

struct  dcomplex
struct  MDESC
struct  IDESC

Defines

#define static2   static
#define fortran_mr2d   pzgemr2do
#define fortran_mr2dnew   pzgemr2d
#define zcopy_   zcopy
#define zlacpy_   zlacpy
#define Clacpy   Czgelacpy
#define BLOCK_CYCLIC_2D   1
#define SHIFT(row, sprow, nbrow)   ((row)-(sprow)+ ((row) >= (sprow) ? 0 : (nbrow)))
#define max(A, B)   ((A)>(B)?(A):(B))
#define min(A, B)   ((A)>(B)?(B):(A))
#define DIVUP(a, b)   ( ((a)-1) /(b)+1)
#define ROUNDUP(a, b)   (DIVUP(a,b)*(b))
#define scanD0   zgescanD0
#define dispmat   zgedispmat
#define setmemory   zgesetmemory
#define freememory   zgefreememory
#define scan_intervals   zgescan_intervals
#define SENDBUFF   0
#define RECVBUFF   1
#define SIZEBUFF   2
#define NDEBUG

Functions/Subroutines

void Clacpy ()
void Cblacs_pcoord ()
int Cblacs_pnum ()
void Csetpvmtids ()
void Cblacs_get ()
void Cblacs_pinfo ()
void Cblacs_gridinfo ()
void Cblacs_gridinit ()
void Cblacs_exit ()
void Cblacs_gridexit ()
void Cblacs_setup ()
void Cigebs2d ()
void Cigebr2d ()
void Cigesd2d ()
void Cigerv2d ()
void Cigsum2d ()
void Cigamn2d ()
void Cigamx2d ()
void Czgesd2d ()
void Czgerv2d ()
void zlacpy_ ()
int localindice ()
void * mr2d_malloc ()
int ppcm ()
int localsize ()
int memoryblocksize ()
int changeorigin ()
void paramcheck ()
void scanD0 ()
void dispmat ()
void setmemory ()
void freememory ()
int scan_intervals ()
void Cpzgemr2do ()
void Cpzgemr2d ()
void setmemory (dcomplex **adpointer, int blocksize)
void freememory (dcomplex *ptrtobefreed)
int scan_intervals (char type, int ja, int jb, int n, MDESC *ma, MDESC *mb, int q0, int q1, int col0, int col1, IDESC *result)

Define Documentation

#define BLOCK_CYCLIC_2D   1

Definition at line 39 of file pzgemr2.c.

#define Clacpy   Czgelacpy

Definition at line 23 of file pzgemr2.c.

#define dispmat   zgedispmat

Definition at line 86 of file pzgemr2.c.

#define DIVUP (   a,
 
)    ( ((a)-1) /(b)+1)

Definition at line 47 of file pzgemr2.c.

#define fortran_mr2d   pzgemr2do

Definition at line 18 of file pzgemr2.c.

#define fortran_mr2dnew   pzgemr2d

Definition at line 19 of file pzgemr2.c.

#define freememory   zgefreememory

Definition at line 88 of file pzgemr2.c.

#define max (   A,
 
)    ((A)>(B)?(A):(B))

Definition at line 45 of file pzgemr2.c.

#define min (   A,
 
)    ((A)>(B)?(B):(A))

Definition at line 46 of file pzgemr2.c.

#define NDEBUG

Definition at line 105 of file pzgemr2.c.

#define RECVBUFF   1

Definition at line 99 of file pzgemr2.c.

#define ROUNDUP (   a,
 
)    (DIVUP(a,b)*(b))

Definition at line 48 of file pzgemr2.c.

#define scan_intervals   zgescan_intervals

Definition at line 89 of file pzgemr2.c.

#define scanD0   zgescanD0

Definition at line 85 of file pzgemr2.c.

#define SENDBUFF   0

Definition at line 98 of file pzgemr2.c.

#define setmemory   zgesetmemory

Definition at line 87 of file pzgemr2.c.

#define SHIFT (   row,
  sprow,
  nbrow 
)    ((row)-(sprow)+ ((row) >= (sprow) ? 0 : (nbrow)))

Definition at line 44 of file pzgemr2.c.

#define SIZEBUFF   2

Definition at line 100 of file pzgemr2.c.

#define static2   static

Definition at line 8 of file pzgemr2.c.

#define zcopy_   zcopy

Definition at line 20 of file pzgemr2.c.

#define zlacpy_   zlacpy

Definition at line 21 of file pzgemr2.c.


Function/Subroutine Documentation

void Cblacs_exit ( )
void Cblacs_get ( )
void Cblacs_gridexit ( )
void Cblacs_gridinfo ( )
void Cblacs_gridinit ( )
void Cblacs_pcoord ( )
void Cblacs_pinfo ( )
int Cblacs_pnum ( )
void Cblacs_setup ( )
int changeorigin ( )
void Cigamn2d ( )
void Cigamx2d ( )
void Cigebr2d ( )
void Cigebs2d ( )
void Cigerv2d ( )
void Cigesd2d ( )
void Cigsum2d ( )
void Clacpy ( )
void Cpzgemr2d ( )
void Cpzgemr2do ( )
void Csetpvmtids ( )
void Czgerv2d ( )
void Czgesd2d ( )
void dispmat ( )
void freememory ( )
void freememory ( dcomplex ptrtobefreed)

Definition at line 131 of file pzgemr2.c.

{
  if (ptrtobefreed == NULL)
    return;
  free((char *) ptrtobefreed);
}
int localindice ( )
int localsize ( )
int memoryblocksize ( )
void* mr2d_malloc ( )
void paramcheck ( )
int ppcm ( )
int scan_intervals ( )
int scan_intervals ( char  type,
int  ja,
int  jb,
int  n,
MDESC ma,
MDESC mb,
int  q0,
int  q1,
int  col0,
int  col1,
IDESC result 
)

Definition at line 144 of file pzgemr2.c.

{
  int   offset, j0, j1, templatewidth0, templatewidth1, nbcol0, nbcol1;
  int   l;      /* local indice on the beginning of the interval */
  assert(type == 'c' || type == 'r');
  nbcol0 = (type == 'c' ? ma->nbcol : ma->nbrow);
  nbcol1 = (type == 'c' ? mb->nbcol : mb->nbrow);
  templatewidth0 = q0 * nbcol0;
  templatewidth1 = q1 * nbcol1;
  {
    int   sp0 = (type == 'c' ? ma->spcol : ma->sprow);
    int   sp1 = (type == 'c' ? mb->spcol : mb->sprow);
    j0 = SHIFT(col0, sp0, q0) * nbcol0 - ja;
    j1 = SHIFT(col1, sp1, q1) * nbcol1 - jb;
  }
  offset = 0;
  l = 0;
  /* a small check to verify that the submatrix begin inside the first block
   * of the original matrix, this done by a sort of coordinate change at the
   * beginning of the Cpzgemr2d */
  assert(j0 + nbcol0 > 0);
  assert(j1 + nbcol1 > 0);
  while ((j0 < n) && (j1 < n)) {
    int   end0, end1;
    int   start, end;
    end0 = j0 + nbcol0;
    end1 = j1 + nbcol1;
    if (end0 <= j1) {
      j0 += templatewidth0;
      l += nbcol0;
      continue;
    }
    if (end1 <= j0) {
      j1 += templatewidth1;
      continue;
    }
    /* compute the raw intersection */
    start = max(j0, j1);
    start = max(start, 0);
    /* the start is correct now, update the corresponding fields */
    result[offset].lstart = l + start - j0;
    end = min(end0, end1);
    if (end0 == end) {
      j0 += templatewidth0;
      l += nbcol0;
    }
    if (end1 == end)
      j1 += templatewidth1;
    /* throw the limit if they go out of the matrix */
    end = min(end, n);
    assert(end > start);
    /* it is a bit tricky to see why the length is always positive after all
     * this min and max, first we have the property that every interval
     * considered is at least partly into the submatrix, second we arrive
     * here only if the raw intersection is non-void, if we remove a limit
     * that means the corresponding frontier is in both intervals which
     * proove the final interval is non-void, clear ?? */
    result[offset].len = end - start;
    offset += 1;
  }     /* while */
  return offset;
}
void scanD0 ( )
void setmemory ( )
void setmemory ( dcomplex **  adpointer,
int  blocksize 
)

Definition at line 116 of file pzgemr2.c.

{
  assert(blocksize >= 0);
  if (blocksize == 0) {
    *adpointer = NULL;
    return;
  }
  *adpointer = (dcomplex *) mr2d_malloc(
                                        blocksize * sizeof(dcomplex));
}

Here is the call graph for this function:

void zlacpy_ ( )