Commit 1b9ad710 authored by ESTERIE Pierre's avatar ESTERIE Pierre
Browse files

update tools modules

parent 59c07d20
......@@ -3,7 +3,7 @@
#include <stdexcept>
namespace cpptools::cl_parser
namespace cpp_tools::cl_parser
{
struct parameter_conflict : std::logic_error
{
......
......@@ -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
{
......
......@@ -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
......
......@@ -4,7 +4,7 @@
#include <string>
#include <vector>
namespace cpptools::cl_parser
namespace cpp_tools::cl_parser
{
/**
* \brief Parameter descriptor model
......
......@@ -4,7 +4,7 @@
#include <tuple>
#include <utility>
namespace cpptools::cl_parser::utils
namespace cpp_tools::cl_parser::utils
{
/**
* \brief Collective operation result
......
......@@ -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 */
......
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})
......
......@@ -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})
......
# 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()
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})
......
......@@ -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})
......
......@@ -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
{
......
......@@ -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_ */
......@@ -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);
......
......@@ -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
......
......@@ -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::utils
namespace cpp_tools::timers
{
template<class Duration = std::chrono::milliseconds>
class timer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment