From 250dc287929c89d6de4e79347cbb02d61e58f395 Mon Sep 17 00:00:00 2001 From: David Hollman Date: Tue, 10 Apr 2018 13:39:37 -0700 Subject: [PATCH 1/5] added darma_finalize() to interop interface --- src/include/darma/impl/concurrent_region.h | 412 ------------------ .../darma/interface/app/darma_region.h | 11 +- .../darma/interface/backend/darma_region.h | 5 +- src/include/tinympl/switch.hpp | 2 +- 4 files changed, 13 insertions(+), 417 deletions(-) delete mode 100644 src/include/darma/impl/concurrent_region.h diff --git a/src/include/darma/impl/concurrent_region.h b/src/include/darma/impl/concurrent_region.h deleted file mode 100644 index b2cf739e..00000000 --- a/src/include/darma/impl/concurrent_region.h +++ /dev/null @@ -1,412 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// concurrent_region.h -// DARMA -// Copyright (C) 2017 NTESS, LLC -// -// Under the terms of Contract DE-NA-0003525 with Sandia Corpoation, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact darma@sandia.gov -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef DARMA_IMPL_CONCURRENT_REGION_H -#define DARMA_IMPL_CONCURRENT_REGION_H - -#if 0 - -#include -#include -#include -#include -#include -#include - - -#include - -#include "task.h" - -DeclareDarmaTypeTransparentKeyword(create_concurrent_region, data_store); - -namespace darma_runtime { - -namespace detail { - -template -struct CRTaskRunnable; - -} // end namespace detail - - -template -struct ConcurrentRegionContext { - private: - - using IndexT = typename RangeT::index_t; - using IndexMappingT = typename RangeT::mapping_to_dense_t; - - std::shared_ptr - context_handle_ = nullptr; - - mutable utility::compressed_pair index_and_mapping_; - - mutable bool index_computed_ = false; - - - // TODO use a std::optional (or pre-C++17 equivalent) to store the uninitialized mapping so that - // ConcurrentRegionContext is still default constructible - // Stateful mapping ctor - explicit - ConcurrentRegionContext(IndexMappingT const& mapping) - : index_and_mapping_(IndexT(), mapping) - { } - - // Stateless mapping ctor - template ::value and - std::is_default_constructible::value - > - > - ConcurrentRegionContext() - : index_and_mapping_(IndexT(), IndexMappingT()) - { } - - - public: - - IndexT const& - index() const { - if(not index_computed_) { - assert(context_handle_); - index_and_mapping_.first() = index_and_mapping_.second().map_reverse( - context_handle_->get_backend_index() - ); - index_computed_ = true; - } - return index_and_mapping_.first(); - } - - // not really public, but for now... - size_t - get_backend_index(IndexT const& idx) const { - return index_and_mapping_.second().map_forward(idx); - } - - private: - - template - friend struct detail::CRTaskRunnable; - -}; - - -namespace serialization { - -template -struct Serializer> { - using cr_context_t = darma_runtime::ConcurrentRegionContext; - - template - std::enable_if_t::value> - serialize(cr_context_t& ctxt, ArchiveT& ar) { - assert(ctxt.context_handle_ == nullptr); // can't move it once context_handle_ is assigned - } - - template - std::enable_if_t<(not std::is_empty::value) - and detail::serializability_traits - ::template is_serializable_with_archive::value - > - serialize(cr_context_t& ctxt, ArchiveT& ar) { - assert(ctxt.context_handle_ == nullptr); // can't move it once context_handle_ is assigned - ar | ctxt.index_and_mapping_.second(); - } - -}; - - -} // end namespace serialization - - -namespace detail { - -struct CRTaskRunnableBase { - virtual void - set_context_handle( - std::shared_ptr const& ctxt - ) =0; -}; - - -template -struct CRTaskRunnable - : FunctorLikeRunnableBase< - typename meta::functor_without_first_param_adapter::type, - Args... - >, - CRTaskRunnableBase -{ - using base_t = FunctorLikeRunnableBase< - typename meta::functor_without_first_param_adapter::type, - Args... - >; - - using base_t::base_t; - - ConcurrentRegionContext context_; - - template - static types::unique_ptr_template - construct_from_archive(ArchiveT& ar) { - // don't need to worry about reconstructing context_, since it must be null - typename RangeT::mapping_to_dense_t mapping; - ar >> mapping; - auto rv = base_t::template _construct_from_archive< - ArchiveT, CRTaskRunnable - >(ar); - rv->context_.index_and_mapping_.second() = mapping; - return std::move(rv); - }; - - void pack(void* allocated) const override { - using serialization::detail::DependencyHandle_attorneys::ArchiveAccess; - serialization::SimplePackUnpackArchive ar; - - ArchiveAccess::start_packing(ar); - ArchiveAccess::set_buffer(ar, allocated); - - ar << context_.index_and_mapping_.second(); - - base_t::pack(ArchiveAccess::get_spot(ar)); - } - - size_t get_packed_size() const override { - using serialization::detail::DependencyHandle_attorneys::ArchiveAccess; - serialization::SimplePackUnpackArchive ar; - - ArchiveAccess::start_sizing(ar); - - ar % context_.index_and_mapping_.second(); - - return base_t::get_packed_size() + ArchiveAccess::get_size(ar); - } - - void - set_context_handle( - std::shared_ptr const& ctxt - ) override { - context_.context_handle_ = ctxt; - } - - template - void set_mapping(MappingConvertible&& m) { - context_.index_and_mapping_.second() = std::forward(m); - } - - - bool run() override { - meta::splat_tuple( - this->base_t::_get_args_to_splat(), - [this](auto&&... args) { - Callable()(context_, std::forward(args)...); - } - ); - return false; // ignored - } - - size_t get_index() const override { return register_runnable(); } - -}; - -struct ConcurrentRegionTaskImpl - : abstract::frontend::ConcurrentRegionTask -{ - public: - - - using base_t = abstract::frontend::ConcurrentRegionTask; - using base_t::base_t; - - void set_region_context( - std::shared_ptr const& ctxt - ) override { - assert(runnable_); - // ugly.... - auto* cr_runnable = dynamic_cast(runnable_.get()); - cr_runnable->set_context_handle(ctxt); - } - - std::unique_ptr> - deep_copy() const override { - assert(false); - return nullptr; - } - - -}; - -template -struct _make_runnable_t_wrapper { - template - using apply_t = CRTaskRunnable; - -}; - -template -void _do_register_concurrent_region( - RangeT&& range, - typename std::decay_t::mapping_to_dense_t mapping, DataStoreT&& dstore, ArgsTuple&& args_tup -) { - detail::TaskBase* parent_task = static_cast( - abstract::backend::get_backend_context()->get_running_task() - ); - std::unique_ptr task_ptr = - std::make_unique(); - - parent_task->current_create_work_context = task_ptr.get(); - - using runnable_t = tinympl::splat_to_t, - _make_runnable_t_wrapper::template apply_t - >; - - meta::splat_tuple( - std::forward(args_tup), - [&](auto&&... args){ - auto runnable = std::make_unique( - utility::variadic_constructor_tag, - std::forward(args)... - ); - runnable->set_mapping(mapping); - task_ptr->set_runnable(std::move(runnable)); - } - ); - - parent_task->current_create_work_context = nullptr; - - for (auto&& reg : task_ptr->registrations_to_run) { - reg(); - } - task_ptr->registrations_to_run.clear(); - - for (auto&& post_reg_op : task_ptr->post_registration_ops) { - post_reg_op(); - } - task_ptr->post_registration_ops.clear(); - - if(not dstore.is_default()) { - abstract::backend::get_backend_runtime()->register_concurrent_region( - std::move(task_ptr), range.size(), detail::DataStoreAttorney::get_handle(dstore) - ); - } - else { - abstract::backend::get_backend_runtime()->register_concurrent_region( - std::move(task_ptr), range.size() - ); - } - -}; - -template -using _is_index_range_archetype = typename T::is_index_range_t; -template -using is_index_range = meta::is_detected<_is_index_range_archetype, Arg>; -template -using decayed_is_index_range = is_index_range>; - -} // end namespace detail - -template -auto -create_concurrent_region(Args&&... args) { - using namespace darma_runtime::detail; - - using parser = kwarg_parser< - variadic_positional_overload_description< - _keyword, - keyword_tags_for_create_concurrent_region::index_range - >, - _optional_keyword - > - >; - - // This is on one line for readability of compiler error; don't respace it please! - using _______________see_calling_context_on_next_line________________ = typename parser::template static_assert_valid_invocation; - - parser() - .with_default_generators( - keyword_arguments_for_create_concurrent_region::data_store=[]{ - return DataStore(DataStore::default_data_store_tag); - } - ) - .parse_args(std::forward(args)...) - .invoke( - []( - auto&& index_range, DataStore dstore, - variadic_arguments_begin_tag, - auto&&... args - ) { - detail::_do_register_concurrent_region( - std::forward(index_range), - get_mapping_to_dense(index_range), // not forwarded because the - // function get_mapping_to_dense - // shouldn't take possession of - // index_range - dstore, - std::forward_as_tuple(std::forward(args)...) - ); - } - ); -}; - -namespace frontend { - -inline abstract::backend::runtime_t::concurrent_region_task_unique_ptr -unpack_concurrent_region_task(void* packed_data) { - return darma_runtime::detail::_unpack_task< - darma_runtime::detail::ConcurrentRegionTaskImpl - >(packed_data); -} - -} // end namespace frontend - -} // end namespace darma_runtime - -#endif // 0 -#endif //DARMA_IMPL_CONCURRENT_REGION_H - diff --git a/src/include/darma/interface/app/darma_region.h b/src/include/darma/interface/app/darma_region.h index 770dfdce..daec03f6 100644 --- a/src/include/darma/interface/app/darma_region.h +++ b/src/include/darma/interface/app/darma_region.h @@ -69,7 +69,7 @@ _get_default_instance_token_ptr() { return _rv; } -auto& +inline auto& get_default_instance_token() { return *_get_default_instance_token_ptr<>().get(); } @@ -129,9 +129,14 @@ darma_region(Callable&& callable) { return done_future; } -auto +inline auto darma_initialize(int& argc, char**& argv) { - backend::initialize_runtime_arguments(argc, argv); + backend::initialize_with_arguments(argc, argv); +} + +inline auto +darma_finalize() { + backend::finalize(); } } // end namespace experimental diff --git a/src/include/darma/interface/backend/darma_region.h b/src/include/darma/interface/backend/darma_region.h index d461e0c8..4224f55e 100644 --- a/src/include/darma/interface/backend/darma_region.h +++ b/src/include/darma/interface/backend/darma_region.h @@ -55,7 +55,10 @@ namespace backend { #if _darma_has_feature(darma_regions) void -initialize_runtime_arguments(int& argc, char**& argv); +initialize_with_arguments(int& argc, char**& argv); + +void +finalize(); types::runtime_instance_token_t initialize_runtime_instance(); diff --git a/src/include/tinympl/switch.hpp b/src/include/tinympl/switch.hpp index d46202c0..f4ff1e3f 100644 --- a/src/include/tinympl/switch.hpp +++ b/src/include/tinympl/switch.hpp @@ -45,7 +45,7 @@ #ifndef TINYMPL_SWITCH_HPP #define TINYMPL_SWITCH_HPP -#include "equal_to.hpp" +#include namespace tinympl { From 663897aa41754133dc5549bdb47e1220f5257321 Mon Sep 17 00:00:00 2001 From: David Hollman Date: Tue, 17 Apr 2018 11:49:46 -0700 Subject: [PATCH 2/5] quick fix for index_range keyword argument; rest of keyword argument fixes coming --- src/include/darma/impl/mpi/mpi_context.h | 5 +++-- .../app/keyword_arguments/index_range.h | 19 ++++--------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/include/darma/impl/mpi/mpi_context.h b/src/include/darma/impl/mpi/mpi_context.h index aebacfc6..5bfc7764 100644 --- a/src/include/darma/impl/mpi/mpi_context.h +++ b/src/include/darma/impl/mpi/mpi_context.h @@ -52,6 +52,8 @@ #include #include +#include + #include #include #include @@ -62,7 +64,6 @@ DeclareDarmaTypeTransparentKeyword(mpi_context, data); DeclareDarmaTypeTransparentKeyword(mpi_context, size); DeclareDarmaTypeTransparentKeyword(mpi_context, index); DeclareDarmaTypeTransparentKeyword(mpi_context, indices); -DeclareDarmaTypeTransparentKeyword(mpi_context, index_range); DeclareDarmaTypeTransparentKeyword(mpi_context, copy_callback); DeclareDarmaTypeTransparentKeyword(mpi_context, copy_back_callback); @@ -579,7 +580,7 @@ class mpi_context { using darma_runtime::keyword_tags_for_mpi_context::size; using darma_runtime::keyword_tags_for_mpi_context::index; using darma_runtime::keyword_tags_for_mpi_context::indices; - using darma_runtime::keyword_tags_for_mpi_context::index_range; + using darma_runtime::keyword_tags_for_create_concurrent_work::index_range; using darma_runtime::keyword_tags_for_mpi_context::copy_callback; using darma_runtime::keyword_tags_for_mpi_context::copy_back_callback; diff --git a/src/include/darma/interface/app/keyword_arguments/index_range.h b/src/include/darma/interface/app/keyword_arguments/index_range.h index c9af259c..07312322 100644 --- a/src/include/darma/interface/app/keyword_arguments/index_range.h +++ b/src/include/darma/interface/app/keyword_arguments/index_range.h @@ -54,21 +54,10 @@ namespace darma_runtime { AliasDarmaKeyword(create_concurrent_work, index_range); } // end namespace keyword_arguments_for_access_handle_collection -// namespace keyword_arguments { -// AliasDarmaKeyword(create_concurrent_work, index_range); -// } // end namespace keyword_arguments -// -// namespace _keyword_arguments { -// AliasDarmaKeywordAs(create_concurrent_work, index_range, _index_range); -// } // end namespace keyword_arguments -// -// namespace keyword_arguments_ { -// AliasDarmaKeywordAs(create_concurrent_work, index_range, index_range_); -// } // end namespace keyword_arguments -// -// namespace _keyword_arguments_ { -// AliasDarmaKeywordAs(create_concurrent_work, index_range, _index_range_); -// } // end namespace keyword_arguments + namespace keyword_arguments_for_mpi_context { + AliasDarmaKeyword(create_concurrent_work, index_range); + } // end namespace keyword_arguments_for_mpi_context + } // end namespace darma_runtime DeclareStandardDarmaKeywordArgumentAliases(create_concurrent_work, index_range); From 4b8c478a0fc1cf8dc5f89def0d1f030c3c490779 Mon Sep 17 00:00:00 2001 From: David Hollman Date: Tue, 17 Apr 2018 11:51:23 -0700 Subject: [PATCH 3/5] one more fix along the same lines --- src/include/darma/impl/mpi/mpi_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/darma/impl/mpi/mpi_context.h b/src/include/darma/impl/mpi/mpi_context.h index 5bfc7764..4c2c88af 100644 --- a/src/include/darma/impl/mpi/mpi_context.h +++ b/src/include/darma/impl/mpi/mpi_context.h @@ -648,7 +648,7 @@ class mpi_context { using namespace darma_runtime::detail; using darma_runtime::keyword_tags_for_mpi_context::size; - using darma_runtime::keyword_tags_for_mpi_context::index_range; + using darma_runtime::keyword_tags_for_create_concurrent_work::index_range; using parser = kwarg_parser< variadic_positional_overload_description< From 76be3dc06956d8651edde0ea0a3e463a0a34c52c Mon Sep 17 00:00:00 2001 From: David Hollman Date: Tue, 17 Apr 2018 12:08:51 -0700 Subject: [PATCH 4/5] mpi interop keyword argument cleanup --- src/include/darma/impl/mpi/mpi_context.h | 12 ++-- .../impl/mpi/piecewise_acquired_collection.h | 14 ++-- .../keyword_arguments/copy_back_callback.h | 69 +++++++++++++++++++ .../app/keyword_arguments/copy_callback.h | 69 +++++++++++++++++++ .../interface/app/keyword_arguments/data.h | 69 +++++++++++++++++++ .../interface/app/keyword_arguments/index.h | 69 +++++++++++++++++++ .../interface/app/keyword_arguments/indices.h | 69 +++++++++++++++++++ .../interface/app/keyword_arguments/size.h | 69 +++++++++++++++++++ 8 files changed, 427 insertions(+), 13 deletions(-) create mode 100644 src/include/darma/interface/app/keyword_arguments/copy_back_callback.h create mode 100644 src/include/darma/interface/app/keyword_arguments/copy_callback.h create mode 100644 src/include/darma/interface/app/keyword_arguments/data.h create mode 100644 src/include/darma/interface/app/keyword_arguments/index.h create mode 100644 src/include/darma/interface/app/keyword_arguments/indices.h create mode 100644 src/include/darma/interface/app/keyword_arguments/size.h diff --git a/src/include/darma/impl/mpi/mpi_context.h b/src/include/darma/impl/mpi/mpi_context.h index 4c2c88af..ede8db7b 100644 --- a/src/include/darma/impl/mpi/mpi_context.h +++ b/src/include/darma/impl/mpi/mpi_context.h @@ -52,7 +52,13 @@ #include #include +#include +#include +#include +#include #include +#include +#include #include #include @@ -60,12 +66,6 @@ #include #include -DeclareDarmaTypeTransparentKeyword(mpi_context, data); -DeclareDarmaTypeTransparentKeyword(mpi_context, size); -DeclareDarmaTypeTransparentKeyword(mpi_context, index); -DeclareDarmaTypeTransparentKeyword(mpi_context, indices); -DeclareDarmaTypeTransparentKeyword(mpi_context, copy_callback); -DeclareDarmaTypeTransparentKeyword(mpi_context, copy_back_callback); namespace darma_runtime { diff --git a/src/include/darma/impl/mpi/piecewise_acquired_collection.h b/src/include/darma/impl/mpi/piecewise_acquired_collection.h index 7bbed225..995db206 100644 --- a/src/include/darma/impl/mpi/piecewise_acquired_collection.h +++ b/src/include/darma/impl/mpi/piecewise_acquired_collection.h @@ -49,15 +49,15 @@ #if _darma_has_feature(mpi_interop) +#include +#include +#include + #include #include #include #include -DeclareDarmaTypeTransparentKeyword(piecewise_handle, index); -DeclareDarmaTypeTransparentKeyword(piecewise_handle, copy_callback); -DeclareDarmaTypeTransparentKeyword(piecewise_handle, copy_back_callback); - namespace darma_runtime { namespace detail { @@ -191,9 +191,9 @@ class PiecewiseCollectionHandle { acquire_access(Args&&... args) const { using namespace darma_runtime::detail; - using darma_runtime::keyword_tags_for_piecewise_handle::index; - using darma_runtime::keyword_tags_for_piecewise_handle::copy_callback; - using darma_runtime::keyword_tags_for_piecewise_handle::copy_back_callback; + using darma_runtime::keyword_tags_for_mpi_context::index; + using darma_runtime::keyword_tags_for_mpi_context::copy_callback; + using darma_runtime::keyword_tags_for_mpi_context::copy_back_callback; using parser = kwarg_parser< variadic_positional_overload_description< diff --git a/src/include/darma/interface/app/keyword_arguments/copy_back_callback.h b/src/include/darma/interface/app/keyword_arguments/copy_back_callback.h new file mode 100644 index 00000000..e47ad7f8 --- /dev/null +++ b/src/include/darma/interface/app/keyword_arguments/copy_back_callback.h @@ -0,0 +1,69 @@ +/* +//@HEADER +// ************************************************************************ +// +// copy_back_callback.h +// DARMA +// Copyright (C) 2017 NTESS, LLC +// +// Under the terms of Contract DE-NA-0003525 with NTESS, LLC, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact darma@sandia.gov +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_COPY_BACK_CALLBACK_H +#define DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_COPY_BACK_CALLBACK_H + +#include + +DeclareDarmaTypeTransparentKeyword(mpi_context, copy_back_callback); + +namespace darma_runtime { + namespace keyword_arguments_for_acquire_access { + AliasDarmaKeyword(mpi_context, copy_back_callback); + } // end namespace keyword_arguments_for_acquire_access + + namespace keyword_arguments_for_piecewise_acquired_collection { + AliasDarmaKeyword(mpi_context, copy_back_callback); + } // end namespace keyword_arguments_for_piecewise_acquired_collection + + namespace keyword_arguments_for_piecewise_handle { + AliasDarmaKeyword(mpi_context, copy_back_callback); + } // end namespace keyword_arguments_for_piecewise_handle +} // end namespace darma_runtime + +DeclareStandardDarmaKeywordArgumentAliases(mpi_context, copy_back_callback); + + +#endif //DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_COPY_CALLBACK_H diff --git a/src/include/darma/interface/app/keyword_arguments/copy_callback.h b/src/include/darma/interface/app/keyword_arguments/copy_callback.h new file mode 100644 index 00000000..ad7abf35 --- /dev/null +++ b/src/include/darma/interface/app/keyword_arguments/copy_callback.h @@ -0,0 +1,69 @@ +/* +//@HEADER +// ************************************************************************ +// +// copy_callback.h +// DARMA +// Copyright (C) 2017 NTESS, LLC +// +// Under the terms of Contract DE-NA-0003525 with NTESS, LLC, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact darma@sandia.gov +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_COPY_CALLBACK_H +#define DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_COPY_CALLBACK_H + +#include + +DeclareDarmaTypeTransparentKeyword(mpi_context, copy_callback); + +namespace darma_runtime { + namespace keyword_arguments_for_acquire_access { + AliasDarmaKeyword(mpi_context, copy_callback); + } // end namespace keyword_arguments_for_acquire_access + + namespace keyword_arguments_for_piecewise_acquired_collection { + AliasDarmaKeyword(mpi_context, copy_callback); + } // end namespace keyword_arguments_for_piecewise_acquired_collection + + namespace keyword_arguments_for_piecewise_handle { + AliasDarmaKeyword(mpi_context, copy_callback); + } // end namespace keyword_arguments_for_piecewise_handle +} // end namespace darma_runtime + +DeclareStandardDarmaKeywordArgumentAliases(mpi_context, copy_callback); + + +#endif //DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_COPY_CALLBACK_H diff --git a/src/include/darma/interface/app/keyword_arguments/data.h b/src/include/darma/interface/app/keyword_arguments/data.h new file mode 100644 index 00000000..c0047ea8 --- /dev/null +++ b/src/include/darma/interface/app/keyword_arguments/data.h @@ -0,0 +1,69 @@ +/* +//@HEADER +// ************************************************************************ +// +// data.h +// DARMA +// Copyright (C) 2017 NTESS, LLC +// +// Under the terms of Contract DE-NA-0003525 with NTESS, LLC, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact darma@sandia.gov +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_DATA_H +#define DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_DATA_H + +#include + +DeclareDarmaTypeTransparentKeyword(mpi_context, data); + +namespace darma_runtime { + namespace keyword_arguments_for_acquire_access { + AliasDarmaKeyword(mpi_context, data); + } // end namespace keyword_arguments_for_acquire_access + + namespace keyword_arguments_for_piecewise_acquired_collection { + AliasDarmaKeyword(mpi_context, data); + } // end namespace keyword_arguments_for_piecewise_acquired_collection + + namespace keyword_arguments_for_piecewise_handle { + AliasDarmaKeyword(mpi_context, data); + } // end namespace keyword_arguments_for_piecewise_handle +} // end namespace darma_runtime + +DeclareStandardDarmaKeywordArgumentAliases(mpi_context, data); + + +#endif //DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_DATA_H diff --git a/src/include/darma/interface/app/keyword_arguments/index.h b/src/include/darma/interface/app/keyword_arguments/index.h new file mode 100644 index 00000000..32372b01 --- /dev/null +++ b/src/include/darma/interface/app/keyword_arguments/index.h @@ -0,0 +1,69 @@ +/* +//@HEADER +// ************************************************************************ +// +// index.h +// DARMA +// Copyright (C) 2017 NTESS, LLC +// +// Under the terms of Contract DE-NA-0003525 with NTESS, LLC, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact darma@sandia.gov +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_INDEX_H +#define DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_INDEX_H + +#include + +DeclareDarmaTypeTransparentKeyword(mpi_context, index); + +namespace darma_runtime { + namespace keyword_arguments_for_acquire_access { + AliasDarmaKeyword(mpi_context, index); + } // end namespace keyword_arguments_for_acquire_access + + namespace keyword_arguments_for_piecewise_acquired_collection { + AliasDarmaKeyword(mpi_context, index); + } // end namespace keyword_arguments_for_piecewise_acquired_collection + + namespace keyword_arguments_for_piecewise_handle { + AliasDarmaKeyword(mpi_context, index); + } // end namespace keyword_arguments_for_piecewise_handle +} // end namespace darma_runtime + +DeclareStandardDarmaKeywordArgumentAliases(mpi_context, index); + + +#endif //DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_INDEX_H diff --git a/src/include/darma/interface/app/keyword_arguments/indices.h b/src/include/darma/interface/app/keyword_arguments/indices.h new file mode 100644 index 00000000..1c7df657 --- /dev/null +++ b/src/include/darma/interface/app/keyword_arguments/indices.h @@ -0,0 +1,69 @@ +/* +//@HEADER +// ************************************************************************ +// +// indices.h +// DARMA +// Copyright (C) 2017 NTESS, LLC +// +// Under the terms of Contract DE-NA-0003525 with NTESS, LLC, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact darma@sandia.gov +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_INDICES_H +#define DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_INDICES_H + +#include + +DeclareDarmaTypeTransparentKeyword(mpi_context, indices); + +namespace darma_runtime { + namespace keyword_arguments_for_acquire_access { + AliasDarmaKeyword(mpi_context, indices); + } // end namespace keyword_arguments_for_acquire_access + + namespace keyword_arguments_for_piecewise_acquired_collection { + AliasDarmaKeyword(mpi_context, indices); + } // end namespace keyword_arguments_for_piecewise_acquired_collection + + namespace keyword_arguments_for_piecewise_handle { + AliasDarmaKeyword(mpi_context, indices); + } // end namespace keyword_arguments_for_piecewise_handle +} // end namespace darma_runtime + +DeclareStandardDarmaKeywordArgumentAliases(mpi_context, indices); + + +#endif //DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_INDICES_H diff --git a/src/include/darma/interface/app/keyword_arguments/size.h b/src/include/darma/interface/app/keyword_arguments/size.h new file mode 100644 index 00000000..2a857dd6 --- /dev/null +++ b/src/include/darma/interface/app/keyword_arguments/size.h @@ -0,0 +1,69 @@ +/* +//@HEADER +// ************************************************************************ +// +// size.h +// DARMA +// Copyright (C) 2017 NTESS, LLC +// +// Under the terms of Contract DE-NA-0003525 with NTESS, LLC, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact darma@sandia.gov +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_SIZE_H +#define DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_SIZE_H + +#include + +DeclareDarmaTypeTransparentKeyword(mpi_context, size); + +namespace darma_runtime { + namespace keyword_arguments_for_acquire_access { + AliasDarmaKeyword(mpi_context, size); + } // end namespace keyword_arguments_for_acquire_access + + namespace keyword_arguments_for_piecewise_acquired_collection { + AliasDarmaKeyword(mpi_context, size); + } // end namespace keyword_arguments_for_piecewise_acquired_collection + + namespace keyword_arguments_for_piecewise_handle { + AliasDarmaKeyword(mpi_context, size); + } // end namespace keyword_arguments_for_piecewise_handle +} // end namespace darma_runtime + +DeclareStandardDarmaKeywordArgumentAliases(mpi_context, size); + + +#endif //DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_SIZE_H From 43bf6ce7b013affd6c367a6a5654b50db201cfdb Mon Sep 17 00:00:00 2001 From: David Hollman Date: Tue, 17 Apr 2018 12:12:53 -0700 Subject: [PATCH 5/5] updated all_keyword_arguments.h to reflect recent changes --- .../interface/app/keyword_arguments/all_keyword_arguments.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/include/darma/interface/app/keyword_arguments/all_keyword_arguments.h b/src/include/darma/interface/app/keyword_arguments/all_keyword_arguments.h index 98aefa73..9c001645 100644 --- a/src/include/darma/interface/app/keyword_arguments/all_keyword_arguments.h +++ b/src/include/darma/interface/app/keyword_arguments/all_keyword_arguments.h @@ -50,5 +50,11 @@ #include #include #include +#include +#include +#include +#include +#include +#include #endif //DARMA_INTERFACE_APP_KEYWORD_ARGUMENTS_ALL_KEYWORD_ARGUMENTS_H