Skip to content

Commit

Permalink
Merge pull request #98 from DARMA-tasking/fix-namespace-darma
Browse files Browse the repository at this point in the history
made shift to namespace darma, left an alias in darma.h
  • Loading branch information
David Hollman committed May 15, 2018
2 parents e3adaaf + b992e55 commit 8e44389
Show file tree
Hide file tree
Showing 281 changed files with 1,486 additions and 1,498 deletions.
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
cmake_minimum_required (VERSION 3.4)

# Silence an error about the version option to project
# this will need to be changed if we ever bump the version to 3.0 and put the
# version stuff in the project command itself
if (NOT CMAKE_VERSION VERSION_LESS 3.0)
cmake_policy(SET CMP0048 OLD)
endif()

project (DarmaFrontend)
# The version number.
set (DarmaFrontend_VERSION_MAJOR 0)
Expand Down
6 changes: 3 additions & 3 deletions docs/spec/front_end/API/darma_init_finalize.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ \subsection{\texttt{darma\_init}}

\paragraph{Syntax}\mbox{}\\
\begin{CppCode}
void darma_runtime::darma_init(int& argc, char**& argv);
void darma::darma_init(int& argc, char**& argv);
\end{CppCode}

\paragraph{Positional Arguments}\mbox{}\\
Expand Down Expand Up @@ -42,7 +42,7 @@ \subsection{\texttt{darma\_finalize}}

\paragraph{Syntax}\mbox{}\\
\begin{CppCode}
void darma_runtime::darma_finalize();
void darma::darma_finalize();
\end{CppCode}

\paragraph{Positional Arguments}\mbox{} \\
Expand All @@ -66,7 +66,7 @@ \subsection{\texttt{darma\_finalize}}
#include <darma.h>
int darma_main(int argc, char** argv)
{
using namespace darma_runtime;
using namespace darma;

darma_init(argc, argv);
std::cout << "DARMA initialized" << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions docs/spec/front_end/API/darma_spmd_rank.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ \subsection{\texttt{darma\_spmd\_rank}}

\paragraph{Syntax}\mbox{}\\
\begin{CppCode}
/* unspecified */ darma_runtime::darma_spmd_rank();
/* unspecified */ darma::darma_spmd_rank();
\end{CppCode}

\paragraph{Positional Arguments} \mbox{}\\
Expand Down Expand Up @@ -44,7 +44,7 @@ \subsection{\texttt{darma\_spmd\_rank}}
#include <darma.h>
int darma_main(int argc, char** argv)
{
using namespace darma_runtime;
using namespace darma;
darma_init(argc, argv);

// get my rank
Expand Down
4 changes: 2 additions & 2 deletions docs/spec/front_end/API/darma_spmd_size.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ \subsection{\texttt{darma\_spmd\_size}}

\paragraph{Syntax}\mbox{}\\
\begin{CppCode}
/* unspecified */ darma_runtime::darma_spmd_size();
/* unspecified */ darma::darma_spmd_size();
\end{CppCode}

\paragraph{Positional Arguments} \mbox{}\\
Expand All @@ -33,7 +33,7 @@ \subsection{\texttt{darma\_spmd\_size}}
#include <darma.h>
int darma_main(int argc, char** argv)
{
using namespace darma_runtime;
using namespace darma;
darma_init(argc, argv);

const size_t size = darma_spmd_size();
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/front_end/API/get_key.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ \subsection{\texttt{get\_key}}

\paragraph{Syntax}\mbox{}\\
\begin{CppCode}
darma_runtime::types::key_t const& AccessHandle<T>::get_key();
darma::types::key_t const& AccessHandle<T>::get_key();
\end{CppCode}

\paragraph{Positional Arguments}\mbox{}\\
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/front_end/API/initial_access.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ \subsection{\texttt{initial\_access}}

\paragraph{Syntax}\mbox{}\\
\begin{CppCode}
AccessHandle<T> darma_runtime::initial_access<T>(arg1, arg2, ...);
AccessHandle<T> darma::initial_access<T>(arg1, arg2, ...);
\end{CppCode}

\paragraph{Positional Arguments}\mbox{}\\
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/front_end/API/n_readers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ \subsection{\texttt{n\_readers}}
\codetarget{n_readers} is a \gls{keyword argument} to \codelink{publish}. %See
%\S~\ref{ssec:api_fe_publish} for details.

In namespace |darma_runtime::keyword_arguments_for_publication|.
In namespace |darma::keyword_arguments_for_publication|.

%\paragraph{Syntax}\mbox{}\\
%These two are equivalent.
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/front_end/API/read_access.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ \subsection{\texttt{read\_access}}
\paragraph{Syntax}\mbox{}\\
\begin{CppCode}
/* unspecified, convertible to AccessHandle<T> */
darma_runtime::read_access<T>(KeyParts..., version=KeyExpression);
darma::read_access<T>(KeyParts..., version=KeyExpression);
\end{CppCode}


Expand Down
2 changes: 1 addition & 1 deletion docs/spec/front_end/API/version.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ \subsection{\texttt{version}}
\codetarget{version} is a \gls{keyword argument} to \codelink{publish} and
\codelink{read_access<T>}.

In namespace |darma_runtime::keyword_arguments_for_publication|.
In namespace |darma::keyword_arguments_for_publication|.

%\paragraph{Syntax}\mbox{}\\
%These two are equivalent.
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/front_end/functors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ \subsection{Mixing Deferred and Immediate Arguments}
the referred to variable may no longer exist.
An implicit copy would be required that isn't apparent from the syntax to make the variable permanent.
To do this, you need to either use a value formal parameter or explicitly use
|darma_runtime::darma_copy|:
|darma::darma_copy|:
\begin{CppCodeNumb}
struct PrintIntRef {
void operator()(const int& val) const { cout << val << endl; }
Expand Down
8 changes: 4 additions & 4 deletions docs/spec/front_end/keyword_arguments.tex
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ \section{Keyword arguments}
%and frequently used keywords are aliased into more general namespaces.
%For instance, the keywords for \inlinecode{some_function}, above, would likely be
%defined in a namespace named using the following convention:
%\inlinecode{darma_runtime::keyword_arguments_for_some_function}.
%\inlinecode{darma::keyword_arguments_for_some_function}.
%If \inlinecode{some_function} was a
%widely used construct, its more important keywords would also be defined
%in the namespace \inlinecode{darma_runtime::keyword_arguments}.
%in the namespace \inlinecode{darma::keyword_arguments}.
%If \inlinecode{some_function} belonged to a broader category of
%constructs, certain of its keywords may also be aliased into a
%categorical namespace as well. For instance, if \inlinecode{some_function}
%implemented some memory management functionality,
%its keywords may be aliased into, for example, \inlinecode{darma_runtime::keyword_arguments_for_memory_management}.
%its keywords may be aliased into, for example, \inlinecode{darma::keyword_arguments_for_memory_management}.
%All of this is done so that the user can minimize verbosity without introducing
%naming conflicts. In certain contexts, it may be expedient for the user to simply
%put \inlinecode{using darma_runtime::keyword_arguments} at the beginning of the calling context.
%put \inlinecode{using darma::keyword_arguments} at the beginning of the calling context.
%In other, more complicated contexts, importing all DARMA keywords into the
%local context may lead to naming conflicts with local variables.
%You don't have to guess at which namespaces
Expand Down
4 changes: 2 additions & 2 deletions docs/spec/front_end/oo.tex
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ \subsection{Defining a Class}

The class templates |private_fields|, |public_fields|, and |public_methods|
(along with most of the symbols in this section) are defined in the namespace
|darma_runtime::oo|. They can be given in any order and any number of times.
|darma::oo|. They can be given in any order and any number of times.
Multiple lists (for instance, multiple |public_fields|), given to the
same |darma_class| template will be merged (though, of course, the same name
still should not be given for more than one field or method).
Expand Down Expand Up @@ -467,7 +467,7 @@ \subsection{User-defined Constructors}
struct MyClassDARMA_constructors
: darma_constructors<MyClassDARMA>
{
void operator()(darma_runtime::types::key_t& key_part) {
void operator()(darma::types::key_t& key_part) {
larry = initial_access<int>(key_part, "larry");
curly = initial_access<double>(key_part, "curly");
moe = initial_access<string>(key_part, "moe");
Expand Down
32 changes: 16 additions & 16 deletions docs/spec/front_end/serialization.tex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ \subsection{Basic Intrusive Interface}
in the user class. The |serialize| method provided for this purpose should be
non-|const| and should take a single argument, which in the simplest case will
be an lvalue reference to a
|darma_runtime::serialization::SimplePackUnpackArchive| object. For instance,
|darma::serialization::SimplePackUnpackArchive| object. For instance,
consider the following (somewhat contrived) user-defined class:
%
\begin{CppCodeNumb}
Expand All @@ -58,7 +58,7 @@ \subsection{Basic Intrusive Interface}
The simplest way to allow \gls{DARMA} to interact with |MyClass| is to provide
a |serialize| method in the class definition:
\begin{CppCodeNumb}
using Archive = darma_runtime::serialization::SimplePackUnpackArchive;
using Archive = darma::serialization::SimplePackUnpackArchive;
class MyClass {
public:
/* ... */
Expand Down Expand Up @@ -232,7 +232,7 @@ \subsection{Seperate Methods for Seperate Modes}
\subsection{Serializing Pointers and Ranges}
\gls{DARMA} also provides a convenient way to serialize iterables of serializable
objects using |darma_runtime::serialization::range|. As a simple example:
objects using |darma::serialization::range|. As a simple example:
\begin{CppCodeNumb}
template <typename T>
class MyData {
Expand All @@ -251,7 +251,7 @@ \subsection{Serializing Pointers and Ranges}
If we restrict ourselves to only making |MyData<T>| instances that hold
serializable types |T|, we can write the |serialize| method for this class as
\begin{CppCodeNumb}
using darma_runtime::serialization::range;
using darma::serialization::range;
template <typename T>
class MyData {
public:
Expand All @@ -268,10 +268,10 @@ \subsection{Non-intrusive Interface}
Classes for which the user cannot define an intrusive |serialize| method (or
any of the other intrusive methods), for one reason or another, can still be
made serializable by defining a specialization (partial or full) of the class
|darma_runtime::serialization::Serializer<T>| for the type in
|darma::serialization::Serializer<T>| for the type in
question.\footnote{Generic implementations requiring partial specialization
with an \inlinecode{enable_if} clause should use
\inlinecode{darma_runtime::serialization::detail::Serializer_enabled_if<T, Enable>}. Consult source code for more details.} Like the intrusive interface,
\inlinecode{darma::serialization::detail::Serializer_enabled_if<T, Enable>}. Consult source code for more details.} Like the intrusive interface,
these classes can define a |serialize| method; individual |compute_size|,
|pack|, and |unpack| methods; or some combination of these, with the specific
versions having higher priority. All of these methods must be |const| (the
Expand All @@ -295,7 +295,7 @@ \subsection{Non-intrusive Interface}
Assuming |YourClass| is default constructible, a way to specify a serialization
for |YourClass| non-intrusively is:
\begin{CppCodeNumb}
namespace darma_runtime { namespace serialization {
namespace darma { namespace serialization {
template <>
struct Serializer<YourClass> {
template <typename Archive>
Expand All @@ -316,13 +316,13 @@ \subsection{Non-intrusive Interface}
}
}
};
}} // end namespace darma_runtime::serialization
}} // end namespace darma::serialization
\end{CppCodeNumb}
As before, we can split this into |serialize| and |unpack| methods. However,
the |unpack| method requires a slightly different signature:
\begin{CppCodeNumb}
template <typename Archive>
darma_runtime::serialization::Serializer<YourClass>::unpack(
darma::serialization::Serializer<YourClass>::unpack(
void* allocated, Archive& ar
) const;
\end{CppCodeNumb}
Expand All @@ -336,7 +336,7 @@ \subsection{Non-intrusive Interface}
pretty straightforward. The non-intrusive |Serializer| for |YourClass| can then
be written as:
\begin{CppCodeNumb}
namespace darma_runtime { namespace serialization {
namespace darma { namespace serialization {
template <>
struct Serializer<YourClass> {
template <typename Archive>
Expand All @@ -360,18 +360,18 @@ \subsection{Non-intrusive Interface}
yc->set_label(label);
}
};
}} // end namespace darma_runtime::serialization
}} // end namespace darma::serialization
\end{CppCodeNumb}
The non-intrusive interface versions of |pack| and |compute_size| have similar
signatures to that of |serialize|, except they take a |const| lvalue reference
as their first argument:
\begin{CppCodeNumb}
template <typename Archive>
darma_runtime::serialization::Serializer<YourClass>::compute_size(
darma::serialization::Serializer<YourClass>::compute_size(
YourClass const& val, Archive& ar
) const;
template <typename Archive>
darma_runtime::serialization::Serializer<YourClass>::pack(
darma::serialization::Serializer<YourClass>::pack(
YourClass const& val, Archive& ar
) const;
\end{CppCodeNumb}
Expand Down Expand Up @@ -405,17 +405,17 @@ \subsection{Implementations for Builtin and Standard Library Types}
the code is only tested with this \gls{archive} thus far.
You can define a serialization for any bitwise copyable, \gls{POD} type simply by
specializing |darma_runtime::serialization::serialize_as_pod<T>| to inherit from
specializing |darma::serialization::serialize_as_pod<T>| to inherit from
|std::true_type|:
\begin{CppCodeNumb}
class MyPlainOldData {
int i, j, k;
double x, y, z;
};
namespace darma_runtime { namespace serialization {
namespace darma { namespace serialization {
template <>
struct serialize_as_pod<MyPlainOldData> : std::true_type { };
}} // end namespace darma_runtime::serialization
}} // end namespace darma::serialization
\end{CppCodeNumb}
\subsection{Polymorphism}
Expand Down
2 changes: 1 addition & 1 deletion docs/use_relationships_simplified.puml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ AccessHandle -right-> GenericUseHolder

class HandleUseBase {
<i>Implements most of the functionality for
darma_runtime::abstract::frontend::Use
darma::abstract::frontend::Use
..
}

Expand Down
2 changes: 1 addition & 1 deletion src/include/darma.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@

#include <darma/key/key.impl.h>

namespace darma = darma_runtime;
namespace darma_runtime = darma;

#endif /* SRC_DARMA_H_ */
4 changes: 2 additions & 2 deletions src/include/darma/impl/access_handle/access_handle.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <darma/impl/access_handle/access_handle_base.impl.h>
#include <darma/impl/access_handle/access_handle_capture_description.h>

namespace darma_runtime {
namespace darma {

//==============================================================================

Expand Down Expand Up @@ -84,7 +84,7 @@ AccessHandle<T, Traits>::AccessHandle(

//==============================================================================

} // end namespace darma_runtime
} // end namespace darma


#endif //DARMAFRONTEND_ACCESS_HANDLE_IMPL_H
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@

#include <darma/impl/access_handle_base.h>

namespace darma_runtime {
namespace darma {
namespace detail {

constexpr inline frontend::permissions_t
detail::AccessHandleBase::get_captured_permissions_for(
detail::AccessHandleBase::capture_op_t op, frontend::permissions_t permissions
) {
using darma_runtime::frontend::Permissions;
using darma::frontend::Permissions;
// This used to be a lot more complicated when Commutative/Relaxed/etc
// were permissions rather than coherence modes. I've left it here
// for backwards compatibility, but it may be moved at some point
Expand Down Expand Up @@ -123,6 +123,6 @@ detail::AccessHandleBase::get_captured_permissions_for(
//}

} // end namespace detail
} // end namespace darma_runtime
} // end namespace darma

#endif //DARMAFRONTEND_ACCESS_HANDLE_BASE_IMPL_H
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <darma/impl/create_work/capture_permissions.h>
#include <darma/interface/app/access_handle.h>

namespace darma_runtime {
namespace darma {
namespace detail {

template <typename SourceAccessHandleT, typename CapturedAccessHandleT>
Expand Down Expand Up @@ -171,6 +171,6 @@ AccessHandle<T, Traits>::get_capture_description(
};


} // end namespace darma_runtime
} // end namespace darma

#endif //DARMAFRONTEND_ACCESS_HANDLE_CAPTURE_DESCRIPTION_H

0 comments on commit 8e44389

Please sign in to comment.