Commit f1f532cf authored by Matthieu Dorier's avatar Matthieu Dorier

started integrating serialization

parent f71d04a2
...@@ -3,8 +3,11 @@ ...@@ -3,8 +3,11 @@
#include <tuple> #include <tuple>
#include <cstdint> #include <cstdint>
#include <utility>
#include <margo.h> #include <margo.h>
#include <thallium/buffer.hpp> #include <thallium/buffer.hpp>
#include <thallium/serialization/stl/vector.hpp>
#include <thallium/serialization/buffer_output_archive.hpp>
namespace thallium { namespace thallium {
...@@ -22,6 +25,15 @@ private: ...@@ -22,6 +25,15 @@ private:
callable_remote_procedure(hg_id_t id, const endpoint& ep, bool ignore_resp); callable_remote_procedure(hg_id_t id, const endpoint& ep, bool ignore_resp);
auto forward(const buffer& buf) const {
margo_forward(m_handle, const_cast<void*>(static_cast<const void*>(&buf)));
buffer output;
if(m_ignore_response) return output;
margo_get_output(m_handle, &output);
margo_free_output(m_handle, &output); // won't do anything on a buffer type
return output;
}
public: public:
callable_remote_procedure(const callable_remote_procedure& other) { callable_remote_procedure(const callable_remote_procedure& other) {
...@@ -69,30 +81,11 @@ public: ...@@ -69,30 +81,11 @@ public:
} }
template<typename ... T> template<typename ... T>
auto operator()(const T& ... t) const { auto operator()(T&& ... t) const {
// TODO throw an exception if handle is null buffer b;
// buffer input; buffer_output_archive arch(b);
// BufferOutputArchive arch(input); serialize_many(arch, std::forward<T>(t)...);
// serialize_many(arch, std::forward<T>(t)...); return forward(b);
// serialize(std::forward<T>(t)
// auto input = std::tie(t...);
margo_forward(m_handle, nullptr);
// Buffer output;
//margo_get_output(m_handle, &output);
return true;//Pack(std::move(output));
}
auto operator()(const buffer& buf) const {
margo_forward(m_handle, const_cast<void*>(static_cast<const void*>(&buf)));
buffer output;
if(m_ignore_response) return output;
margo_get_output(m_handle, &output);
margo_free_output(m_handle, &output); // won't do anything on a buffer type
return output;
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment