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
1846e73e
Commit
1846e73e
authored
Mar 21, 2019
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrected throw from MARGO_ASSERT
parent
39d3a137
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
6 deletions
+30
-6
include/thallium/bulk.hpp
include/thallium/bulk.hpp
+1
-1
include/thallium/callable_remote_procedure.hpp
include/thallium/callable_remote_procedure.hpp
+1
-1
include/thallium/engine.hpp
include/thallium/engine.hpp
+4
-0
include/thallium/margo_exception.hpp
include/thallium/margo_exception.hpp
+22
-2
include/thallium/request.hpp
include/thallium/request.hpp
+1
-1
src/endpoint.cpp
src/endpoint.cpp
+1
-1
No files found.
include/thallium/bulk.hpp
View file @
1846e73e
...
...
@@ -203,7 +203,7 @@ public:
~
bulk
()
{
if
(
m_bulk
!=
HG_BULK_NULL
)
{
hg_return_t
ret
=
margo_bulk_free
(
m_bulk
);
MARGO_ASSERT
(
ret
,
margo_bulk_free
);
MARGO_ASSERT
_TERMINATE
(
ret
,
margo_bulk_free
,
-
1
);
}
}
...
...
include/thallium/callable_remote_procedure.hpp
View file @
1846e73e
...
...
@@ -151,7 +151,7 @@ public:
~
callable_remote_procedure
()
{
if
(
m_handle
!=
HG_HANDLE_NULL
)
{
hg_return_t
ret
=
margo_destroy
(
m_handle
);
MARGO_ASSERT
(
ret
,
margo_destroy
);
MARGO_ASSERT
_TERMINATE
(
ret
,
margo_destroy
,
-
1
);
}
}
...
...
include/thallium/engine.hpp
View file @
1846e73e
...
...
@@ -92,8 +92,11 @@ private:
static
void
rpc_handler_ult
(
hg_handle_t
handle
)
{
using
G
=
typename
std
::
remove_reference
<
F
>::
type
;
const
struct
hg_info
*
info
=
margo_get_info
(
handle
);
THALLIUM_ASSERT_CONDITION
(
info
!=
nullptr
,
"margo_get_info returned null"
);
margo_instance_id
mid
=
margo_hg_handle_get_instance
(
handle
);
THALLIUM_ASSERT_CONDITION
(
mid
!=
0
,
"margo_hg_handle_get_instance returned null"
);
void
*
data
=
margo_registered_data
(
mid
,
info
->
id
);
THALLIUM_ASSERT_CONDITION
(
data
!=
nullptr
,
"margo_registered_data returned null"
);
auto
cb_data
=
static_cast
<
rpc_callback_data
*>
(
data
);
auto
f
=
function_cast
<
G
>
(
cb_data
->
m_function
);
request
req
(
*
(
cb_data
->
m_engine
),
handle
,
disable_response
);
...
...
@@ -130,6 +133,7 @@ private:
ret
=
ABT_thread_create
(
pool
,
(
void
(
*
)(
void
*
))
rpc_handler_ult
<
F
,
disable_response
>
,
handle
,
ABT_THREAD_ATTR_NULL
,
NULL
);
if
(
ret
!=
0
)
{
margo_destroy
(
handle
);
return
HG_NOMEM_ERROR
;
}
return
HG_SUCCESS
;
...
...
include/thallium/margo_exception.hpp
View file @
1846e73e
...
...
@@ -6,6 +6,7 @@
#ifndef __THALLIUM_MARGO_EXCEPTION_HPP
#define __THALLIUM_MARGO_EXCEPTION_HPP
#include <iostream>
#include <exception>
#include <stdexcept>
#include <string>
...
...
@@ -53,16 +54,35 @@ std::string translate_margo_error_code(hg_return_t ret);
#define MARGO_THROW(__fun__,__msg__) do {\
throw margo_exception(#__fun__,__FILE__,__LINE__,__msg__); \
} while(0)
;
} while(0)
#define MARGO_ASSERT(__ret__, __fun__) do {\
if(__ret__ != HG_SUCCESS) { \
std::stringstream msg; \
msg << "Function returned "; \
msg << translate_margo_error_code(__ret__); \
MARGO_THROW(__fun__, msg.str()); \
}\
} while(0)
;
} while(0)
#define MARGO_ASSERT_TERMINATE(__ret__, __fun__, __failcode__) do {\
if(__ret__ != HG_SUCCESS) { \
std::stringstream msg; \
msg << "Function returned "; \
msg << translate_margo_error_code(__ret__); \
std::cerr << #__fun__ << ":" << __FILE__ << ":" << __LINE__ << ": " << msg.str(); \
exit(__failcode__);\
}\
} while(0)
#define THALLIUM_ASSERT_CONDITION(__cond__, __msg__) do {\
if(!(__cond__)) { \
std::stringstream msg; \
msg << "Condition " << #__cond__ << " failed (" << __FILE__ << __LINE__ \
<< ", " << __msg__; \
throw std::runtime_error(msg.str()); \
}\
} while(0)
}
#endif
include/thallium/request.hpp
View file @
1846e73e
...
...
@@ -97,7 +97,7 @@ public:
*/
~
request
()
{
hg_return_t
ret
=
margo_destroy
(
m_handle
);
MARGO_ASSERT
(
ret
,
margo_destroy
);
MARGO_ASSERT
_TERMINATE
(
ret
,
margo_destroy
,
-
1
);
}
/**
...
...
src/endpoint.cpp
View file @
1846e73e
...
...
@@ -61,7 +61,7 @@ endpoint& endpoint::operator=(endpoint&& other) {
endpoint
::~
endpoint
()
{
if
(
m_addr
!=
HG_ADDR_NULL
)
{
hg_return_t
ret
=
margo_addr_free
(
m_engine
->
m_mid
,
m_addr
);
MARGO_ASSERT
(
ret
,
margo_addr_free
);
MARGO_ASSERT
_TERMINATE
(
ret
,
margo_addr_free
,
-
1
);
}
}
...
...
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