Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
33b3de4e
Commit
33b3de4e
authored
1 year ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Use links to avoid duplication of item numbers storage
parent
3e277d18
No related branches found
No related tags found
1 merge request
!176
Add HDF5 support
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dev/ParallelChecker.hpp
+34
-4
34 additions, 4 deletions
src/dev/ParallelChecker.hpp
with
34 additions
and
4 deletions
src/dev/ParallelChecker.hpp
+
34
−
4
View file @
33b3de4e
...
...
@@ -195,6 +195,25 @@ class ParallelChecker
return
table
;
}
size_t
_getConnectivityId
(
const
std
::
shared_ptr
<
const
IConnectivity
>&
i_connectivity
)
const
{
switch
(
i_connectivity
->
dimension
())
{
case
1
:
{
return
dynamic_cast
<
const
Connectivity
<
1
>&>
(
*
i_connectivity
).
id
();
}
case
2
:
{
return
dynamic_cast
<
const
Connectivity
<
2
>&>
(
*
i_connectivity
).
id
();
}
case
3
:
{
return
dynamic_cast
<
const
Connectivity
<
3
>&>
(
*
i_connectivity
).
id
();
}
default
:
{
throw
UnexpectedError
(
"unexpected connectivity dimension"
);
}
}
}
template
<
ItemType
item_type
>
Array
<
const
int
>
_getItemNumber
(
const
std
::
shared_ptr
<
const
IConnectivity
>&
i_connectivity
)
const
...
...
@@ -243,9 +262,20 @@ class ParallelChecker
template
<
ItemType
item_type
>
void
_writeItemNumbers
(
const
std
::
shared_ptr
<
const
IConnectivity
>
i_connectivity
,
HighFive
::
Group
group
)
const
_writeItemNumbers
(
const
std
::
shared_ptr
<
const
IConnectivity
>
i_connectivity
,
HighFive
::
File
file
,
HighFive
::
Group
group
)
const
{
this
->
_writeArray
(
group
,
"numbers"
,
this
->
_getItemNumber
<
item_type
>
(
i_connectivity
));
std
::
string
item_number_path
=
"/connectivities/"
+
std
::
to_string
(
this
->
_getConnectivityId
(
i_connectivity
))
+
'/'
+
std
::
string
{
itemName
(
item_type
)};
if
(
not
file
.
exist
(
item_number_path
))
{
HighFive
::
Group
item_number_group
=
file
.
createGroup
(
item_number_path
);
this
->
_writeArray
(
item_number_group
,
"numbers"
,
this
->
_getItemNumber
<
item_type
>
(
i_connectivity
));
}
HighFive
::
DataSet
item_numbers
=
file
.
getDataSet
(
item_number_path
+
"/numbers"
);
group
.
createHardLink
(
"numbers"
,
item_numbers
);
}
template
<
typename
DataType
,
ItemType
item_type
>
...
...
@@ -358,7 +388,7 @@ class ParallelChecker
this
->
_writeArray
(
group
,
name
,
item_value
.
arrayView
());
this
->
_writeItemNumbers
<
item_type
>
(
i_connectivity
,
group
);
this
->
_writeItemNumbers
<
item_type
>
(
i_connectivity
,
file
,
group
);
++
m_tag
;
...
...
@@ -395,7 +425,7 @@ class ParallelChecker
this
->
_writeTable
(
group
,
name
,
item_array
.
tableView
());
this
->
_writeItemNumbers
<
item_type
>
(
i_connectivity
,
group
);
this
->
_writeItemNumbers
<
item_type
>
(
i_connectivity
,
file
,
group
);
++
m_tag
;
...
...
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