OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
pzgemr2.c File Reference
#include "redist.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>

Go to the source code of this file.

Data Structures

struct  dcomplex
struct  MDESC
struct  IDESC

Macros

#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)
#define max(A, B)
#define min(A, B)
#define DIVUP(a, b)
#define ROUNDUP(a, 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

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 ()
Int localindice ()
void * mr2d_malloc ()
Int ppcm ()
Int localsize ()
Int memoryblocksize ()
Int changeorigin ()
void paramcheck ()
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)

Macro Definition Documentation

◆ BLOCK_CYCLIC_2D

#define BLOCK_CYCLIC_2D   1

Definition at line 39 of file pzgemr2.c.

◆ Clacpy

#define Clacpy   Czgelacpy

Definition at line 23 of file pzgemr2.c.

◆ dispmat

#define dispmat   zgedispmat

Definition at line 86 of file pzgemr2.c.

◆ DIVUP

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

Definition at line 47 of file pzgemr2.c.

◆ fortran_mr2d

#define fortran_mr2d   pzgemr2do

Definition at line 18 of file pzgemr2.c.

◆ fortran_mr2dnew

#define fortran_mr2dnew   pzgemr2d

Definition at line 19 of file pzgemr2.c.

◆ freememory

#define freememory   zgefreememory

Definition at line 88 of file pzgemr2.c.

◆ max

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

Definition at line 45 of file pzgemr2.c.

◆ min

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

Definition at line 46 of file pzgemr2.c.

◆ NDEBUG

#define NDEBUG

Definition at line 105 of file pzgemr2.c.

◆ RECVBUFF

#define RECVBUFF   1

Definition at line 99 of file pzgemr2.c.

◆ ROUNDUP

#define ROUNDUP ( a,
b )
Value:
(DIVUP(a,b)*(b))
#define DIVUP(a, b)
Definition pcgemr.c:182

Definition at line 48 of file pzgemr2.c.

◆ scan_intervals

#define scan_intervals   zgescan_intervals

Definition at line 89 of file pzgemr2.c.

◆ scanD0

#define scanD0   zgescanD0

Definition at line 85 of file pzgemr2.c.

◆ SENDBUFF

#define SENDBUFF   0

Definition at line 98 of file pzgemr2.c.

◆ setmemory

#define setmemory   zgesetmemory

Definition at line 87 of file pzgemr2.c.

◆ SHIFT

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

Definition at line 44 of file pzgemr2.c.

◆ SIZEBUFF

#define SIZEBUFF   2

Definition at line 100 of file pzgemr2.c.

◆ static2

#define static2   static

Definition at line 8 of file pzgemr2.c.

◆ zcopy_

#define zcopy_   zcopy

Definition at line 20 of file pzgemr2.c.

◆ zlacpy_

#define zlacpy_   zlacpy

Definition at line 21 of file pzgemr2.c.

Function Documentation

◆ Cblacs_exit()

void Cblacs_exit ( )
extern

◆ Cblacs_get()

void Cblacs_get ( )
extern

◆ Cblacs_gridexit()

void Cblacs_gridexit ( )
extern

◆ Cblacs_gridinfo()

void Cblacs_gridinfo ( )
extern

◆ Cblacs_gridinit()

void Cblacs_gridinit ( )
extern

◆ Cblacs_pcoord()

void Cblacs_pcoord ( )
extern

◆ Cblacs_pinfo()

void Cblacs_pinfo ( )
extern

◆ Cblacs_pnum()

Int Cblacs_pnum ( )
extern

◆ Cblacs_setup()

void Cblacs_setup ( )
extern

◆ changeorigin()

Int changeorigin ( )
extern

◆ Cigamn2d()

void Cigamn2d ( )
extern

◆ Cigamx2d()

void Cigamx2d ( )
extern

◆ Cigebr2d()

void Cigebr2d ( )
extern

◆ Cigebs2d()

void Cigebs2d ( )
extern

◆ Cigerv2d()

void Cigerv2d ( )
extern

◆ Cigesd2d()

void Cigesd2d ( )
extern

◆ Cigsum2d()

void Cigsum2d ( )
extern

◆ Cpzgemr2d()

void Cpzgemr2d ( )
extern

◆ Cpzgemr2do()

void Cpzgemr2do ( )
extern

◆ Csetpvmtids()

void Csetpvmtids ( )
extern

◆ Czgerv2d()

void Czgerv2d ( )
extern

◆ Czgesd2d()

void Czgesd2d ( )
extern

◆ freememory()

void freememory ( dcomplex * ptrtobefreed)

Definition at line 129 of file pzgemr2.c.

130{
131 if (ptrtobefreed == NULL)
132 return;
133 free((char *) ptrtobefreed);
134}

◆ localindice()

Int localindice ( )
extern

◆ localsize()

Int localsize ( )
extern

◆ memoryblocksize()

Int memoryblocksize ( )
extern

◆ mr2d_malloc()

void * mr2d_malloc ( )
extern

◆ paramcheck()

void paramcheck ( )
extern

◆ ppcm()

Int ppcm ( )
extern

◆ 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 141 of file pzgemr2.c.

147{
148 Int offset, j0, j1, templatewidth0, templatewidth1, nbcol0, nbcol1;
149 Int l; /* local indice on the beginning of the interval */
150 assert(type == 'c' || type == 'r');
151 nbcol0 = (type == 'c' ? ma->nbcol : ma->nbrow);
152 nbcol1 = (type == 'c' ? mb->nbcol : mb->nbrow);
153 templatewidth0 = q0 * nbcol0;
154 templatewidth1 = q1 * nbcol1;
155 {
156 Int sp0 = (type == 'c' ? ma->spcol : ma->sprow);
157 Int sp1 = (type == 'c' ? mb->spcol : mb->sprow);
158 j0 = SHIFT(col0, sp0, q0) * nbcol0 - ja;
159 j1 = SHIFT(col1, sp1, q1) * nbcol1 - jb;
160 }
161 offset = 0;
162 l = 0;
163 /* a small check to verify that the submatrix begin inside the first block
164 * of the original matrix, this done by a sort of coordinate change at the
165 * beginning of the Cpzgemr2d */
166 assert(j0 + nbcol0 > 0);
167 assert(j1 + nbcol1 > 0);
168 while ((j0 < n) && (j1 < n)) {
169 Int end0, end1;
170 Int start, end;
171 end0 = j0 + nbcol0;
172 end1 = j1 + nbcol1;
173 if (end0 <= j1) {
174 j0 += templatewidth0;
175 l += nbcol0;
176 continue;
177 }
178 if (end1 <= j0) {
179 j1 += templatewidth1;
180 continue;
181 }
182 /* compute the raw intersection */
183 start = max(j0, j1);
184 start = max(start, 0);
185 /* the start is correct now, update the corresponding fields */
186 result[offset].lstart = l + start - j0;
187 end = min(end0, end1);
188 if (end0 == end) {
189 j0 += templatewidth0;
190 l += nbcol0;
191 }
192 if (end1 == end)
193 j1 += templatewidth1;
194 /* throw the limit if they go out of the matrix */
195 end = min(end, n);
196 assert(end > start);
197 /* it is a bit tricky to see why the length is always positive after all
198 * this min and max, first we have the property that every interval
199 * considered is at least partly into the submatrix, second we arrive
200 * here only if the raw intersection is non-void, if we remove a limit
201 * that means the corresponding frontier is in both intervals which
202 * proove the final interval is non-void, clear ?? */
203 result[offset].len = end - start;
204 offset += 1;
205 } /* while */
206 return offset;
207}
#define Int
Definition Bconfig.h:22
end[inform, rinform, sol, inst, schur, redrhs, pivnul_list, sym_perm, uns_perm, icntl, cntl, colsca_out, rowsca_out, keep_out, dkeep_out]
Definition dmumps.m:40
integer, dimension(:), allocatable offset
Definition rad2r.F:53
#define SHIFT(row, sprow, nbrow)
Definition pzgemr2.c:44
#define max(A, B)
Definition pzgemr2.c:45
#define min(A, B)
Definition pzgemr2.c:46
n
Int lstart
Definition pcgemr.c:176
Int len
Definition pcgemr.c:177
Int spcol
Definition pcgemr.c:171
Int nbcol
Definition pcgemr.c:169
Int sprow
Definition pcgemr.c:170
Int nbrow
Definition pcgemr.c:168

◆ setmemory()

void setmemory ( dcomplex ** adpointer,
Int blocksize )

Definition at line 116 of file pzgemr2.c.

117{
118 assert(blocksize >= 0);
119 if (blocksize == 0) {
120 *adpointer = NULL;
121 return;
122 }
123 *adpointer = (dcomplex *) mr2d_malloc(
124 blocksize * sizeof(dcomplex));
125}
void * mr2d_malloc()