Skip to content
Snippets Groups Projects
Commit b96cba77 authored by Alberto Miranda's avatar Alberto Miranda :hotsprings:
Browse files

Merge branch '147-prepare-0-3-0-release' into 'main'

Resolve "Prepare 0.3.0 release"

Closes #147

See merge request !108
parents d9197476 94b6801b
No related branches found
Tags v0.3.4
1 merge request!108Resolve "Prepare 0.3.0 release"
Pipeline #3902 passed
# Compilation of scord and execution of tests
image: bscstorage/scord:0.2.0-wip
image: bscstorage/scord:0.3.0
stages:
- build
......
......@@ -30,7 +30,7 @@ cmake_minimum_required(VERSION 3.19)
project(
scord
VERSION 0.2.2
VERSION 0.3.0
LANGUAGES C CXX
)
......
.PHONY: all
all:
docker build -t bscstorage/scord:0.2.0-wip-debug .
diff --git a/include/thallium/packed_data.hpp b/include/thallium/packed_data.hpp
index 9e6e76e..37e64d3 100644
--- a/include/thallium/packed_data.hpp
+++ b/include/thallium/packed_data.hpp
@@ -14,13 +14,13 @@
namespace thallium {
-template<typename ... CtxArg> class callable_remote_procedure_with_context;
+template <typename... CtxArg> class callable_remote_procedure_with_context;
class async_response;
-template<typename ... CtxArg> class request_with_context;
+template <typename... CtxArg> class request_with_context;
using request = request_with_context<>;
namespace detail {
- struct engine_impl;
+struct engine_impl;
}
/**
@@ -36,9 +36,9 @@ class packed_data {
private:
std::weak_ptr<detail::engine_impl> m_engine_impl;
- hg_handle_t m_handle = HG_HANDLE_NULL;
- hg_return_t (*m_unpack_fn)(hg_handle_t,void*) = nullptr;
- hg_return_t (*m_free_fn)(hg_handle_t,void*) = nullptr;
+ hg_handle_t m_handle = HG_HANDLE_NULL;
+ hg_return_t (*m_unpack_fn)(hg_handle_t, void*) = nullptr;
+ hg_return_t (*m_free_fn)(hg_handle_t, void*) = nullptr;
mutable std::tuple<CtxArg...> m_context;
/**
@@ -62,6 +62,41 @@ class packed_data {
MARGO_ASSERT(ret, margo_ref_incr);
}
+ packed_data(const packed_data&) = delete;
+ packed_data& operator=(const packed_data&) = delete;
+
+ packed_data(packed_data&& rhs)
+ : m_engine_impl(std::move(rhs.m_engine_impl),
+ m_context(std::move(rhs.m_context))) {
+ m_handle = rhs.m_handle;
+ rhs.m_handle = HG_HANDLE_NULL;
+ m_unpack_fn = rhs.m_unpack_fn;
+ rhs.m_unpack_fn = nullptr;
+ m_free_fn = rhs.m_free_fn;
+ rhs.m_free_fn = nullptr;
+ }
+
+ packed_data& operator=(packed_data&& rhs) {
+
+ if(&rhs == this) {
+ return *this;
+ }
+
+ // the original members m_handle, m_context, and m_handle are being
+ // replaced here by the ones from rhs. It may be necessary to release
+ // their resources if `packed_data` has claimed ownership over them,
+ // otherwise we would be leaking
+ m_engine_impl = std::move(rhs.m_engine_impl);
+ m_context = std::move(rhs.m_context);
+
+ m_handle = rhs.m_handle;
+ rhs.m_handle = HG_HANDLE_NULL;
+ m_unpack_fn = rhs.m_unpack_fn;
+ rhs.m_unpack_fn = nullptr;
+ m_free_fn = rhs.m_free_fn;
+ rhs.m_free_fn = nullptr;
+ }
+
packed_data() = default;
public:
@@ -78,7 +113,7 @@ class packed_data {
* @tparam NewCtxArg Types of the serialization context.
* @param args Context.
*/
- template<typename ... NewCtxArg>
+ template <typename... NewCtxArg>
auto with_serialization_context(NewCtxArg&&... args) {
return packed_data<unwrap_decay_t<NewCtxArg>...>(
m_unpack_fn, m_free_fn, m_handle, m_engine_impl,
.PHONY: all
all:
docker build -t bscstorage/scord:0.2.0-wip .
diff --git a/include/thallium/packed_data.hpp b/include/thallium/packed_data.hpp
index 9e6e76e..37e64d3 100644
--- a/include/thallium/packed_data.hpp
+++ b/include/thallium/packed_data.hpp
@@ -14,13 +14,13 @@
namespace thallium {
-template<typename ... CtxArg> class callable_remote_procedure_with_context;
+template <typename... CtxArg> class callable_remote_procedure_with_context;
class async_response;
-template<typename ... CtxArg> class request_with_context;
+template <typename... CtxArg> class request_with_context;
using request = request_with_context<>;
namespace detail {
- struct engine_impl;
+struct engine_impl;
}
/**
@@ -36,9 +36,9 @@ class packed_data {
private:
std::weak_ptr<detail::engine_impl> m_engine_impl;
- hg_handle_t m_handle = HG_HANDLE_NULL;
- hg_return_t (*m_unpack_fn)(hg_handle_t,void*) = nullptr;
- hg_return_t (*m_free_fn)(hg_handle_t,void*) = nullptr;
+ hg_handle_t m_handle = HG_HANDLE_NULL;
+ hg_return_t (*m_unpack_fn)(hg_handle_t, void*) = nullptr;
+ hg_return_t (*m_free_fn)(hg_handle_t, void*) = nullptr;
mutable std::tuple<CtxArg...> m_context;
/**
@@ -62,6 +62,41 @@ class packed_data {
MARGO_ASSERT(ret, margo_ref_incr);
}
+ packed_data(const packed_data&) = delete;
+ packed_data& operator=(const packed_data&) = delete;
+
+ packed_data(packed_data&& rhs)
+ : m_engine_impl(std::move(rhs.m_engine_impl),
+ m_context(std::move(rhs.m_context))) {
+ m_handle = rhs.m_handle;
+ rhs.m_handle = HG_HANDLE_NULL;
+ m_unpack_fn = rhs.m_unpack_fn;
+ rhs.m_unpack_fn = nullptr;
+ m_free_fn = rhs.m_free_fn;
+ rhs.m_free_fn = nullptr;
+ }
+
+ packed_data& operator=(packed_data&& rhs) {
+
+ if(&rhs == this) {
+ return *this;
+ }
+
+ // the original members m_handle, m_context, and m_handle are being
+ // replaced here by the ones from rhs. It may be necessary to release
+ // their resources if `packed_data` has claimed ownership over them,
+ // otherwise we would be leaking
+ m_engine_impl = std::move(rhs.m_engine_impl);
+ m_context = std::move(rhs.m_context);
+
+ m_handle = rhs.m_handle;
+ rhs.m_handle = HG_HANDLE_NULL;
+ m_unpack_fn = rhs.m_unpack_fn;
+ rhs.m_unpack_fn = nullptr;
+ m_free_fn = rhs.m_free_fn;
+ rhs.m_free_fn = nullptr;
+ }
+
packed_data() = default;
public:
@@ -78,7 +113,7 @@ class packed_data {
* @tparam NewCtxArg Types of the serialization context.
* @param args Context.
*/
- template<typename ... NewCtxArg>
+ template <typename... NewCtxArg>
auto with_serialization_context(NewCtxArg&&... args) {
return packed_data<unwrap_decay_t<NewCtxArg>...>(
m_unpack_fn, m_free_fn, m_handle, m_engine_impl,
File moved
.PHONY: all
all:
docker build -t bscstorage/scord:0.3.0 .
FROM debian:testing-slim
FROM debian:bullseye-slim
LABEL Description="Debian-based environment suitable to build scord"
......@@ -15,9 +15,8 @@ RUN apt-get update && \
automake \
gcc \
g++ \
g++-11 \
vim \
gdb \
clang \
libc++-dev \
procps \
# AGIOS dependencies
libconfig-dev \
......@@ -35,6 +34,8 @@ RUN apt-get update && \
python3-venv \
# redis-plus-plus dependencies \
libhiredis-dev \
# Slurm plugin dependencies \
libslurm-dev \
# tests dependencies \
python3-pip && \
### install cmake 3.23.1 ###################################################
......@@ -77,7 +78,7 @@ RUN apt-get update && \
cd deps/argobots && \
./autogen.sh && \
mkdir build && cd build && \
CFLAGS="-ggdb3 -O0" ../configure --prefix=${DEPS_INSTALL_PATH} && \
../configure --prefix=${DEPS_INSTALL_PATH} && \
make install -j && \
cd .. && rm -rf build && cd && \
cd deps/libfabric && \
......@@ -85,7 +86,7 @@ RUN apt-get update && \
### libfabric
./autogen.sh && \
mkdir build && cd build && \
CFLAGS="-ggdb3 -O0" ../configure --prefix=${DEPS_INSTALL_PATH} && \
../configure --prefix=${DEPS_INSTALL_PATH} && \
make install -j && \
cd .. && rm -rf build && cd && \
\
......@@ -99,7 +100,7 @@ RUN apt-get update && \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DNA_USE_OFI:BOOL=ON \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_BUILD_TYPE:STRING=Release \
.. && \
make install -j && \
cd .. && rm -rf build && cd && \
......@@ -116,7 +117,7 @@ RUN apt-get update && \
cd deps/mochi-margo && \
./prepare.sh && \
mkdir build && cd build && \
CFLAGS="-ggdb3 -O0" ../configure --prefix=${DEPS_INSTALL_PATH} && \
../configure --prefix=${DEPS_INSTALL_PATH} && \
make -j install && \
cd .. && rm -rf build && cd && \
\
......@@ -124,7 +125,7 @@ RUN apt-get update && \
cd deps/redis-plus-plus && \
mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PATH} \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_BUILD_TYPE:STRING=Release \
.. && \
make install -j && \
cd .. && rm -rf build && cd && \
......@@ -133,7 +134,7 @@ RUN apt-get update && \
cd deps/agios && \
mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PATH} \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_BUILD_TYPE:STRING=Release \
.. && \
make install -j && \
cd .. && rm -rf build && cd && \
......@@ -141,7 +142,7 @@ RUN apt-get update && \
### cereal
cd deps/cereal && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE:STRING=Debug \
cmake -DCMAKE_BUILD_TYPE:STRING=Release \
-DBUILD_DOC:BOOL=OFF \
-DBUILD_SANDBOX:BOOL=OFF \
-DBUILD_TESTS:BOOL=OFF \
......@@ -155,7 +156,7 @@ RUN apt-get update && \
cd deps/mochi-thallium && \
mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PATH} \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_BUILD_TYPE:STRING=Release \
.. && \
make -j install && \
cd .. && rm -rf build && cd && \
......
.PHONY: all
all:
docker build -t bscstorage/scord:0.4.0-wip .
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment