Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
compose
legacystack
cpp_tools
Commits
1b9ad710
Commit
1b9ad710
authored
May 05, 2021
by
ESTERIE Pierre
Browse files
update tools modules
parent
59c07d20
Changes
16
Hide whitespace changes
Inline
Side-by-side
cl
-
parser/include/cpp
-
tools/cl
-
parser/exceptions.hpp
→
cl
_
parser/include/cpp
_
tools/cl
_
parser/exceptions.hpp
View file @
1b9ad710
...
...
@@ -3,7 +3,7 @@
#include <stdexcept>
namespace
cpptools
::
cl_parser
namespace
cpp
_
tools
::
cl_parser
{
struct
parameter_conflict
:
std
::
logic_error
{
...
...
cl
-
parser/include/cpp
-
tools/cl
-
parser/help_descriptor.hpp
→
cl
_
parser/include/cpp
_
tools/cl
_
parser/help_descriptor.hpp
View file @
1b9ad710
...
...
@@ -3,9 +3,9 @@
#include <iostream>
#include "tcli.hpp"
#include "
cpp_tools/cl_parser/
tcli.hpp"
namespace
cpptools
::
cl_parser
namespace
cpp
_
tools
::
cl_parser
{
namespace
meta
{
...
...
cl
-
parser/include/cpp
-
tools/cl
-
parser/impl_tcli/meta.hpp
→
cl
_
parser/include/cpp
_
tools/cl
_
parser/impl_tcli/meta.hpp
View file @
1b9ad710
...
...
@@ -6,7 +6,7 @@
#include <type_traits>
#include <vector>
namespace
cpptools
::
cl_parser
::
meta
namespace
cpp
_
tools
::
cl_parser
::
meta
{
/**
* \brief Useful type alias for metaprogramming
...
...
cl
-
parser/include/cpp
-
tools/cl
-
parser/impl_tcli/parameter_model.hpp
→
cl
_
parser/include/cpp
_
tools/cl
_
parser/impl_tcli/parameter_model.hpp
View file @
1b9ad710
...
...
@@ -4,7 +4,7 @@
#include <string>
#include <vector>
namespace
cpptools
::
cl_parser
namespace
cpp
_
tools
::
cl_parser
{
/**
* \brief Parameter descriptor model
...
...
cl
-
parser/include/cpp
-
tools/cl
-
parser/impl_tcli/utils.hpp
→
cl
_
parser/include/cpp
_
tools/cl
_
parser/impl_tcli/utils.hpp
View file @
1b9ad710
...
...
@@ -4,7 +4,7 @@
#include <tuple>
#include <utility>
namespace
cpptools
::
cl_parser
::
utils
namespace
cpp
_
tools
::
cl_parser
::
utils
{
/**
* \brief Collective operation result
...
...
cl
-
parser/include/cpp
-
tools/cl
-
parser/tcli.hpp
→
cl
_
parser/include/cpp
_
tools/cl
_
parser/tcli.hpp
View file @
1b9ad710
...
...
@@ -12,13 +12,13 @@
#include <unordered_set>
#include <vector>
#include "impl_tcli/utils.hpp"
#include "impl_tcli/meta.hpp"
#include "exceptions.hpp"
#include "
cpp_tools/cl_parser/
impl_tcli/utils.hpp"
#include "
cpp_tools/cl_parser/
impl_tcli/meta.hpp"
#include "
cpp_tools/cl_parser/
exceptions.hpp"
namespace
cpptools
::
cl_parser
{
namespace
cpp
_
tools
::
cl_parser
{
namespace
detail
{
// this is only require to handle vector of parameters.
template
<
typename
ValueType
>
...
...
@@ -878,7 +878,7 @@ auto build_parser(detail::build_now, Params&&... params)
/** implementation: Explode a parameter group into the parameters it contains */
template
<
class
Group
,
class
...
Params
,
std
::
size_t
...
Is
>
auto
explode_group
(
inria
::
index_sequence
<
Is
...
>
,
Group
&&
g
,
Params
&&
...
ps
)
auto
explode_group
(
std
::
index_sequence
<
Is
...
>
,
Group
&&
g
,
Params
&&
...
ps
)
->
decltype
(
build_parser
(
std
::
get
<
Is
>
(
std
::
forward
<
Group
>
(
g
))...,
std
::
forward
<
Params
>
(
ps
)...))
{
return
build_parser
(
std
::
get
<
Is
>
(
std
::
forward
<
Group
>
(
g
))...,
std
::
forward
<
Params
>
(
ps
)...);
...
...
@@ -887,9 +887,9 @@ auto explode_group(inria::index_sequence<Is...>, Group&& g, Params&&... ps)
/** Explode a parameter group into the parameters it contains */
template
<
class
...
Ts
,
class
...
Params
>
auto
explode_group
(
const
std
::
tuple
<
Ts
...
>&
g
,
Params
&&
...
ps
)
->
decltype
(
explode_group
(
inria
::
index_sequence_for
<
Ts
...
>
{},
g
,
std
::
forward
<
Params
>
(
ps
)...))
->
decltype
(
explode_group
(
std
::
index_sequence_for
<
Ts
...
>
{},
g
,
std
::
forward
<
Params
>
(
ps
)...))
{
return
explode_group
(
inria
::
index_sequence_for
<
Ts
...
>
{},
g
,
std
::
forward
<
Params
>
(
ps
)...);
return
explode_group
(
std
::
index_sequence_for
<
Ts
...
>
{},
g
,
std
::
forward
<
Params
>
(
ps
)...);
}
/** When a constrained group appears, split it up and add its constraint to the resulting parser */
...
...
cmake/cl
-
parser.cmake
→
cmake/cl
_
parser.cmake
View file @
1b9ad710
set
(
MODULE_NAME cl
-
parser
)
set
(
MODULE_NAME cl
_
parser
)
add_library
(
${
MODULE_NAME
}
INTERFACE
)
add_library
(
cpp
-
tools::
${
MODULE_NAME
}
ALIAS
${
MODULE_NAME
}
)
add_library
(
cpp
_
tools::
${
MODULE_NAME
}
ALIAS
${
MODULE_NAME
}
)
target_compile_features
(
${
MODULE_NAME
}
INTERFACE cxx_std_17
)
list
(
APPEND CPP_TOOLS_TARGETS
${
MODULE_NAME
}
)
...
...
cmake/colors.cmake
View file @
1b9ad710
...
...
@@ -3,7 +3,7 @@ set(MODULE_NAME colors)
add_library
(
${
MODULE_NAME
}
INTERFACE
)
add_library
(
cpp
-
tools::
${
MODULE_NAME
}
ALIAS
${
MODULE_NAME
}
)
add_library
(
cpp
_
tools::
${
MODULE_NAME
}
ALIAS
${
MODULE_NAME
}
)
target_compile_features
(
${
MODULE_NAME
}
INTERFACE cxx_std_17
)
list
(
APPEND CPP_TOOLS_TARGETS
${
MODULE_NAME
}
)
...
...
cmake/init-cpptools.cmake
View file @
1b9ad710
# File for initializing cpp-tools as a submodule
if
(
CPP_TOOLS_USE_CL_PARSER
)
include
(
cmake/cl
-
parser
)
include
(
cmake/cl
_
parser
)
endif
()
if
(
CPP_TOOLS_USE_COLORS
)
include
(
cmake/colors
)
...
...
@@ -10,5 +10,5 @@ if(CPP_TOOLS_USE_TIMERS)
include
(
cmake/timers
)
endif
()
if
(
CPP_TOOLS_USE_PARALLEL_MANAGER
)
include
(
cmake/parallel
-
manager
)
include
(
cmake/parallel
_
manager
)
endif
()
cmake/parallel
-
manager.cmake
→
cmake/parallel
_
manager.cmake
View file @
1b9ad710
set
(
MODULE_NAME parallel
-
manager
)
set
(
MODULE_NAME parallel
_
manager
)
add_library
(
${
MODULE_NAME
}
INTERFACE
)
add_library
(
cpp
-
tools::
${
MODULE_NAME
}
ALIAS
${
MODULE_NAME
}
)
add_library
(
cpp
_
tools::
${
MODULE_NAME
}
ALIAS
${
MODULE_NAME
}
)
target_compile_features
(
${
MODULE_NAME
}
INTERFACE cxx_std_17
)
list
(
APPEND CPP_TOOLS_TARGETS
${
MODULE_NAME
}
)
...
...
cmake/timers.cmake
View file @
1b9ad710
...
...
@@ -3,7 +3,7 @@ set(MODULE_NAME timers)
add_library
(
${
MODULE_NAME
}
INTERFACE
)
add_library
(
cpp
-
tools::
${
MODULE_NAME
}
ALIAS
${
MODULE_NAME
}
)
add_library
(
cpp
_
tools::
${
MODULE_NAME
}
ALIAS
${
MODULE_NAME
}
)
target_compile_features
(
${
MODULE_NAME
}
INTERFACE cxx_std_17
)
list
(
APPEND CPP_TOOLS_TARGETS
${
MODULE_NAME
}
)
...
...
colors/include/cpp
-
tools/colors/colorized.hpp
→
colors/include/cpp
_
tools/colors/colorized.hpp
View file @
1b9ad710
...
...
@@ -13,7 +13,7 @@
#include <ostream>
#include <string>
namespace
cpptools
::
colors
namespace
cpp
_
tools
::
colors
{
inline
constexpr
auto
get_color
(
const
int
R
,
const
int
G
,
const
int
B
)
->
int
{
...
...
parallel
-
manager/include/cpp
-
tools/parallel
-
manager/mpi.hpp
→
parallel
_
manager/include/cpp
_
tools/parallel
_
manager/mpi.hpp
View file @
1b9ad710
...
...
@@ -2,7 +2,8 @@
#define CPP_TOOLS_PARALLEL_MANAGER_MPI_HPP
#include "mpi.h"
#include "scalfmm/utils/parallel_manager.hpp"
#include "cpp_tools/parallel_manager/parallel_manager.hpp"
#include "cpp_tools/parallel_manager/utils.hpp"
#include <algorithm>
#include <memory>
...
...
@@ -19,7 +20,7 @@
*
*/
namespace
cpptools
::
parallel_manager
namespace
cpp
_
tools
::
parallel_manager
{
namespace
mpi
{
...
...
@@ -49,18 +50,18 @@ namespace cpptools::parallel_manager
public:
explicit
environment_setup
(
int
&
argc
,
char
**&
argv
)
{
already_initialized
=
::
cpptools
::
parallel_manager
::
mpi
::
initialized
();
already_initialized
=
::
cpp
_
tools
::
parallel_manager
::
mpi
::
initialized
();
if
(
!
already_initialized
)
{
::
cpptools
::
parallel_manager
::
mpi
::
init
(
argc
,
argv
);
::
cpp
_
tools
::
parallel_manager
::
mpi
::
init
(
argc
,
argv
);
}
}
explicit
environment_setup
()
{
already_initialized
=
::
cpptools
::
parallel_manager
::
mpi
::
initialized
();
already_initialized
=
::
cpp
_
tools
::
parallel_manager
::
mpi
::
initialized
();
if
(
!
already_initialized
)
{
::
cpptools
::
parallel_manager
::
mpi
::
init
();
::
cpp
_
tools
::
parallel_manager
::
mpi
::
init
();
}
}
environment_setup
(
const
environment_setup
&
)
=
delete
;
...
...
@@ -71,7 +72,7 @@ namespace cpptools::parallel_manager
{
if
(
!
already_initialized
)
{
::
cpptools
::
parallel_manager
::
mpi
::
finalize
();
::
cpp
_
tools
::
parallel_manager
::
mpi
::
finalize
();
}
}
};
...
...
@@ -176,7 +177,7 @@ namespace cpptools::parallel_manager
template
<
class
Range
>
static
void
waitall
(
Range
&&
r
)
{
using
cpptools
::
parallel_manager
::
utils
::
size
;
using
cpp
_
tools
::
parallel_manager
::
utils
::
size
;
using
std
::
begin
;
using
std
::
end
;
MPI_Request
*
reqs
=
new
MPI_Request
[
size
(
r
)];
...
...
@@ -544,7 +545,7 @@ namespace cpptools::parallel_manager
/**
* \brief MPI configuration for distributed algorithms
*
* \warning Defined outside the cpptools::parallel_managermpi namespace to allow ADL to find the
* \warning Defined outside the cpp
_
tools::parallel_managermpi namespace to allow ADL to find the
* algorithms using tag dispatching
*
*/
...
...
@@ -579,6 +580,6 @@ namespace cpptools::parallel_manager
mpi_config
&
operator
=
(
mpi_config
&&
)
=
default
;
};
}
// namespace cpptools::parallel_manager
}
// namespace cpp
_
tools::parallel_manager
#endif
/* _MPI_HPP_ */
parallel
-
manager/include/cpp
-
tools/parallel
-
manager/parallel_manager.hpp
→
parallel
_
manager/include/cpp
_
tools/parallel
_
manager/parallel_manager.hpp
View file @
1b9ad710
...
...
@@ -4,14 +4,14 @@
#include <iostream>
#ifdef CPP_TOOLS_PARALLEL_MANAGER_USE_MPI
#include "cpp
-
tools/parallel_manager/mpi.hpp"
#include "cpp
_
tools/parallel_manager/mpi.hpp"
#include <mpi.h>
#endif
#ifdef CPP_TOOLS_PARALLEL_MANAGER_USE_OMP
#include <omp.h>
#endif
namespace
cpptools
::
parallel_manager
namespace
cpp
_
tools
::
parallel_manager
{
class
parallel_manager
{
...
...
@@ -20,7 +20,7 @@ namespace cpptools::parallel_manager
int
m_process_id
{};
///< The id of the process
int
m_number_threads
{};
///< number of threads
#ifdef CPP_TOOLS_PARALLEL_MANAGER_USE_MPI
inria
::
mpi
::
communicator
m_communicator
;
cpp_tools
::
parallel_manager
::
mpi
::
communicator
m_communicator
;
#else
struct
empty
{
...
...
@@ -29,7 +29,7 @@ namespace cpptools::parallel_manager
public:
#ifdef CPP_TOOLS_PARALLEL_MANAGER_USE_MPI
using
comm_type
=
inria
::
mpi
::
communicator
;
using
comm_type
=
cpp_tools
::
parallel_manager
::
mpi
::
communicator
;
#else
using
comm_type
=
empty
;
#endif
...
...
@@ -90,7 +90,7 @@ namespace cpptools::parallel_manager
#ifdef CPP_TOOLS_PARALLEL_MANAGER_USE_MPI
int
provided
,
err
,
size
;
err
=
MPI_Init_thread
(
nullptr
,
nullptr
,
MPI_THREAD_SERIALIZED
,
&
provided
);
this
->
init
(
inria
::
mpi
::
communicator
::
world
());
this
->
init
(
cpp_tools
::
parallel_manager
::
mpi
::
communicator
::
world
());
#endif
}
#ifdef CPP_TOOLS_PARALLEL_MANAGER_USE_MPI
...
...
@@ -111,7 +111,7 @@ namespace cpptools::parallel_manager
MPI_Finalize
();
std
::
exit
(
EXIT_FAILURE
);
}
m_communicator
=
inria
::
mpi
::
communicator
(
in_communicator
,
duplicated
);
m_communicator
=
cpp_tools
::
parallel_manager
::
mpi
::
communicator
(
in_communicator
,
duplicated
);
m_number_processes
=
m_communicator
.
size
();
m_process_id
=
m_communicator
.
rank
();
}
...
...
@@ -124,7 +124,7 @@ namespace cpptools::parallel_manager
///
/// \param in_communicator MPI communicator object
///
void
init
(
inria
::
mpi
::
communicator
&
in_communicator
)
void
init
(
cpp_tools
::
parallel_manager
::
mpi
::
communicator
&
in_communicator
)
{
int
provided
;
int
error
=
MPI_Query_thread
(
&
provided
);
...
...
parallel
-
manager/include/cpp
-
tools/parallel
-
manager/utils.hpp
→
parallel
_
manager/include/cpp
_
tools/parallel
_
manager/utils.hpp
View file @
1b9ad710
...
...
@@ -10,7 +10,7 @@
#include <memory>
namespace
cpptools
::
parallel_manager
::
utils
namespace
cpp
_
tools
::
parallel_manager
::
utils
{
/**
* \brief Contruct a dynamic array owned by a std::unique_ptr
...
...
timers/include/cpp
-
tools/timers/simple
-
timer.hpp
→
timers/include/cpp
_
tools/timers/simple
_
timer.hpp
View file @
1b9ad710
...
...
@@ -2,12 +2,12 @@
// See LICENCE file at project root
// File : utils/tic.hpp
// --------------------------------
#ifndef
SCALFMM_UTILS
_TIMER_HPP
#define
SCALFMM_UTILS
_TIMER_HPP
#ifndef
CPP_TOOLS_TIMER
_TIMER_HPP
#define
CPP_TOOLS_TIMER
_TIMER_HPP
#include <chrono>
namespace
scalfmm
::
u
ti
l
s
namespace
cpp_tools
::
ti
mer
s
{
template
<
class
Duration
=
std
::
chrono
::
milliseconds
>
class
timer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment