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
12499ce2
Commit
12499ce2
authored
Jun 26, 2018
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-argobots-wrappers' into 'master'
replaced ignore_reponse with disable_response See merge request
!5
parents
0fabe659
932d68b6
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
41 additions
and
35 deletions
+41
-35
examples/01_hello/client.cpp
examples/01_hello/client.cpp
+1
-1
examples/01_hello/server.cpp
examples/01_hello/server.cpp
+2
-2
examples/02_sum/server.cpp
examples/02_sum/server.cpp
+1
-1
examples/03_lambda/server.cpp
examples/03_lambda/server.cpp
+1
-1
examples/04_stop/server.cpp
examples/04_stop/server.cpp
+1
-1
examples/05_stl/client.cpp
examples/05_stl/client.cpp
+1
-1
examples/05_stl/server.cpp
examples/05_stl/server.cpp
+2
-2
examples/06_custom/server.cpp
examples/06_custom/server.cpp
+1
-1
examples/07_rdma/client.cpp
examples/07_rdma/client.cpp
+1
-1
examples/07_rdma/server.cpp
examples/07_rdma/server.cpp
+3
-2
examples/08_async/server.cpp
examples/08_async/server.cpp
+1
-1
examples/09_provider/client.cpp
examples/09_provider/client.cpp
+2
-2
examples/09_provider/server.cpp
examples/09_provider/server.cpp
+1
-1
include/thallium/provider.hpp
include/thallium/provider.hpp
+8
-8
include/thallium/remote_procedure.hpp
include/thallium/remote_procedure.hpp
+6
-1
src/remote_procedure.cpp
src/remote_procedure.cpp
+1
-1
test/TestBulkClient.cpp
test/TestBulkClient.cpp
+3
-3
test/TestBulkServer.cpp
test/TestBulkServer.cpp
+1
-1
test/TestHelloWorldClient.cpp
test/TestHelloWorldClient.cpp
+3
-3
test/TestHelloWorldServer.cpp
test/TestHelloWorldServer.cpp
+1
-1
No files found.
examples/01_hello/client.cpp
View file @
12499ce2
...
...
@@ -9,7 +9,7 @@ int main(int argc, char** argv) {
exit
(
0
);
}
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_CLIENT_MODE
);
tl
::
remote_procedure
hello
=
myEngine
.
define
(
"hello"
).
ignor
e_response
();
tl
::
remote_procedure
hello
=
myEngine
.
define
(
"hello"
).
disabl
e_response
();
tl
::
endpoint
server
=
myEngine
.
lookup
(
argv
[
1
]);
hello
.
on
(
server
)();
...
...
examples/01_hello/server.cpp
View file @
12499ce2
...
...
@@ -10,8 +10,8 @@ void hello(const tl::request& req) {
int
main
(
int
argc
,
char
**
argv
)
{
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_SERVER_MODE
);
std
::
cout
<<
"Server running at address "
<<
(
std
::
string
)
myEngine
.
self
()
<<
std
::
endl
;
myEngine
.
define
(
"hello"
,
hello
).
ignor
e_response
();
std
::
cout
<<
"Server running at address "
<<
myEngine
.
self
()
<<
std
::
endl
;
myEngine
.
define
(
"hello"
,
hello
).
disabl
e_response
();
return
0
;
}
...
...
examples/02_sum/server.cpp
View file @
12499ce2
...
...
@@ -11,7 +11,7 @@ void sum(const tl::request& req, int x, int y) {
int
main
(
int
argc
,
char
**
argv
)
{
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_SERVER_MODE
);
std
::
cout
<<
"Server running at address "
<<
(
std
::
string
)
myEngine
.
self
()
<<
std
::
endl
;
std
::
cout
<<
"Server running at address "
<<
myEngine
.
self
()
<<
std
::
endl
;
myEngine
.
define
(
"sum"
,
sum
);
return
0
;
...
...
examples/03_lambda/server.cpp
View file @
12499ce2
...
...
@@ -6,7 +6,7 @@ namespace tl = thallium;
int
main
(
int
argc
,
char
**
argv
)
{
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_SERVER_MODE
);
std
::
cout
<<
"Server running at address "
<<
(
std
::
string
)
myEngine
.
self
()
<<
std
::
endl
;
std
::
cout
<<
"Server running at address "
<<
myEngine
.
self
()
<<
std
::
endl
;
std
::
function
<
void
(
const
tl
::
request
&
,
int
,
int
)
>
sum
=
[](
const
tl
::
request
&
req
,
int
x
,
int
y
)
{
...
...
examples/04_stop/server.cpp
View file @
12499ce2
...
...
@@ -6,7 +6,7 @@ namespace tl = thallium;
int
main
(
int
argc
,
char
**
argv
)
{
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_SERVER_MODE
);
std
::
cout
<<
"Server running at address "
<<
(
std
::
string
)
myEngine
.
self
()
<<
std
::
endl
;
std
::
cout
<<
"Server running at address "
<<
myEngine
.
self
()
<<
std
::
endl
;
std
::
function
<
void
(
const
tl
::
request
&
,
int
,
int
)
>
sum
=
[
&
myEngine
](
const
tl
::
request
&
req
,
int
x
,
int
y
)
{
...
...
examples/05_stl/client.cpp
View file @
12499ce2
...
...
@@ -10,7 +10,7 @@ int main(int argc, char** argv) {
exit
(
0
);
}
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_CLIENT_MODE
);
tl
::
remote_procedure
hello
=
myEngine
.
define
(
"hello"
).
ignor
e_response
();
tl
::
remote_procedure
hello
=
myEngine
.
define
(
"hello"
).
disabl
e_response
();
tl
::
endpoint
server
=
myEngine
.
lookup
(
argv
[
1
]);
std
::
string
name
=
"Matthieu"
;
hello
.
on
(
server
)(
name
);
...
...
examples/05_stl/server.cpp
View file @
12499ce2
...
...
@@ -12,8 +12,8 @@ void hello(const tl::request& req, const std::string& name) {
int
main
(
int
argc
,
char
**
argv
)
{
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_SERVER_MODE
);
std
::
cout
<<
"Server running at address "
<<
(
std
::
string
)
myEngine
.
self
()
<<
std
::
endl
;
myEngine
.
define
(
"hello"
,
hello
).
ignor
e_response
();
std
::
cout
<<
"Server running at address "
<<
myEngine
.
self
()
<<
std
::
endl
;
myEngine
.
define
(
"hello"
,
hello
).
disabl
e_response
();
return
0
;
}
...
...
examples/06_custom/server.cpp
View file @
12499ce2
...
...
@@ -7,7 +7,7 @@ namespace tl = thallium;
int
main
(
int
argc
,
char
**
argv
)
{
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_SERVER_MODE
);
std
::
cout
<<
"Server running at address "
<<
(
std
::
string
)
myEngine
.
self
()
<<
std
::
endl
;
std
::
cout
<<
"Server running at address "
<<
myEngine
.
self
()
<<
std
::
endl
;
std
::
function
<
void
(
const
tl
::
request
&
,
const
point
&
,
const
point
&
)
>
dot_product
=
[
&
myEngine
](
const
tl
::
request
&
req
,
const
point
&
p
,
const
point
&
q
)
{
...
...
examples/07_rdma/client.cpp
View file @
12499ce2
...
...
@@ -9,7 +9,7 @@ int main(int argc, char** argv) {
exit
(
0
);
}
tl
::
engine
myEngine
(
"tcp"
,
MARGO_CLIENT_MODE
);
tl
::
remote_procedure
remote_do_rdma
=
myEngine
.
define
(
"do_rdma"
)
.
ignore_response
()
;
tl
::
remote_procedure
remote_do_rdma
=
myEngine
.
define
(
"do_rdma"
);
tl
::
endpoint
server_endpoint
=
myEngine
.
lookup
(
argv
[
1
]);
std
::
string
buffer
=
"Matthieu"
;
...
...
examples/07_rdma/server.cpp
View file @
12499ce2
...
...
@@ -7,7 +7,7 @@ namespace tl = thallium;
int
main
(
int
argc
,
char
**
argv
)
{
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_SERVER_MODE
);
std
::
cout
<<
"Server running at address "
<<
(
std
::
string
)
myEngine
.
self
()
<<
std
::
endl
;
std
::
cout
<<
"Server running at address "
<<
myEngine
.
self
()
<<
std
::
endl
;
std
::
function
<
void
(
const
tl
::
request
&
,
tl
::
bulk
&
)
>
f
=
[
&
myEngine
](
const
tl
::
request
&
req
,
tl
::
bulk
&
b
)
{
...
...
@@ -21,7 +21,8 @@ int main(int argc, char** argv) {
std
::
cout
<<
"Server received bulk: "
;
for
(
auto
c
:
v
)
std
::
cout
<<
c
;
std
::
cout
<<
std
::
endl
;
req
.
respond
(
1
);
};
myEngine
.
define
(
"do_rdma"
,
f
)
.
ignore_response
()
;
myEngine
.
define
(
"do_rdma"
,
f
);
}
examples/08_async/server.cpp
View file @
12499ce2
...
...
@@ -11,7 +11,7 @@ void sum(const tl::request& req, int x, int y) {
int
main
(
int
argc
,
char
**
argv
)
{
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_SERVER_MODE
);
std
::
cout
<<
"Server running at address "
<<
(
std
::
string
)
myEngine
.
self
()
<<
std
::
endl
;
std
::
cout
<<
"Server running at address "
<<
myEngine
.
self
()
<<
std
::
endl
;
myEngine
.
define
(
"sum"
,
sum
);
return
0
;
...
...
examples/09_provider/client.cpp
View file @
12499ce2
...
...
@@ -12,8 +12,8 @@ int main(int argc, char** argv) {
tl
::
engine
myEngine
(
"tcp"
,
THALLIUM_CLIENT_MODE
);
tl
::
remote_procedure
sum
=
myEngine
.
define
(
"sum"
);
tl
::
remote_procedure
prod
=
myEngine
.
define
(
"prod"
);
tl
::
remote_procedure
hello
=
myEngine
.
define
(
"hello"
).
ignor
e_response
();
tl
::
remote_procedure
print
=
myEngine
.
define
(
"print"
).
ignor
e_response
();
tl
::
remote_procedure
hello
=
myEngine
.
define
(
"hello"
).
disabl
e_response
();
tl
::
remote_procedure
print
=
myEngine
.
define
(
"print"
).
disabl
e_response
();
tl
::
endpoint
server
=
myEngine
.
lookup
(
argv
[
1
]);
uint16_t
provider_id
=
atoi
(
argv
[
2
]);
tl
::
provider_handle
ph
(
server
,
provider_id
);
...
...
examples/09_provider/server.cpp
View file @
12499ce2
...
...
@@ -33,7 +33,7 @@ class my_sum_provider : public tl::provider<my_sum_provider> {
:
tl
::
provider
<
my_sum_provider
>
(
e
,
provider_id
)
{
define
(
"prod"
,
&
my_sum_provider
::
prod
);
define
(
"sum"
,
&
my_sum_provider
::
sum
);
define
(
"hello"
,
&
my_sum_provider
::
hello
);
define
(
"hello"
,
&
my_sum_provider
::
hello
)
.
disable_response
()
;
define
(
"print"
,
&
my_sum_provider
::
print
,
tl
::
ignore_return_value
());
}
...
...
include/thallium/provider.hpp
View file @
12499ce2
...
...
@@ -90,33 +90,33 @@ public:
* @param T::*func member function
*/
template
<
typename
S
,
typename
R
,
typename
...
Args
>
void
define
(
S
&&
name
,
R
(
T
::*
func
)(
const
request
&
,
Args
...))
{
remote_procedure
define
(
S
&&
name
,
R
(
T
::*
func
)(
const
request
&
,
Args
...))
{
T
*
self
=
dynamic_cast
<
T
*>
(
this
);
std
::
function
<
void
(
const
request
&
,
Args
...)
>
fun
=
[
self
,
func
](
const
request
&
r
,
Args
...
args
)
{
(
self
->*
func
)(
r
,
args
...);
};
m_engine
.
define
(
std
::
forward
<
S
>
(
name
),
fun
,
m_provider_id
);
return
m_engine
.
define
(
std
::
forward
<
S
>
(
name
),
fun
,
m_provider_id
);
}
private:
template
<
typename
S
,
typename
R
,
typename
...
Args
>
void
define_member
(
S
&&
name
,
R
(
T
::*
func
)(
Args
...),
const
std
::
integral_constant
<
bool
,
false
>&
)
{
remote_procedure
define_member
(
S
&&
name
,
R
(
T
::*
func
)(
Args
...),
const
std
::
integral_constant
<
bool
,
false
>&
)
{
T
*
self
=
dynamic_cast
<
T
*>
(
this
);
std
::
function
<
void
(
const
request
&
,
Args
...)
>
fun
=
[
self
,
func
](
const
request
&
req
,
Args
...
args
)
{
R
r
=
(
self
->*
func
)(
args
...);
req
.
respond
(
r
);
};
m_engine
.
define
(
std
::
forward
<
S
>
(
name
),
fun
,
m_provider_id
);
return
m_engine
.
define
(
std
::
forward
<
S
>
(
name
),
fun
,
m_provider_id
);
}
template
<
typename
S
,
typename
R
,
typename
...
Args
>
void
define_member
(
S
&&
name
,
R
(
T
::*
func
)(
Args
...),
const
std
::
integral_constant
<
bool
,
true
>&
)
{
remote_procedure
define_member
(
S
&&
name
,
R
(
T
::*
func
)(
Args
...),
const
std
::
integral_constant
<
bool
,
true
>&
)
{
T
*
self
=
dynamic_cast
<
T
*>
(
this
);
std
::
function
<
void
(
const
request
&
,
Args
...)
>
fun
=
[
self
,
func
](
const
request
&
req
,
Args
...
args
)
{
(
self
->*
func
)(
args
...);
};
m_engine
.
define
(
std
::
forward
<
S
>
(
name
),
fun
,
m_provider_id
).
ignor
e_response
();
return
m_engine
.
define
(
std
::
forward
<
S
>
(
name
),
fun
,
m_provider_id
).
disabl
e_response
();
}
protected:
...
...
@@ -138,8 +138,8 @@ protected:
* @param T::*func Member function.
*/
template
<
typename
S
,
typename
R
,
typename
...
Args
,
typename
X
=
typename
std
::
is_void
<
R
>
::
type
>
inline
void
define
(
S
&&
name
,
R
(
T
::*
func
)(
Args
...),
X
x
=
X
())
{
define_member
(
std
::
forward
<
S
>
(
name
),
func
,
x
);
inline
remote_procedure
define
(
S
&&
name
,
R
(
T
::*
func
)(
Args
...),
X
x
=
X
())
{
return
define_member
(
std
::
forward
<
S
>
(
name
),
func
,
x
);
}
public:
...
...
include/thallium/remote_procedure.hpp
View file @
12499ce2
...
...
@@ -93,7 +93,12 @@ public:
*
* @return *this
*/
remote_procedure
&
ignore_response
();
remote_procedure
&
disable_response
();
[[
deprecated
(
"use disable_response() instead"
)]]
inline
remote_procedure
&
ignore_response
()
{
return
disable_response
();
}
};
...
...
src/remote_procedure.cpp
View file @
12499ce2
...
...
@@ -21,7 +21,7 @@ callable_remote_procedure remote_procedure::on(const provider_handle& ph) const
return
callable_remote_procedure
(
*
m_engine
,
m_id
,
ph
,
m_ignore_response
,
ph
.
provider_id
());
}
remote_procedure
&
remote_procedure
::
ignor
e_response
()
{
remote_procedure
&
remote_procedure
::
disabl
e_response
()
{
m_ignore_response
=
true
;
margo_registered_disable_response
(
m_engine
->
m_mid
,
m_id
,
HG_TRUE
);
return
*
this
;
...
...
test/TestBulkClient.cpp
View file @
12499ce2
...
...
@@ -11,13 +11,13 @@ namespace tl = thallium;
int
client
()
{
tl
::
engine
margo
(
"bmi+tcp"
,
MARGO_CLIENT_MODE
);
auto
remote_send
=
margo
.
define
(
"send_bulk"
).
ignor
e_response
();
auto
remote_stop
=
margo
.
define
(
"stop"
).
ignor
e_response
();
auto
remote_send
=
margo
.
define
(
"send_bulk"
).
disabl
e_response
();
auto
remote_stop
=
margo
.
define
(
"stop"
).
disabl
e_response
();
std
::
string
server_addr
=
"bmi+tcp://127.0.0.1:1234"
;
sleep
(
1
);
auto
server_endpoint
=
margo
.
lookup
(
server_addr
);
std
::
cout
<<
"Lookup done for endpoint "
<<
(
std
::
string
)
server_endpoint
<<
std
::
endl
;
std
::
cout
<<
"Lookup done for endpoint "
<<
server_endpoint
<<
std
::
endl
;
std
::
string
buf
=
"Matthieu"
;
std
::
vector
<
std
::
pair
<
void
*
,
std
::
size_t
>>
seg
(
1
);
...
...
test/TestBulkServer.cpp
View file @
12499ce2
...
...
@@ -25,7 +25,7 @@ int server() {
for
(
auto
c
:
v
)
std
::
cout
<<
c
;
std
::
cout
<<
std
::
endl
;
};
margo
.
define
(
"send_bulk"
,
f
).
ignor
e_response
();
margo
.
define
(
"send_bulk"
,
f
).
disabl
e_response
();
std
::
function
<
void
(
const
tl
::
request
&
)
>
g
=
[
&
margo
](
const
tl
::
request
&
req
)
{
...
...
test/TestHelloWorldClient.cpp
View file @
12499ce2
...
...
@@ -11,14 +11,14 @@ namespace tl = thallium;
int
client
(
const
char
*
addr
)
{
tl
::
engine
margo
(
"tcp"
,
MARGO_CLIENT_MODE
);
auto
remote_hello
=
margo
.
define
(
"hello"
).
ignor
e_response
();
auto
remote_hello
=
margo
.
define
(
"hello"
).
disabl
e_response
();
auto
remote_sum
=
margo
.
define
(
"sum"
);
auto
remote_stop
=
margo
.
define
(
"stop"
).
ignor
e_response
();
auto
remote_stop
=
margo
.
define
(
"stop"
).
disabl
e_response
();
std
::
string
server_addr
=
addr
;
sleep
(
1
);
auto
server_endpoint
=
margo
.
lookup
(
server_addr
);
std
::
cout
<<
"Lookup done for endpoint "
<<
(
std
::
string
)
server_endpoint
<<
std
::
endl
;
std
::
cout
<<
"Lookup done for endpoint "
<<
server_endpoint
<<
std
::
endl
;
remote_hello
.
on
(
server_endpoint
)(
std
::
string
(
"Matt"
));
...
...
test/TestHelloWorldServer.cpp
View file @
12499ce2
...
...
@@ -16,7 +16,7 @@ int server() {
tl
::
engine
margo
(
"tcp"
,
MARGO_SERVER_MODE
);
margo
.
define
(
"hello"
,
hello
).
ignor
e_response
();
margo
.
define
(
"hello"
,
hello
).
disabl
e_response
();
std
::
function
<
void
(
const
tl
::
request
&
,
int
,
int
)
>
f
=
[](
const
tl
::
request
&
req
,
int
x
,
int
y
)
{
...
...
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