Loading examples/cxx/ADM_register_adhoc_storage.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -45,8 +45,6 @@ main(int argc, char* argv[]) { const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS); const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); //const auto server_id = admire::adhoc_storage::impl::generate_id(); auto p = std::make_unique<admire::adhoc_storage>( admire::storage::type::gekkofs, "foobar", admire::adhoc_storage::execution_mode::separate_new, Loading @@ -55,13 +53,15 @@ main(int argc, char* argv[]) { admire::job_requirements reqs(inputs, outputs, std::move(p)); std::string id; //ADM_storage_t adhoc_storage{}; const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, 42, 100, false}; const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, 42, 100, false}; ADM_return_t ret = ADM_SUCCESS; try { [[maybe_unused]] const auto job = admire::register_job(server, reqs); const auto adhoc_storage = admire::register_adhoc_storage(server, job, id, adhoc_storage_ctx); const auto adhoc_storage = admire::register_adhoc_storage( server, job, id, adhoc_storage_ctx); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_register_adhoc_storage() failed: {}\n", e.what()); Loading examples/cxx/ADM_update_job.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -48,8 +48,6 @@ main(int argc, char* argv[]) { admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, 42, 100, false); //const auto adhoc_storage = admire::register_adhoc_storage(server, job, "foobar", adhoc_storage_ctx); admire::job_requirements reqs{inputs, outputs, std::move(p)}; Loading src/common/api/admire_types.hpp +7 −12 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ struct storage { virtual ~ctx() = default; }; storage(storage::type type, std::string id);//std::uint64_t server_id); storage(storage::type type, std::string id); virtual ~storage() = default; Loading @@ -252,7 +252,6 @@ struct storage { protected: std::string m_id; enum type m_type; //std::uint64_t m_server_id; }; struct adhoc_storage : public storage { Loading Loading @@ -305,10 +304,6 @@ struct adhoc_storage : public storage { adhoc_storage(const adhoc_storage& other) noexcept; adhoc_storage(enum storage::type type, std::string id, const admire::adhoc_storage::ctx& ctx); //adhoc_storage(enum storage::type type, std::string id, std::uint64_t server_id, //ADM_adhoc_context_t ctx); /*adhoc_storage(enum storage::type type, std::string id, std::uint64_t server_id, const admire::adhoc_storage::ctx& ctx);*/ adhoc_storage(adhoc_storage&&) noexcept = default; adhoc_storage& Loading Loading @@ -344,9 +339,9 @@ struct pfs_storage : public storage { std::filesystem::path m_mount_point; }; pfs_storage(enum storage::type type, std::string id, //std::uint64_t server_id, pfs_storage(enum storage::type type, std::string id, std::filesystem::path mount_point); pfs_storage(enum storage::type type, std::string id, ADM_pfs_context_t ctx); //std::uint64_t server_id, ADM_pfs_context_t ctx); pfs_storage(enum storage::type type, std::string id, ADM_pfs_context_t ctx); pfs_storage(const pfs_storage& other) noexcept; pfs_storage(pfs_storage&&) noexcept = default; pfs_storage& Loading src/common/api/types.cpp +22 −30 Original line number Diff line number Diff line Loading @@ -1060,8 +1060,7 @@ dataset::id() const { storage::storage(enum storage::type type, std::string id) //std::uint64_t server_id) : m_id(std::move(id)), m_type(type) {}//, m_server_id(server_id) {} : m_id(std::move(id)), m_type(type) {} std::string storage::id() const { Loading Loading @@ -1122,7 +1121,7 @@ class adhoc_storage::impl { } public: explicit impl(adhoc_storage::ctx ctx) //, std::uint64_t counter) explicit impl(adhoc_storage::ctx ctx) : m_id(generate_id()), m_ctx(std::move(ctx)) {} impl(const impl& rhs) = default; impl(impl&& rhs) = default; Loading @@ -1147,34 +1146,25 @@ private: }; adhoc_storage::adhoc_storage(enum storage::type type, std::string id, //std::uint64_t server_id, execution_mode exec_mode, access_type access_type, std::uint32_t nodes, std::uint32_t walltime, bool should_flush) : storage(type, std::move(id)),//, server_id), adhoc_storage::adhoc_storage(enum storage::type type, std::string id, execution_mode exec_mode, access_type access_type, std::uint32_t nodes, std::uint32_t walltime, bool should_flush) : storage(type, std::move(id)), m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{ exec_mode, access_type, nodes, walltime, should_flush})) {} adhoc_storage::adhoc_storage(enum storage::type type, std::string id, //std::uint64_t server_id, adhoc_storage::adhoc_storage(enum storage::type type, std::string id, ADM_adhoc_context_t ctx) : storage(type, std::move(id)), //, server_id), : storage(type, std::move(id)), m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{ctx})) {} /* adhoc_storage::adhoc_storage(enum storage::type type, std::string id, std::uint64_t server_id, const adhoc_storage::ctx& ctx) : storage(type, std::move(id), server_id), m_pimpl(std::make_unique<impl>(ctx)) {}*/ adhoc_storage::adhoc_storage(enum storage::type type, std::string id, //std::uint64_t server_id, const adhoc_storage::ctx& ctx) : storage(type, std::move(id)),//, server_id), m_pimpl(std::make_unique<impl>(ctx)) {} // este es el nuevo añadido : storage(type, std::move(id)), m_pimpl(std::make_unique<impl>(ctx)) {} adhoc_storage::adhoc_storage(const adhoc_storage& other) noexcept : storage(other.m_type, other.m_id), //other.m_server_id), : storage(other.m_type, other.m_id), m_pimpl(std::make_unique<impl>(*other.m_pimpl)) {} adhoc_storage& Loading Loading @@ -1236,13 +1226,15 @@ private: pfs_storage::ctx m_ctx; }; pfs_storage::pfs_storage(enum storage::type type, std::string id, //std::uint64_t server_id, pfs_storage::pfs_storage(enum storage::type type, std::string id, // std::uint64_t server_id, std::filesystem::path mount_point) : storage(type, std::move(id)), // server_id), m_pimpl(std::make_unique<impl>( pfs_storage::ctx{std::move(mount_point)})) {} pfs_storage::pfs_storage(enum storage::type type, std::string id, //std::uint64_t server_id, pfs_storage::pfs_storage(enum storage::type type, std::string id, // std::uint64_t server_id, ADM_pfs_context_t ctx) : storage(type, std::move(id)), // server_id), m_pimpl(std::make_unique<impl>(pfs_storage::ctx{ctx})) {} Loading src/common/net/proto/rpc_types.h +12 −3 Original line number Diff line number Diff line Loading @@ -297,9 +297,18 @@ MERCURY_GEN_PROC( ); /// ADM_register_adhoc_storage MERCURY_GEN_PROC(ADM_register_adhoc_storage_in_t, ((ADM_job_t) (job))((hg_const_string_t) (id))((ADM_adhoc_context_t)(ctx))); MERCURY_GEN_PROC( ADM_register_adhoc_storage_in_t, ((ADM_job_t) (job)) ((hg_const_string_t) (id)) ((ADM_adhoc_context_t)(ctx)) ); MERCURY_GEN_PROC(ADM_register_adhoc_storage_out_t, ((int32_t) (retval)) ((uint64_t)(server_id))); MERCURY_GEN_PROC( ADM_register_adhoc_storage_out_t, ((int32_t) (retval)) ((uint64_t)(server_id)) ); /// ADM_update_adhoc_storage MERCURY_GEN_PROC(ADM_update_adhoc_storage_in_t, ((int32_t) (reqs))) Loading Loading
examples/cxx/ADM_register_adhoc_storage.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -45,8 +45,6 @@ main(int argc, char* argv[]) { const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS); const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); //const auto server_id = admire::adhoc_storage::impl::generate_id(); auto p = std::make_unique<admire::adhoc_storage>( admire::storage::type::gekkofs, "foobar", admire::adhoc_storage::execution_mode::separate_new, Loading @@ -55,13 +53,15 @@ main(int argc, char* argv[]) { admire::job_requirements reqs(inputs, outputs, std::move(p)); std::string id; //ADM_storage_t adhoc_storage{}; const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, 42, 100, false}; const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, 42, 100, false}; ADM_return_t ret = ADM_SUCCESS; try { [[maybe_unused]] const auto job = admire::register_job(server, reqs); const auto adhoc_storage = admire::register_adhoc_storage(server, job, id, adhoc_storage_ctx); const auto adhoc_storage = admire::register_adhoc_storage( server, job, id, adhoc_storage_ctx); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_register_adhoc_storage() failed: {}\n", e.what()); Loading
examples/cxx/ADM_update_job.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -48,8 +48,6 @@ main(int argc, char* argv[]) { admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, 42, 100, false); //const auto adhoc_storage = admire::register_adhoc_storage(server, job, "foobar", adhoc_storage_ctx); admire::job_requirements reqs{inputs, outputs, std::move(p)}; Loading
src/common/api/admire_types.hpp +7 −12 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ struct storage { virtual ~ctx() = default; }; storage(storage::type type, std::string id);//std::uint64_t server_id); storage(storage::type type, std::string id); virtual ~storage() = default; Loading @@ -252,7 +252,6 @@ struct storage { protected: std::string m_id; enum type m_type; //std::uint64_t m_server_id; }; struct adhoc_storage : public storage { Loading Loading @@ -305,10 +304,6 @@ struct adhoc_storage : public storage { adhoc_storage(const adhoc_storage& other) noexcept; adhoc_storage(enum storage::type type, std::string id, const admire::adhoc_storage::ctx& ctx); //adhoc_storage(enum storage::type type, std::string id, std::uint64_t server_id, //ADM_adhoc_context_t ctx); /*adhoc_storage(enum storage::type type, std::string id, std::uint64_t server_id, const admire::adhoc_storage::ctx& ctx);*/ adhoc_storage(adhoc_storage&&) noexcept = default; adhoc_storage& Loading Loading @@ -344,9 +339,9 @@ struct pfs_storage : public storage { std::filesystem::path m_mount_point; }; pfs_storage(enum storage::type type, std::string id, //std::uint64_t server_id, pfs_storage(enum storage::type type, std::string id, std::filesystem::path mount_point); pfs_storage(enum storage::type type, std::string id, ADM_pfs_context_t ctx); //std::uint64_t server_id, ADM_pfs_context_t ctx); pfs_storage(enum storage::type type, std::string id, ADM_pfs_context_t ctx); pfs_storage(const pfs_storage& other) noexcept; pfs_storage(pfs_storage&&) noexcept = default; pfs_storage& Loading
src/common/api/types.cpp +22 −30 Original line number Diff line number Diff line Loading @@ -1060,8 +1060,7 @@ dataset::id() const { storage::storage(enum storage::type type, std::string id) //std::uint64_t server_id) : m_id(std::move(id)), m_type(type) {}//, m_server_id(server_id) {} : m_id(std::move(id)), m_type(type) {} std::string storage::id() const { Loading Loading @@ -1122,7 +1121,7 @@ class adhoc_storage::impl { } public: explicit impl(adhoc_storage::ctx ctx) //, std::uint64_t counter) explicit impl(adhoc_storage::ctx ctx) : m_id(generate_id()), m_ctx(std::move(ctx)) {} impl(const impl& rhs) = default; impl(impl&& rhs) = default; Loading @@ -1147,34 +1146,25 @@ private: }; adhoc_storage::adhoc_storage(enum storage::type type, std::string id, //std::uint64_t server_id, execution_mode exec_mode, access_type access_type, std::uint32_t nodes, std::uint32_t walltime, bool should_flush) : storage(type, std::move(id)),//, server_id), adhoc_storage::adhoc_storage(enum storage::type type, std::string id, execution_mode exec_mode, access_type access_type, std::uint32_t nodes, std::uint32_t walltime, bool should_flush) : storage(type, std::move(id)), m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{ exec_mode, access_type, nodes, walltime, should_flush})) {} adhoc_storage::adhoc_storage(enum storage::type type, std::string id, //std::uint64_t server_id, adhoc_storage::adhoc_storage(enum storage::type type, std::string id, ADM_adhoc_context_t ctx) : storage(type, std::move(id)), //, server_id), : storage(type, std::move(id)), m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{ctx})) {} /* adhoc_storage::adhoc_storage(enum storage::type type, std::string id, std::uint64_t server_id, const adhoc_storage::ctx& ctx) : storage(type, std::move(id), server_id), m_pimpl(std::make_unique<impl>(ctx)) {}*/ adhoc_storage::adhoc_storage(enum storage::type type, std::string id, //std::uint64_t server_id, const adhoc_storage::ctx& ctx) : storage(type, std::move(id)),//, server_id), m_pimpl(std::make_unique<impl>(ctx)) {} // este es el nuevo añadido : storage(type, std::move(id)), m_pimpl(std::make_unique<impl>(ctx)) {} adhoc_storage::adhoc_storage(const adhoc_storage& other) noexcept : storage(other.m_type, other.m_id), //other.m_server_id), : storage(other.m_type, other.m_id), m_pimpl(std::make_unique<impl>(*other.m_pimpl)) {} adhoc_storage& Loading Loading @@ -1236,13 +1226,15 @@ private: pfs_storage::ctx m_ctx; }; pfs_storage::pfs_storage(enum storage::type type, std::string id, //std::uint64_t server_id, pfs_storage::pfs_storage(enum storage::type type, std::string id, // std::uint64_t server_id, std::filesystem::path mount_point) : storage(type, std::move(id)), // server_id), m_pimpl(std::make_unique<impl>( pfs_storage::ctx{std::move(mount_point)})) {} pfs_storage::pfs_storage(enum storage::type type, std::string id, //std::uint64_t server_id, pfs_storage::pfs_storage(enum storage::type type, std::string id, // std::uint64_t server_id, ADM_pfs_context_t ctx) : storage(type, std::move(id)), // server_id), m_pimpl(std::make_unique<impl>(pfs_storage::ctx{ctx})) {} Loading
src/common/net/proto/rpc_types.h +12 −3 Original line number Diff line number Diff line Loading @@ -297,9 +297,18 @@ MERCURY_GEN_PROC( ); /// ADM_register_adhoc_storage MERCURY_GEN_PROC(ADM_register_adhoc_storage_in_t, ((ADM_job_t) (job))((hg_const_string_t) (id))((ADM_adhoc_context_t)(ctx))); MERCURY_GEN_PROC( ADM_register_adhoc_storage_in_t, ((ADM_job_t) (job)) ((hg_const_string_t) (id)) ((ADM_adhoc_context_t)(ctx)) ); MERCURY_GEN_PROC(ADM_register_adhoc_storage_out_t, ((int32_t) (retval)) ((uint64_t)(server_id))); MERCURY_GEN_PROC( ADM_register_adhoc_storage_out_t, ((int32_t) (retval)) ((uint64_t)(server_id)) ); /// ADM_update_adhoc_storage MERCURY_GEN_PROC(ADM_update_adhoc_storage_in_t, ((int32_t) (reqs))) Loading