diff --git a/src/vt/vrt/collection/param/construct_po.h b/src/vt/vrt/collection/param/construct_po.h index 0df5eaa583..02a4b09262 100644 --- a/src/vt/vrt/collection/param/construct_po.h +++ b/src/vt/vrt/collection/param/construct_po.h @@ -94,9 +94,37 @@ struct ConstructParams { public: ConstructParams() = default; - ConstructParams(ConstructParams const&) = default; ConstructParams(ConstructParams&&) = default; + ConstructParams(ConstructParams const& x) + : bounds_(x.bounds_), + has_bounds_(x.has_bounds_), + bulk_inserts_(x.bulk_inserts_), + bulk_insert_bounds_(x.bulk_insert_bounds_), + cons_fn_(x.cons_fn_), + dynamic_membership_(x.dynamic_membership_), + collective_(x.collective_), + constructed_(x.constructed_), + migratable_(x.migratable_), + map_han_(x.map_han_), + proxy_bits_(x.proxy_bits_), + map_object_(x.map_object_) + { + vtAssert( + not collective_, + "Should only call copy ctor during rooted construction" + ); + if (x.list_inserts_.size() > 0 or + x.list_insert_here_.size() > 0) { + vtAbort( + "listInsert/listInsertHere can not be used with rooted construction" + ); + } + if (x.cons_fn_) { + vtAbort("elementConstructor can not be used with rooted construction"); + } + } + friend CollectionManager; ~ConstructParams() { @@ -190,6 +218,8 @@ struct ConstructParams { /** * \brief Specify a non-default constructor for each element * + * \note Only valid with collective construction + * * \param[in] in_cons_fn the construction function */ ThisType&& elementConstructor(ConstructFnType in_cons_fn) { @@ -351,6 +381,9 @@ struct ConstructParams { | map_han_ | proxy_bits_ | map_object_; + s.skip(list_inserts_); + s.skip(list_insert_here_); + s.skip(cons_fn_); } private: diff --git a/src/vt/vrt/collection/param/construct_po_msg.h b/src/vt/vrt/collection/param/construct_po_msg.h index 4644b5e337..edfe53c3ed 100644 --- a/src/vt/vrt/collection/param/construct_po_msg.h +++ b/src/vt/vrt/collection/param/construct_po_msg.h @@ -59,7 +59,7 @@ struct ConstructParamMsg : vt::Message { vt_msg_serialize_required(); // po ConstructParamMsg() = default; - explicit ConstructParamMsg(param::ConstructParams in_po) + explicit ConstructParamMsg(param::ConstructParams& in_po) : po(in_po) { }