Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Chameleon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
Chameleon
Commits
7909dfd8
Commit
7909dfd8
authored
3 years ago
by
Matthieu KUHN
Committed by
Mathieu Faverge
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
testings: Add getrf testing driver
parent
2c6c30e0
No related branches found
No related tags found
1 merge request
!364
GETRF: Introduce the code skeleton to work on a partial pivoting version
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
testing/CMakeLists.txt
+1
-0
1 addition, 0 deletions
testing/CMakeLists.txt
testing/testing_zgetrf.c
+159
-0
159 additions, 0 deletions
testing/testing_zgetrf.c
with
160 additions
and
0 deletions
testing/CMakeLists.txt
+
1
−
0
View file @
7909dfd8
...
...
@@ -78,6 +78,7 @@ set(ZSRC_WO_STDAPI
testing_zgenm2.c
testing_zgesv_nopiv.c
testing_zgesvd.c
testing_zgetrf.c
testing_zgetrf_nopiv.c
testing_zgetrs_nopiv.c
testing_zgeqrf.c
...
...
This diff is collapsed.
Click to expand it.
testing/testing_zgetrf.c
0 → 100644
+
159
−
0
View file @
7909dfd8
/**
*
* @file testing_zgetrf.c
*
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
*
* @brief Chameleon zgetrf testing
*
* @version 1.2.0
* @author Lucas Barros de Assis
* @author Mathieu Faverge
* @author Alycia Lisito
* @date 2022-02-22
* @precisions normal z -> c d s
*
*/
#include
<chameleon.h>
#include
"testings.h"
#include
"testing_zcheck.h"
#include
<chameleon/flops.h>
#include
<coreblas/lapacke.h>
#if !defined(CHAMELEON_TESTINGS_VENDOR)
int
testing_zgetrf_desc
(
run_arg_list_t
*
args
,
int
check
)
{
testdata_t
test_data
=
{
.
args
=
args
};
int
hres
=
0
;
/* Read arguments */
int
async
=
parameters_getvalue_int
(
"async"
);
intptr_t
mtxfmt
=
parameters_getvalue_int
(
"mtxfmt"
);
int
nb
=
run_arg_get_int
(
args
,
"nb"
,
320
);
int
P
=
parameters_getvalue_int
(
"P"
);
int
N
=
run_arg_get_int
(
args
,
"N"
,
1000
);
int
M
=
run_arg_get_int
(
args
,
"M"
,
N
);
int
LDA
=
run_arg_get_int
(
args
,
"LDA"
,
M
);
int
seedA
=
run_arg_get_int
(
args
,
"seedA"
,
random
()
);
cham_diag_t
diag
=
run_arg_get_diag
(
args
,
"diag"
,
ChamNonUnit
);
int
Q
=
parameters_compute_q
(
P
);
/* Descriptors */
CHAM_desc_t
*
descA
;
void
*
ws
=
NULL
;
CHAMELEON_Set
(
CHAMELEON_TILE_SIZE
,
nb
);
/* Creates the matrices */
CHAMELEON_Desc_Create
(
&
descA
,
(
void
*
)(
-
mtxfmt
),
ChamComplexDouble
,
nb
,
nb
,
nb
*
nb
,
LDA
,
N
,
0
,
0
,
M
,
N
,
P
,
Q
);
/* Fills the matrix with random values */
if
(
diag
==
ChamUnit
)
{
CHAMELEON_zplgtr_Tile
(
0
,
ChamUpper
,
descA
,
seedA
);
CHAMELEON_zplgtr_Tile
(
0
,
ChamLower
,
descA
,
seedA
+
1
);
}
else
{
CHAMELEON_zplrnt_Tile
(
descA
,
seedA
);
}
if
(
async
)
{
ws
=
CHAMELEON_zgetrf_WS_Alloc
(
descA
);
}
/* Calculates the solution */
testing_start
(
&
test_data
);
if
(
async
)
{
hres
=
CHAMELEON_zgetrf_Tile_Async
(
descA
,
ws
,
test_data
.
sequence
,
&
test_data
.
request
);
CHAMELEON_Desc_Flush
(
descA
,
test_data
.
sequence
);
}
else
{
hres
=
CHAMELEON_zgetrf_Tile
(
descA
);
}
test_data
.
hres
=
hres
;
testing_stop
(
&
test_data
,
flops_zgetrf
(
M
,
N
)
);
/* Checks the factorization and residual */
#if !defined(CHAMELEON_SIMULATION)
if
(
check
)
{
CHAM_desc_t
*
descA0c
;
CHAM_desc_t
*
descA0
=
CHAMELEON_Desc_Copy
(
descA
,
NULL
);
/* Create A0c as local to rank 0 on all nodes */
CHAMELEON_Desc_Create_User
(
&
descA0c
,
(
void
*
)
CHAMELEON_MAT_ALLOC_GLOBAL
,
ChamComplexDouble
,
nb
,
nb
,
nb
*
nb
,
M
,
N
,
0
,
0
,
M
,
N
,
1
,
1
,
chameleon_getaddr_cm
,
chameleon_getblkldd_cm
,
NULL
);
if
(
diag
==
ChamUnit
)
{
CHAMELEON_zplgtr_Tile
(
0
,
ChamUpper
,
descA0
,
seedA
);
CHAMELEON_zplgtr_Tile
(
0
,
ChamLower
,
descA0
,
seedA
+
1
);
}
else
{
CHAMELEON_zplrnt_Tile
(
descA0
,
seedA
);
}
/* Compute the permutation of A0: P * A0 */
if
(
CHAMELEON_Comm_rank
()
==
0
)
{
int
i
,
j
;
int
*
ipiv
=
(
int
*
)
calloc
(
M
,
sizeof
(
int
)
);
for
(
i
=
0
;
i
<
M
;
i
++
)
{
ipiv
[
i
]
=
i
+
1
;
}
LAPACKE_zlaswp
(
LAPACK_COL_MAJOR
,
N
,
descA0c
->
mat
,
M
,
1
,
M
,
ipiv
,
1
);
free
(
ipiv
);
}
CHAMELEON_zlacpy_Tile
(
ChamUpperLower
,
descA0c
,
descA0
);
CHAMELEON_Desc_Destroy
(
&
descA0c
);
hres
+=
check_zxxtrf
(
args
,
ChamGeneral
,
ChamUpperLower
,
descA0
,
descA
);
CHAMELEON_Desc_Destroy
(
&
descA0
);
}
#endif
/* !defined(CHAMELEON_SIMULATION) */
if
(
ws
!=
NULL
)
{
CHAMELEON_zgetrf_WS_Free
(
descA
,
ws
);
}
CHAMELEON_Desc_Destroy
(
&
descA
);
return
hres
;
}
#endif
testing_t
test_zgetrf
;
const
char
*
zgetrf_params
[]
=
{
"mtxfmt"
,
"nb"
,
"m"
,
"n"
,
"lda"
,
"seedA"
,
"diag"
,
NULL
};
const
char
*
zgetrf_output
[]
=
{
NULL
};
const
char
*
zgetrf_outchk
[]
=
{
"||A||"
,
"||A-fact(A)||"
,
"RETURN"
,
NULL
};
/**
* @brief Testing registration function
*/
void
testing_zgetrf_init
(
void
)
__attribute__
(
(
constructor
)
);
void
testing_zgetrf_init
(
void
)
{
test_zgetrf
.
name
=
"zgetrf"
;
test_zgetrf
.
helper
=
"General LU factorization (with partial pivoting)"
;
test_zgetrf
.
params
=
zgetrf_params
;
test_zgetrf
.
output
=
zgetrf_output
;
test_zgetrf
.
outchk
=
zgetrf_outchk
;
#if defined(CHAMELEON_TESTINGS_VENDOR)
test_zgetrf
.
fptr_desc
=
NULL
;
#else
test_zgetrf
.
fptr_desc
=
testing_zgetrf_desc
;
#endif
test_zgetrf
.
fptr_std
=
NULL
;
/* testing_zgetrf_std; */
test_zgetrf
.
next
=
NULL
;
testing_register
(
&
test_zgetrf
);
}
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