Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
spm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
spm
Commits
3d2a0bbf
Commit
3d2a0bbf
authored
8 years ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused spm driver and cleanup sm documentation
parent
0cf64102
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
spm.c
+2
-2
2 additions, 2 deletions
spm.c
spm.h
+73
-171
73 additions, 171 deletions
spm.h
spm_integers.c
+72
-11
72 additions, 11 deletions
spm_integers.c
spm_read_driver.c
+9
-151
9 additions, 151 deletions
spm_read_driver.c
z_spm.h
+1
-1
1 addition, 1 deletion
z_spm.h
z_spm_integer.c
+13
-2
13 additions, 2 deletions
z_spm_integer.c
with
170 additions
and
338 deletions
spm.c
+
2
−
2
View file @
3d2a0bbf
...
...
@@ -466,11 +466,11 @@ spm2Dense( const pastix_spm_t *spm )
********************************************************************************
*
* @return
* \retval
t
he norm described above. Note that for simplicity, even if
* \retval
norm T
he norm described above. Note that for simplicity, even if
* the norm of single real or single complex matrix is computed with
* single precision, the returned norm is stored in double precision
* number.
* \retval -1
., i
f the floating point of the sparse matrix is
* \retval -1
I
f the floating point of the sparse matrix is
* undefined.
*
*******************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
spm.h
+
73
−
171
View file @
3d2a0bbf
...
...
@@ -18,28 +18,28 @@
/**
* @ingroup pastix_spm
*
* @brief The list of matrix driver reader and generators
* @brief The list of matrix driver reader
s
and generators
*
*/
typedef
enum
pastix_driver_e
{
PastixDriverRSA
,
/* ok
*/
PastixDriver
CCC
,
/
/
PastixDriver
RCC
,
/
/
PastixDriver
Olaf
,
/
/
PastixDriver
Peer
,
/
/
PastixDriver
HB
,
/* ok
*/
PastixDriver
IJV
,
/* ok
*/
PastixDriverMM
,
/* ok
*/
PastixDriver
DMM
,
/* ok
*/
PastixDriverPetscS
,
/* ok
*/
PastixDriverPetscU
,
/* ok
*/
PastixDriverPetscH
,
/* ok
*/
PastixDriverC
SCD
,
/
/
PastixDriver
Laplacian
,
/* ok
*/
PastixDriver
XLaplacian
,
/* ok
*/
PastixDriver
BRGM
,
/
/
PastixDriverBRGM
D
,
/
/
PastixDriver
Graph
PastixDriverRSA
,
/**< RSA driver
*/
PastixDriver
HB
,
/**< Harwell Boeing driver *
/
PastixDriver
IJV
,
/**< IJV Coordinate driver *
/
PastixDriver
MM
,
/**< Matrix Market driver *
/
PastixDriver
Laplacian
,
/**< 3, 5, or 7 points Lapalacian stencil generator *
/
PastixDriver
XLaplacian
,
/**< 15-points Laplacian stencil generator
*/
PastixDriver
Graph
,
/**< Scotch Graph driver
*/
/*
PastixDriver
D
MM,
/\**< Distributed Matrix Market driver *\/
*/
/*
PastixDriver
CSCD, /\**< CSC distributed driver *\/
*/
/*
PastixDriverPetscS,
/\**< Petsc Symmetric driver *\/
*/
/*
PastixDriverPetscU,
/\**< Pestc Unssymmetric driver *\/
*/
/*
PastixDriverPetscH,
/\**< Pestc Hermitian driver *\/
*/
/*
PastixDriverC
CC, /\**< Not supported yet *\/ *
/
/*
PastixDriver
RCC, /\**< Not supported yet *\/
*/
/*
PastixDriver
Olaf, /\**< Not supported yet *\/
*/
/*
PastixDriver
Peer, /\**< Not supported yet *\/ *
/
/*
PastixDriverBRGM
, /\**< Not supported yet *\/ *
/
/*
PastixDriver
BRGMD, /\**< Not supported yet *\/ */
}
pastix_driver_t
;
/**
...
...
@@ -55,7 +55,7 @@ typedef enum pastix_driver_e {
* It is also possible to describe a matrix with constant or varaibel degrees of freedom.
*
*/
struct
pastix_spm_s
{
typedef
struct
pastix_spm_s
{
int
mtxtype
;
/**< Matrix structure: PastixGeneral, PastixSymmetric
or PastixHermitian. */
pastix_coeftype_t
flttype
;
/**< avals datatype: PastixPattern, PastixFloat, PastixDouble,
...
...
@@ -83,71 +83,66 @@ struct pastix_spm_s {
pastix_int_t
*
rowptr
;
/**< List of edges for each vertex [+baseval] */
pastix_int_t
*
loc2glob
;
/**< Corresponding numbering from local to global [+baseval] */
void
*
values
;
/**< Values stored in the matrix */
};
}
pastix_spm_t
;
/**
*
Integer arrays
subroutines
*
SPM
subroutines
*/
pastix_int_t
*
spmIntConvert
(
pastix_int_t
n
,
int
*
input
);
void
spmInit
(
pastix_spm_t
*
spm
);
void
spmExit
(
pastix_spm_t
*
spm
);
pastix_spm_t
*
spmCopy
(
const
pastix_spm_t
*
spm
);
void
spmBase
(
pastix_spm_t
*
spm
,
int
baseval
);
void
spmUpdateComputedFields
(
pastix_spm_t
*
spm
);
int
spmConvert
(
int
ofmttype
,
pastix_spm_t
*
ospm
);
void
*
spm2Dense
(
const
pastix_spm_t
*
spm
);
pastix_int_t
spmFindBase
(
const
pastix_spm_t
*
spm
);
double
spmNorm
(
int
ntype
,
const
pastix_spm_t
*
spm
);
int
spmMatVec
(
const
pastix_trans_t
trans
,
const
void
*
alpha
,
const
pastix_spm_t
*
spm
,
const
void
*
x
,
const
void
*
beta
,
void
*
y
);
void
spmScal
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
);
int
spmSort
(
pastix_spm_t
*
spm
);
pastix_int_t
spmMergeDuplicate
(
pastix_spm_t
*
spm
);
pastix_int_t
spmSymmetrize
(
pastix_spm_t
*
spm
);
pastix_spm_t
*
spmCheckAndCorrect
(
pastix_spm_t
*
spm
);
/**
*******************************************************************************
*
* @ingroup pastix_spm
*
* @brief Sorts in ascending order array of element composed of one single
* pastix_int_t with a single key value.
*
*******************************************************************************
*
* @param[in,out] pbase TODO
*
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
* SPM IO subroutines
*/
void
spmIntSort1Asc1
(
void
*
const
pbase
,
const
pastix_int_t
n
);
int
spmLoad
(
pastix_spm_t
*
spm
,
FILE
*
infile
);
int
spmSave
(
pastix_spm_t
*
spm
,
FILE
*
outfile
);
/**
*******************************************************************************
*
* @ingroup pastix_spm
*
* @brief Sorts in ascending order array of element composed of two
* pastix_int_t by ascending order. The first value is used as key.
*
*******************************************************************************
*
* @param[in,out] pbase TODO
*
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
* SPM subroutines to check factorization/solve
*/
void
spmIntSort2Asc1
(
void
*
const
pbase
,
const
pastix_int_t
n
);
int
spmGenRHS
(
int
type
,
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x
,
int
ldx
,
void
*
b
,
int
ldb
);
int
spmCheckAxb
(
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x0
,
int
ldx0
,
void
*
b
,
int
ldb
,
const
void
*
x
,
int
ldx
);
/**
*******************************************************************************
*
* @ingroup pastix_spm
*
* @brief Sorts in ascending order array of element composed of two
* pastix_int_t by ascending order. Both values are used as key.
*
*******************************************************************************
*
* @param[in,out] pbase TODO
*
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
* SPM print output
*/
void
spmPrint
(
FILE
*
f
,
const
pastix_spm_t
*
spm
);
/**
* SPM multi-dof subroutines
*/
pastix_spm_t
*
spmExpand
(
const
pastix_spm_t
*
spm
);
pastix_spm_t
*
spmDofExtend
(
const
int
type
,
const
int
dof
,
const
pastix_spm_t
*
spm
);
/**
* SPM read driver access
*/
int
spmReadDriver
(
pastix_driver_t
driver
,
char
*
filename
,
pastix_spm_t
*
spm
,
MPI_Comm
pastix_comm
);
/**
* SPM subroutines to manipulate integers arrays
*/
pastix_int_t
*
spmIntConvert
(
pastix_int_t
n
,
int
*
input
);
void
spmIntSort1Asc1
(
void
*
const
pbase
,
const
pastix_int_t
n
);
void
spmIntSort2Asc1
(
void
*
const
pbase
,
const
pastix_int_t
n
);
void
spmIntSort2Asc2
(
void
*
const
pbase
,
const
pastix_int_t
n
);
/**
...
...
@@ -160,121 +155,28 @@ void spmIntSort2Asc2(void * const pbase, const pastix_int_t n);
*******************************************************************************
* @param[in] f Pointer to the file
*
* @param[in] i
TODO
* @param[in] i
Row index of the element
*
* @param[in] j
TODO
* @param[in] j
Column index of the element
*
* @param[in] A
TODO
* @param[in] A
Value of the element A|i,j]
*******************************************************************************
* @{
*/
static
inline
void
z_spmPrintElt
(
FILE
*
f
,
pastix_int_t
i
,
pastix_int_t
j
,
pastix_complex64_t
A
){
fprintf
(
f
,
"%ld %ld %e %e
\n
"
,
(
long
)
i
,
(
long
)
j
,
creal
(
A
),
cimag
(
A
)
);
}
/**
*******************************************************************************
*
* @ingroup pastix_spm_dev
*
* @brief Subroutines to print elements of spm structures
*
*******************************************************************************
* @param[in] f Pointer to the file
*
* @param[in] i TODO
*
* @param[in] j TODO
*
* @param[in] A TODO
*******************************************************************************
*/
static
inline
void
c_spmPrintElt
(
FILE
*
f
,
pastix_int_t
i
,
pastix_int_t
j
,
pastix_complex32_t
A
){
fprintf
(
f
,
"%ld %ld %e %e
\n
"
,
(
long
)
i
,
(
long
)
j
,
crealf
(
A
),
cimagf
(
A
)
);
}
/**
*******************************************************************************
*
* @ingroup pastix_spm_dev
*
* @brief Subroutines to print elements of spm structures
*
*******************************************************************************
* @param[in] f Pointer to the file
*
* @param[in] i TODO
*
* @param[in] j TODO
*
* @param[in] A TODO
*******************************************************************************
*/
static
inline
void
d_spmPrintElt
(
FILE
*
f
,
pastix_int_t
i
,
pastix_int_t
j
,
double
A
){
fprintf
(
f
,
"%ld %ld %e
\n
"
,
(
long
)
i
,
(
long
)
j
,
A
);
}
/**
*******************************************************************************
*
* @ingroup pastix_spm_dev
*
* @brief Subroutines to print elements of spm structures
*
*******************************************************************************
* @param[in] f Pointer to the file
*
* @param[in] i TODO
*
* @param[in] j TODO
*
* @param[in] A TODO
*******************************************************************************
*/
static
inline
void
s_spmPrintElt
(
FILE
*
f
,
pastix_int_t
i
,
pastix_int_t
j
,
float
A
){
fprintf
(
f
,
"%ld %ld %e
\n
"
,
(
long
)
i
,
(
long
)
j
,
A
);
}
/**
* SPM subroutines
*/
int
spmLoad
(
pastix_spm_t
*
spm
,
FILE
*
infile
);
int
spmSave
(
pastix_spm_t
*
spm
,
FILE
*
outfile
);
void
spmPrint
(
FILE
*
f
,
const
pastix_spm_t
*
spm
);
int
spmGenRHS
(
int
type
,
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x
,
int
ldx
,
void
*
b
,
int
ldb
);
int
spmCheckAxb
(
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x0
,
int
ldx0
,
void
*
b
,
int
ldb
,
const
void
*
x
,
int
ldx
);
void
spmInit
(
pastix_spm_t
*
spm
);
void
spmExit
(
pastix_spm_t
*
spm
);
pastix_spm_t
*
spmCopy
(
const
pastix_spm_t
*
spm
);
void
spmBase
(
pastix_spm_t
*
spm
,
int
baseval
);
void
spmUpdateComputedFields
(
pastix_spm_t
*
spm
);
int
spmConvert
(
int
ofmttype
,
pastix_spm_t
*
ospm
);
void
*
spm2Dense
(
const
pastix_spm_t
*
spm
);
pastix_int_t
spmFindBase
(
const
pastix_spm_t
*
spm
);
double
spmNorm
(
int
ntype
,
const
pastix_spm_t
*
spm
);
int
spmMatVec
(
const
pastix_trans_t
trans
,
const
void
*
alpha
,
const
pastix_spm_t
*
spm
,
const
void
*
x
,
const
void
*
beta
,
void
*
y
);
void
spmScal
(
const
pastix_complex64_t
alpha
,
pastix_spm_t
*
spm
);
int
spmSort
(
pastix_spm_t
*
spm
);
pastix_int_t
spmMergeDuplicate
(
pastix_spm_t
*
spm
);
pastix_int_t
spmSymmetrize
(
pastix_spm_t
*
spm
);
pastix_spm_t
*
spmCheckAndCorrect
(
pastix_spm_t
*
spm
);
/**
* SPM multi-dof subroutines
*/
pastix_spm_t
*
spmExpand
(
const
pastix_spm_t
*
spm
);
pastix_spm_t
*
spmDofExtend
(
const
int
type
,
const
int
dof
,
const
pastix_spm_t
*
spm
);
/**
* SPM read driver access
* @}
*/
int
spmReadDriver
(
pastix_driver_t
driver
,
char
*
filename
,
pastix_spm_t
*
spm
,
MPI_Comm
pastix_comm
);
#endif
/* _SPM_H_ */
This diff is collapsed.
Click to expand it.
spm_integers.c
+
72
−
11
View file @
3d2a0bbf
...
...
@@ -67,15 +67,24 @@ spmIntConvert( pastix_int_t n, int *input )
/**
*******************************************************************************
*
* @fn void spmIntSort1Asc1(void * const pbase, const pastix_int_t n);
* @ingroup pastix_spm_dev
*
*
@brief
Sorts in ascending order array of element composed of one single
* Sorts in ascending order array of element composed of one single
* pastix_int_t with a single key value.
*
*******************************************************************************
*
* @param[in,out] pbase
* Pointer to the array of integers to sort.
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
*/
#define INTSORTNAME spmIntSort1Asc1
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define INTSORTNAME spmIntSort1Asc1
#define INTSORTSIZE (sizeof (pastix_int_t))
#define INTSORTSWAP(p,q) do { \
pastix_int_t t; \
...
...
@@ -94,15 +103,24 @@ spmIntConvert( pastix_int_t n, int *input )
/**
*******************************************************************************
*
* @fn void spmIntSort2Asc1(void * const pbase, const pastix_int_t n);
* @ingroup pastix_spm_dev
*
*
@brief
Sorts in ascending order array of element composed of two
* Sorts in ascending order array of element composed of two
* pastix_int_t by ascending order. The first value is used as key.
*
*******************************************************************************
*
* @param[in,out] pbase
* Pointer to the array of couple of integers to sort.
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
*/
#define INTSORTNAME spmIntSort2Asc1
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define INTSORTNAME spmIntSort2Asc1
#define INTSORTSIZE (2 * sizeof (pastix_int_t))
#define INTSORTSWAP(p,q) do { \
pastix_int_t t, u; \
...
...
@@ -124,15 +142,27 @@ spmIntConvert( pastix_int_t n, int *input )
/**
*******************************************************************************
*
* @fn void spmIntSort3Asc1(void * const pbase, const pastix_int_t n);
* @ingroup pastix_spm_dev
*
* @brief Sorts in ascending order array of element composed of three
* pastix_int_t by ascending order. The first value is used as key.
*
*******************************************************************************
*
* @param[in,out] pbase
* Pointer to the array of triplet of integers to sort.
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
*/
#define INTSORTNAME spmInt_intSort3Asc1
/* Declare here for now, because unused */
void
spmIntSort3Asc1
(
void
*
const
pbase
,
const
pastix_int_t
n
);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define INTSORTNAME spmIntSort3Asc1
#define INTSORTSIZE (3 * sizeof (pastix_int_t))
#define INTSORTSWAP(p,q) do { \
pastix_int_t t, u, v; \
...
...
@@ -157,15 +187,23 @@ spmIntConvert( pastix_int_t n, int *input )
/**
*******************************************************************************
*
* @fn void spmIntSort2Asc2(void * const pbase, const pastix_int_t n);
* @ingroup pastix_spm_dev
*
* @brief Sorts in ascending order array of element composed of two
* pastix_int_t by ascending order. Both values are used as key.
*
*******************************************************************************
*
* @param[in,out] pbase
* Pointer to the array of couple of integers to sort.
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
*/
#define INTSORTNAME spmIntSort2Asc2
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define INTSORTNAME spmIntSort2Asc2
#define INTSORTSIZE (2 * sizeof (pastix_int_t))
#define INTSORTSWAP(p,q) do { \
pastix_int_t t, u; \
...
...
@@ -187,6 +225,7 @@ spmIntConvert( pastix_int_t n, int *input )
/**
*******************************************************************************
*
* @fn void spmIntMSortIntAsc(void ** const pbase, const pastix_int_t n);
* @ingroup pastix_spm_dev
*
* @brief Sort 2 arrays simultaneously, the first array is an array of
...
...
@@ -194,9 +233,20 @@ spmIntConvert( pastix_int_t n, int *input )
* other array of pastix_int_t used as secondary key.
*
*******************************************************************************
*
* @param[in,out] pbase
* Array of pointers to the arrays of integers to sort.
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
*/
#define INTSORTNAME spmIntMSortIntAsc
/* Declare here for now, because unused */
void
spmIntMSortIntAsc
(
void
**
const
pbase
,
const
pastix_int_t
n
);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define INTSORTNAME spmIntMSortIntAsc
#define INTSORTSIZE(x) (sizeof (pastix_int_t))
#define INTSORTNTAB 2
#define INTSORTSWAP(p,q) do { \
...
...
@@ -208,7 +258,7 @@ spmIntConvert( pastix_int_t n, int *input )
t = *((pastix_int_t *) (p)); \
*((pastix_int_t *) (p)) = *((pastix_int_t *) (q)); \
*((pastix_int_t *) (q)) = t; \
/* swap on secon
t
integer array */
\
/* swap on secon
d
integer array */
\
t = int2ptr[disp_p]; \
int2ptr[disp_p] = int2ptr[disp_q]; \
int2ptr[disp_q] = t; \
...
...
@@ -228,16 +278,27 @@ spmIntConvert( pastix_int_t n, int *input )
/**
*******************************************************************************
*
* @fn void spmIntMSortSmallIntAsc(void **const pbase, const pastix_int_t n);
* @ingroup pastix_spm_dev
*
* @brief Sort 2 arrays simultaneously, the first array is an array of
* pastix_int_t and used as primary key for sorting. The second array is an
* other array of pastix_int_t used as secondary key.
*
*******************************************************************************
*
* @param[in,out] pbase
* Array of pointers to the arrays of integers to sort.
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
*/
#define INTSORTNAME spmIntMSortSmallIntAsc
/* Declare here for now, because unused */
void
spmIntMSortSmallIntAsc
(
void
**
const
pbase
,
const
pastix_int_t
n
);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define INTSORTNAME spmIntMSortSmallIntAsc
#define INTSORTSIZE(x) (sizeof (int))
#define INTSORTNTAB 2
#define INTSORTSWAP(p,q) do { \
...
...
This diff is collapsed.
Click to expand it.
spm_read_driver.c
+
9
−
151
View file @
3d2a0bbf
/**
* @file driver
s
.c
* @file
spm_read_
driver.c
*
* $COPYRIGHTS$
* PaStiX spm routines
* PaStiX is a software package provided by Inria Bordeaux - Sud-Ouest,
* LaBRI, University of Bordeaux 1 and IPB.
*
* @version 1.0.0
* @author Mathieu Faverge
...
...
@@ -39,6 +41,7 @@
* = PastixDriverMM
* = PastixDriverLaplacian
* = PastixDriverXLaplacian
* = PastixDriverGraph
*
* @param[in] filename
* The name of the file that stores the matrix (see driver)
...
...
@@ -75,19 +78,12 @@ spmReadDriver( pastix_driver_t driver,
MPI_Comm_rank
(
comm
,
&
mpirank
);
}
if
(
(
mpirank
==
0
)
||
(
driver
==
PastixDriverLaplacian
)
||
(
driver
==
PastixDriverCSCD
)
||
(
driver
==
PastixDriverBRGMD
)
||
(
driver
==
PastixDriverDMM
)
)
if
(
mpirank
==
0
)
{
switch
(
driver
)
{
case
PastixDriverCCC
:
case
PastixDriverRCC
:
case
PastixDriverOlaf
:
case
PastixDriverPeer
:
fprintf
(
stderr
,
"driver: Driver not implemented
\n
"
);
case
PastixDriverRSA
:
readRSA
(
filename
,
spm
);
break
;
case
PastixDriverHB
:
...
...
@@ -106,25 +102,6 @@ spmReadDriver( pastix_driver_t driver,
readMM
(
filename
,
spm
);
break
;
case
PastixDriverDMM
:
printf
(
"driver: DistributedMatrixMarket file: %s
\n
"
,
filename
);
//readMMD( filename, spm );
break
;
case
PastixDriverPetscS
:
case
PastixDriverPetscU
:
case
PastixDriverPetscH
:
printf
(
"driver: PETSc file: %s
\n
"
,
filename
);
//readPETSC( filename, spm );
if
(
driver
==
PastixDriverPetscS
)
spm
->
mtxtype
=
PastixSymmetric
;
if
(
driver
==
PastixDriverPetscH
)
spm
->
mtxtype
=
PastixHermitian
;
break
;
case
PastixDriverCSCD
:
printf
(
"driver CSCd file: %s
\n
"
,
filename
);
//readCSCD( filename, spm, rhs, comm );
break
;
case
PastixDriverLaplacian
:
if
(
mpirank
==
0
)
printf
(
"driver Laplacian: %s
\n
"
,
filename
);
...
...
@@ -168,126 +145,11 @@ spmReadDriver( pastix_driver_t driver,
#endif
break
;
case
PastixDriverRSA
:
default:
readRSA
(
filename
,
spm
);
fprintf
(
stderr
,
"driver: Driver not implemented
\n
"
);
}
}
/* #ifndef TYPE_COMPLEX */
/* if (*type) */
/* if ((*type)[1] == 'H') */
/* (*type)[1] = 'S'; */
/* #endif */
/* /\* read RHS file *\/ */
/* if (mpirank == 0) */
/* { */
/* FILE *file; */
/* char filename2[256]; */
/* pastix_int_t i; */
/* double re; */
/* sprintf(filename2,"%s.rhs",filename); */
/* fprintf(stderr,"open RHS file : %s\n",filename2); */
/* file = fopen(filename2,"r"); */
/* if (file==NULL) */
/* { */
/* fprintf(stderr,"cannot load %s\n", filename2); */
/* } */
/* else */
/* { */
/* *rhs = (pastix_complex64_t *) malloc((*ncol)*sizeof(pastix_complex64_t)); */
/* for (i = 0; i < *ncol; i++) */
/* { */
/* (*rhs)[i] = 0.0; */
/* if (1 != fscanf(file,"%lg\n", &re)) */
/* { */
/* fprintf(stderr, "ERROR: reading rhs(%ld)\n", (long int)i); */
/* exit(1); */
/* } */
/* (*rhs)[i] = (pastix_complex64_t)re; */
/* } */
/* fclose(file); */
/* } */
/* } */
/* if (*rhs == NULL && ( mpirank == 0 || */
/* driver_type == LAPLACIAN) && */
/* driver_type != CSCD && driver_type != FDUP_DIST && driver_type != MMD) */
/* { */
/* *rhs = (pastix_complex64_t *) malloc((*ncol)*sizeof(pastix_complex64_t)); */
/* pastix_int_t i,j; */
/* for (i = 0; i < *ncol; i++) */
/* (*rhs)[i] = 0.0; */
/* #ifdef TYPE_COMPLEX */
/* fprintf(stdout, "Setting right-hand-side member such as X[i] = i + i*I\n"); */
/* #else */
/* fprintf(stdout, "Setting right-hand-side member such as X[i] = i\n"); */
/* #endif */
/* for (i = 0; i < *ncol; i++) */
/* { */
/* for (j = (*colptr)[i] -1; j < (*colptr)[i+1]-1; j++) */
/* { */
/* #ifdef TYPE_COMPLEX */
/* (*rhs)[(*rows)[j]-1] += (i+1 + I*(i+1))*(*values)[j]; */
/* #else */
/* (*rhs)[(*rows)[j]-1] += (i+1)*(*values)[j]; */
/* #endif */
/* if (MTX_ISSYM((*type)) && i != (*rows)[j]-1) */
/* { */
/* #ifdef TYPE_COMPLEX */
/* (*rhs)[i] += ((*rows)[j] + (*rows)[j] * I)*(*values)[j]; */
/* #else */
/* (*rhs)[i] += ((*rows)[j])*(*values)[j]; */
/* #endif */
/* } */
/* } */
/* } */
/* } */
/* if (driver_type == CSCD || driver_type == FDUP_DIST || driver_type == MMD) */
/* { */
/* pastix_int_t i,j; */
/* pastix_int_t N; */
/* pastix_int_t send[2], recv[2]; */
/* int comm_size; */
/* MPI_Comm_size(comm,&comm_size); */
/* send[0] = *ncol; */
/* send[1] = 0; */
/* if (*ncol != 0 && *rhs == NULL) */
/* send[1] = 1; */
/* MPI_Allreduce(send, recv, 2, PASTIX_MPI_INT, MPI_SUM, comm); */
/* N = recv[0]; */
/* if (recv[1] > 0) */
/* { */
/* pastix_complex64_t *RHS; */
/* pastix_complex64_t *RHS_recv; */
/* RHS = (pastix_complex64_t *) malloc((N)*sizeof(pastix_complex64_t)); */
/* for (i = 0; i < N; i++) */
/* (RHS)[i] = 0.0; */
/* if (mpirank == 0) */
/* fprintf(stdout, "Setting RHS such as X[i] = i\n"); */
/* for (i = 0; i < *ncol; i++) */
/* { */
/* for (j = (*colptr)[i] -1; j < (*colptr)[i+1]-1; j++) */
/* { */
/* (RHS)[(*rows)[j]-1] += ((*loc2glob)[i])*(*values)[j]; */
/* if (MTX_ISSYM((*type)) && i != (*rows)[j]-1) */
/* (RHS)[(*loc2glob)[i]-1] += ((*rows)[j])*(*values)[j]; */
/* } */
/* } */
/* RHS_recv = (pastix_complex64_t *) malloc((N)*sizeof(pastix_complex64_t)); */
/* MPI_Allreduce(RHS, RHS_recv, N, PASTIX_MPI_FLOAT, MPI_SUM, comm); */
/* free(RHS); */
/* *rhs = (pastix_complex64_t *) malloc((*ncol)*sizeof(pastix_complex64_t)); */
/* for (i = 0; i < *ncol; i++) */
/* (*rhs)[i] = RHS_recv[(*loc2glob)[i]-1]; */
/* } */
/* } */
if
(
mpiinit
)
{
pastix_int_t
nnz
;
...
...
@@ -309,15 +171,11 @@ spmReadDriver( pastix_driver_t driver,
spm
->
values
=
(
void
*
)
malloc
(
nnz
*
pastix_size_of
(
spm
->
flttype
));
spm
->
loc2glob
=
NULL
;
spm
->
loc2glob
=
NULL
;
/* spm->rhs = (void *) malloc((*ncol)*sizeof(pastix_complex64_t)); */
/* spm->type = (char *) malloc(4*sizeof(char)); */
}
MPI_Bcast
(
spm
->
colptr
,
spm
->
gN
+
1
,
PASTIX_MPI_INT
,
0
,
comm
);
MPI_Bcast
(
spm
->
rowptr
,
nnz
,
PASTIX_MPI_INT
,
0
,
comm
);
MPI_Bcast
(
spm
->
values
,
nnz
*
pastix_size_of
(
spm
->
flttype
),
MPI_CHAR
,
0
,
comm
);
/* MPI_Bcast(*rhs, *ncol, PASTIX_MPI_FLOAT, 0, comm); */
/* MPI_Bcast(*type, 4, MPI_CHAR, 0, comm); */
}
spmUpdateComputedFields
(
spm
);
...
...
This diff is collapsed.
Click to expand it.
z_spm.h
+
1
−
1
View file @
3d2a0bbf
...
...
@@ -21,7 +21,7 @@
/**
* Integer routines
*/
int
z_spmIntSortAsc
(
void
**
const
pbase
,
const
pastix_int_t
n
);
void
z_spmIntSortAsc
(
void
**
const
pbase
,
const
pastix_int_t
n
);
/**
* Conversion routines
...
...
This diff is collapsed.
Click to expand it.
z_spm_integer.c
+
13
−
2
View file @
3d2a0bbf
/**
*
* @file z_spm_integer
s
.c
* @file z_spm_integer.c
*
* PaStiX spm routines
* PaStiX is a software package provided by Inria Bordeaux - Sud-Ouest,
...
...
@@ -24,14 +24,24 @@
/**
*******************************************************************************
*
* @fn void z_spmIntSortAsc(void ** const pbase, const pastix_int_t n)
* @ingroup pastix_spm_dev
*
* @brief Sort 2 arrays simultaneously, the first array is an array of
* pastix_int_t and used as key for sorting. The second array is an array of
* pastix_complex64_t.
*
*******************************************************************************
*
* @param[in,out] pbase
* Couple of pointers to an array of integers and to an array of
* pastix_complex64_t to sort.
*
* @param[in] n
* The number of elements in the array.
*
*******************************************************************************
*/
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static
size_t
intsortsize
[
2
]
=
{
sizeof
(
pastix_int_t
),
sizeof
(
pastix_complex64_t
)
};
#define INTSORTNAME z_spmIntSortAsc
#define INTSORTSIZE(x) (intsortsize[x])
...
...
@@ -58,4 +68,5 @@ static size_t intsortsize[2] = { sizeof(pastix_int_t), sizeof(pastix_complex64_t
#undef INTSORTSWAP
#undef INTSORTCMP
#undef INTSORTNTAB
#endif
/* DOXYGEN_SHOULD_SKIP_THIS */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment