Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ddm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gmsh
ddm
Commits
722e87ec
Commit
722e87ec
authored
2 months ago
by
Roland Greffe
Browse files
Options
Downloads
Patches
Plain Diff
added mem estimation
parent
e17eee14
No related branches found
No related tags found
No related merge requests found
Pipeline
#12867
failed
2 months ago
Stage: gmshfem
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/problem/MagmaHelper.cpp
+10
-0
10 additions, 0 deletions
src/problem/MagmaHelper.cpp
with
10 additions
and
0 deletions
src/problem/MagmaHelper.cpp
+
10
−
0
View file @
722e87ec
...
@@ -575,11 +575,15 @@ namespace gmshddm
...
@@ -575,11 +575,15 @@ namespace gmshddm
std
::
cout
<<
" - lddMult : "
<<
_lddMult
<<
std
::
endl
;
std
::
cout
<<
" - lddMult : "
<<
_lddMult
<<
std
::
endl
;
std
::
cout
<<
" - sizeMult : "
<<
_sizeMult
<<
std
::
endl
;
std
::
cout
<<
" - sizeMult : "
<<
_sizeMult
<<
std
::
endl
;
size_t
requiredMemory
=
_sizeMult
*
sizeof
(
Magma_Scalar
)
+
_rhsMat_n
*
_numMatrices
*
sizeof
(
Magma_Scalar
);
std
::
cout
<<
" - Required memory : "
<<
requiredMemory
/
1e9
<<
std
::
endl
;
_h_Mult
=
(
Magma_Scalar
*
)
calloc
(
sizeof
(
Magma_Scalar
),
_sizeMult
);
_h_Mult
=
(
Magma_Scalar
*
)
calloc
(
sizeof
(
Magma_Scalar
),
_sizeMult
);
//magma_malloc_cpu( (void**) &_h_Mult, _sizeMult*sizeof(Magma_Scalar) );
//magma_malloc_cpu( (void**) &_h_Mult, _sizeMult*sizeof(Magma_Scalar) );
std
::
cout
<<
"Allocation done"
<<
std
::
endl
;
std
::
cout
<<
"Allocation done"
<<
std
::
endl
;
// Fill the arrays
// Fill the arrays
size_t
sparseCount
=
0
;
for
(
size_t
i
=
0
;
i
<
_numMatrices
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
_numMatrices
;
++
i
)
{
auto
matrix
=
rhsMatricesSparsified
[
_ids
[
i
]];
// Make sure that the order is correct
auto
matrix
=
rhsMatricesSparsified
[
_ids
[
i
]];
// Make sure that the order is correct
PetscInt
m
,
n
;
// m = number of rows, n = number of columns
PetscInt
m
,
n
;
// m = number of rows, n = number of columns
...
@@ -590,6 +594,9 @@ namespace gmshddm
...
@@ -590,6 +594,9 @@ namespace gmshddm
for
(
PetscInt
j
=
0
;
j
<
m
;
++
j
)
{
for
(
PetscInt
j
=
0
;
j
<
m
;
++
j
)
{
PetscScalar
value
;
PetscScalar
value
;
MatGetValue
(
matrix
,
j
,
k
,
&
value
);
MatGetValue
(
matrix
,
j
,
k
,
&
value
);
if
(
!
(
value
.
real
()
==
0.0
&&
value
.
imag
()
==
0.0
))
{
sparseCount
++
;
}
if
constexpr
(
std
::
is_same_v
<
T_Scalar
,
std
::
complex
<
double
>>
)
{
if
constexpr
(
std
::
is_same_v
<
T_Scalar
,
std
::
complex
<
double
>>
)
{
_h_Mult
[
i
*
_ldMult
*
_rhsMat_n
+
k
*
_ldMult
+
j
]
=
MAGMA_Z_MAKE
(
value
.
real
(),
value
.
imag
());
_h_Mult
[
i
*
_ldMult
*
_rhsMat_n
+
k
*
_ldMult
+
j
]
=
MAGMA_Z_MAKE
(
value
.
real
(),
value
.
imag
());
}
else
if
constexpr
(
std
::
is_same_v
<
T_Scalar
,
std
::
complex
<
float
>>
)
{
}
else
if
constexpr
(
std
::
is_same_v
<
T_Scalar
,
std
::
complex
<
float
>>
)
{
...
@@ -602,6 +609,9 @@ namespace gmshddm
...
@@ -602,6 +609,9 @@ namespace gmshddm
}
}
}
}
}
}
std
::
cout
<<
"Required sparse memory : "
<<
sparseCount
*
(
sizeof
(
Magma_Scalar
)
+
2
*
sizeof
(
size_t
))
/
1e9
<<
std
::
endl
;
// Matrices filled
// Matrices filled
// Allocate device memory
// Allocate device memory
...
...
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