Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-uggrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
staging
dune-uggrid
Commits
963e8545
Commit
963e8545
authored
7 years ago
by
Ansgar Burchardt
Browse files
Options
Downloads
Patches
Plain Diff
Generalize gather/scatter functions for the `message_buffer` used by dune-grid
parent
bcb4bd8c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!55
Support for transferring element data during load balancing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parallel/dddif/handler.cc
+15
-13
15 additions, 13 deletions
parallel/dddif/handler.cc
with
15 additions
and
13 deletions
parallel/dddif/handler.cc
+
15
−
13
View file @
963e8545
...
...
@@ -812,29 +812,31 @@ static void BVertexGather (DDD_OBJ obj, int cnt, DDD_TYPE type_id, void *Data)
* The first sizeof(int) bytes of the message_buffer is the length of
* the message (without the size of the int).
*/
static
void
DuneNodeGather
(
DDD_OBJ
obj
,
int
cnt
,
DDD_TYPE
type_id
,
void
*
Data
)
template
<
typename
Entity
>
static
void
DuneEntityGather
(
DDD_OBJ
obj
,
int
cnt
,
DDD_TYPE
type_id
,
void
*
Data
)
{
char
*
data
=
static_cast
<
char
*>
(
Data
);
const
NODE
*
node
=
reinterpret_cast
<
NODE
*>
(
obj
);
const
auto
sizeOfSize
=
sizeof
node
->
message_buffer_size
;
const
Entity
*
entity
=
reinterpret_cast
<
Entity
*>
(
obj
);
const
auto
sizeOfSize
=
sizeof
entity
->
message_buffer_size
;
std
::
memcpy
(
data
,
&
node
->
message_buffer_size
,
sizeOfSize
);
std
::
memcpy
(
data
,
&
entity
->
message_buffer_size
,
sizeOfSize
);
data
+=
sizeOfSize
;
std
::
memcpy
(
data
,
node
->
message_buffer
,
node
->
message_buffer_size
);
std
::
memcpy
(
data
,
entity
->
message_buffer
,
entity
->
message_buffer_size
);
}
static
void
DuneNodeScatter
(
DDD_OBJ
obj
,
int
cnt
,
DDD_TYPE
type_id
,
void
*
Data
,
int
newness
)
template
<
typename
Entity
>
static
void
DuneEntityScatter
(
DDD_OBJ
obj
,
int
cnt
,
DDD_TYPE
type_id
,
void
*
Data
,
int
newness
)
{
const
char
*
data
=
static_cast
<
const
char
*>
(
Data
);
NODE
*
node
=
reinterpret_cast
<
NODE
*>
(
obj
);
const
auto
sizeOfSize
=
sizeof
node
->
message_buffer_size
;
Entity
*
entity
=
reinterpret_cast
<
Entity
*>
(
obj
);
const
auto
sizeOfSize
=
sizeof
entity
->
message_buffer_size
;
std
::
memcpy
(
&
node
->
message_buffer_size
,
data
,
sizeOfSize
);
std
::
memcpy
(
&
entity
->
message_buffer_size
,
data
,
sizeOfSize
);
data
+=
sizeOfSize
;
node
->
message_buffer
=
static_cast
<
char
*>
(
std
::
malloc
(
node
->
message_buffer_size
));
std
::
memcpy
(
node
->
message_buffer
,
data
,
node
->
message_buffer_size
);
entity
->
message_buffer
=
static_cast
<
char
*>
(
std
::
malloc
(
entity
->
message_buffer_size
));
std
::
memcpy
(
entity
->
message_buffer
,
data
,
entity
->
message_buffer_size
);
}
static
void
BVertexScatter
(
DDD_OBJ
obj
,
int
cnt
,
DDD_TYPE
type_id
,
void
*
Data
,
int
newness
)
...
...
@@ -2207,8 +2209,8 @@ void NS_DIM_PREFIX ddd_HandlerInit (INT handlerSet)
DDD_SetHandlerXFERSCATTER
(
TypeBVertex
,
BVertexScatter
);
DDD_SetHandlerSETPRIORITY
(
TypeBVertex
,
VertexPriorityUpdate
);
DDD_SetHandlerXFERGATHER
(
TypeNode
,
Dune
NodeGather
);
DDD_SetHandlerXFERSCATTER
(
TypeNode
,
Dune
Node
Scatter
);
DDD_SetHandlerXFERGATHER
(
TypeNode
,
Dune
EntityGather
<
NODE
>
);
DDD_SetHandlerXFERSCATTER
(
TypeNode
,
Dune
Entity
Scatter
<
NODE
>
);
DDD_SetHandlerLDATACONSTRUCTOR
(
TypeNode
,
NodeObjInit
);
DDD_SetHandlerDESTRUCTOR
(
TypeNode
,
NodeDestructor
);
...
...
This diff is collapsed.
Click to expand it.
Ansgar Burchardt
@ansgar
mentioned in commit
2547672c
·
7 years ago
mentioned in commit
2547672c
mentioned in commit 2547672cf7164b37797b1f056ee537ac85d61177
Toggle commit list
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