Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thallium
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sds
thallium
Commits
dfa768ca
Commit
dfa768ca
authored
Oct 04, 2018
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added an eager mode to bulk
parent
506b0fb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
include/thallium/bulk.hpp
include/thallium/bulk.hpp
+24
-6
No files found.
include/thallium/bulk.hpp
View file @
dfa768ca
...
...
@@ -33,6 +33,7 @@ private:
engine
*
m_engine
;
hg_bulk_t
m_bulk
;
bool
m_is_local
;
bool
m_eager_mode
;
/**
* @brief Constructor. Made private as bulk objects
...
...
@@ -45,7 +46,7 @@ private:
* local to this process.
*/
bulk
(
engine
&
e
,
hg_bulk_t
b
,
bool
local
)
:
m_engine
(
&
e
),
m_bulk
(
b
),
m_is_local
(
local
)
{}
:
m_engine
(
&
e
),
m_bulk
(
b
),
m_is_local
(
local
)
,
m_eager_mode
(
false
)
{}
/**
* @brief The bulk_segment class represents a portion
...
...
@@ -135,13 +136,14 @@ public:
* object as class member and associate it later with an actual bulk.
*/
bulk
()
:
m_engine
(
nullptr
),
m_bulk
(
HG_BULK_NULL
),
m_is_local
(
false
)
{}
:
m_engine
(
nullptr
),
m_bulk
(
HG_BULK_NULL
),
m_is_local
(
false
)
,
m_eager_mode
(
false
)
{}
/**
* @brief Copy constructor.
*/
bulk
(
const
bulk
&
other
)
:
m_engine
(
other
.
m_engine
),
m_bulk
(
other
.
m_bulk
),
m_is_local
(
other
.
m_is_local
)
{
:
m_engine
(
other
.
m_engine
),
m_bulk
(
other
.
m_bulk
),
m_is_local
(
other
.
m_is_local
),
m_eager_mode
(
other
.
m_eager_mode
)
{
hg_return_t
ret
=
margo_bulk_ref_incr
(
m_bulk
);
MARGO_ASSERT
(
ret
,
margo_bulk_ref_incr
);
}
...
...
@@ -150,7 +152,9 @@ public:
* @brief Move constructor.
*/
bulk
(
bulk
&&
other
)
:
m_engine
(
other
.
m_engine
),
m_bulk
(
other
.
m_bulk
),
m_is_local
(
std
::
move
(
other
.
m_is_local
))
{
:
m_engine
(
other
.
m_engine
),
m_bulk
(
other
.
m_bulk
),
m_is_local
(
other
.
m_is_local
),
m_eager_mode
(
other
.
m_eager_mode
)
{
other
.
m_bulk
=
HG_BULK_NULL
;
}
...
...
@@ -166,6 +170,7 @@ public:
m_bulk
=
other
.
m_bulk
;
m_engine
=
other
.
m_engine
;
m_is_local
=
other
.
m_is_local
;
m_eager_mode
=
other
.
m_eager_mode
;
if
(
m_bulk
!=
HG_BULK_NULL
)
{
hg_return_t
ret
=
margo_bulk_ref_incr
(
m_bulk
);
MARGO_ASSERT
(
ret
,
margo_bulk_ref_incr
);
...
...
@@ -185,6 +190,7 @@ public:
m_engine
=
other
.
m_engine
;
m_bulk
=
other
.
m_bulk
;
m_is_local
=
other
.
m_is_local
;
m_eager_mode
=
other
.
m_eager_mode
;
other
.
m_bulk
=
HG_BULK_NULL
;
return
*
this
;
}
...
...
@@ -220,6 +226,17 @@ public:
return
m_bulk
==
HG_BULK_NULL
;
}
/**
* @brief Set the eager mode. When eager mode is true,
* Mercury will try to send the bulk's exposed data along
* with the bulk handle when sending the bulk handle over RPC.
*
* @param eager Whether to use eager mode or not.
*/
void
set_eager_mode
(
bool
eager
)
{
m_eager_mode
=
eager
;
}
/**
* @brief Builds a remote_bulk object by associating it with an endpoint.
*
...
...
@@ -280,9 +297,10 @@ public:
std
::
vector
<
char
>
buf
;
ar
&
buf
;
}
else
{
hg_size_t
s
=
margo_bulk_get_serialize_size
(
m_bulk
,
HG_FALSE
);
auto
use_eager
=
m_eager_mode
?
HG_TRUE
:
HG_FALSE
;
hg_size_t
s
=
margo_bulk_get_serialize_size
(
m_bulk
,
use_eager
);
std
::
vector
<
char
>
buf
(
s
);
hg_return_t
ret
=
margo_bulk_serialize
(
&
buf
[
0
],
s
,
HG_FALSE
,
m_bulk
);
hg_return_t
ret
=
margo_bulk_serialize
(
&
buf
[
0
],
s
,
use_eager
,
m_bulk
);
MARGO_ASSERT
(
ret
,
margo_bulk_serialize
);
ar
&
buf
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment