Commit c5b702ab authored by Martin Reinecke's avatar Martin Reinecke

namespace mr -> ducc0

parent f149f19c
......@@ -66,8 +66,8 @@ Candidates for testing the validity of the Healpix routines:
//#include "powspec.h"
using namespace std;
using namespace mr;
using namespace mr::healpix;
using namespace ducc0;
using namespace ducc0::healpix;
#define UNITTESTS
......
......@@ -38,11 +38,11 @@
#include "ducc0/math/constants.h"
using namespace std;
using namespace mr;
using namespace ducc0;
static void threading_status(void)
{
cout << "Threading: " << mr::get_default_nthreads() << " threads active." << endl;
cout << "Threading: " << ducc0::get_default_nthreads() << " threads active." << endl;
}
static void MPI_status(void)
......@@ -124,7 +124,7 @@ static double allreduceSumDouble (double val)
static double totalMem()
{
return mr::getProcessInfo("VmHWM")*1024;
return ducc0::getProcessInfo("VmHWM")*1024;
}
static size_t get_nalms(const sharp_alm_info &ainfo)
......@@ -549,7 +549,7 @@ int main(int argc, const char **argv)
{
string tmp2(tmp);
if (trim(tmp2)!="")
mr::set_default_nthreads(stringToData<size_t>(tmp));
ducc0::set_default_nthreads(stringToData<size_t>(tmp));
}
mytask=0; ntasks=1;
......
......@@ -3,7 +3,7 @@
#include "ducc0/infra/error_handling.h"
using namespace std;
using namespace mr;
using namespace ducc0;
namespace {
......
......@@ -17,7 +17,7 @@
#include "ducc0/infra/mav.h"
#include "ducc0/infra/error_handling.h"
namespace mr {
namespace ducc0 {
namespace detail_alm {
......
......@@ -20,7 +20,7 @@
#include "python/healpix.cc"
#include "python/misc.cc"
using namespace mr;
using namespace ducc0;
PYBIND11_MODULE(PKGNAME, m)
{
......
......@@ -19,16 +19,16 @@
#include "ducc0/math/fft.h"
#include "ducc0/bindings/pybind_utils.h"
namespace mr {
namespace ducc0 {
namespace detail_pymodule_fft {
namespace {
using shape_t = mr::fmav_info::shape_t;
using mr::fmav;
using mr::to_fmav;
using mr::get_optional_Pyarr;
using shape_t = ducc0::fmav_info::shape_t;
using ducc0::fmav;
using ducc0::to_fmav;
using ducc0::get_optional_Pyarr;
using std::size_t;
using std::ptrdiff_t;
......@@ -106,7 +106,7 @@ template<typename T> py::array c2c_internal(const py::array &in,
{
py::gil_scoped_release release;
T fct = norm_fct<T>(inorm, ain.shape(), axes);
mr::c2c(ain, aout, axes, forward, fct, nthreads);
ducc0::c2c(ain, aout, axes, forward, fct, nthreads);
}
return move(out);
}
......@@ -122,9 +122,9 @@ template<typename T> py::array c2c_sym_internal(const py::array &in,
{
py::gil_scoped_release release;
T fct = norm_fct<T>(inorm, ain.shape(), axes);
mr::r2c(ain, aout, axes, forward, fct, nthreads);
ducc0::r2c(ain, aout, axes, forward, fct, nthreads);
// now fill in second half
using namespace mr::detail_fft;
using namespace ducc0::detail_fft;
rev_iter iter(aout, axes);
while(iter.remaining()>0)
{
......@@ -160,7 +160,7 @@ template<typename T> py::array r2c_internal(const py::array &in,
{
py::gil_scoped_release release;
T fct = norm_fct<T>(inorm, ain.shape(), axes);
mr::r2c(ain, aout, axes, forward, fct, nthreads);
ducc0::r2c(ain, aout, axes, forward, fct, nthreads);
}
return move(out);
}
......@@ -183,7 +183,7 @@ template<typename T> py::array r2r_fftpack_internal(const py::array &in,
{
py::gil_scoped_release release;
T fct = norm_fct<T>(inorm, ain.shape(), axes);
mr::r2r_fftpack(ain, aout, axes, real2hermitian, forward, fct, nthreads);
ducc0::r2r_fftpack(ain, aout, axes, real2hermitian, forward, fct, nthreads);
}
return std::move(out);
}
......@@ -209,7 +209,7 @@ template<typename T> py::array dct_internal(const py::array &in,
T fct = (type==1) ? norm_fct<T>(inorm, ain.shape(), axes, 2, -1)
: norm_fct<T>(inorm, ain.shape(), axes, 2);
bool ortho = inorm == true;
mr::dct(ain, aout, axes, type, fct, ortho, nthreads);
ducc0::dct(ain, aout, axes, type, fct, ortho, nthreads);
}
return std::move(out);
}
......@@ -235,7 +235,7 @@ template<typename T> py::array dst_internal(const py::array &in,
T fct = (type==1) ? norm_fct<T>(inorm, ain.shape(), axes, 2, 1)
: norm_fct<T>(inorm, ain.shape(), axes, 2);
bool ortho = inorm == true;
mr::dst(ain, aout, axes, type, fct, ortho, nthreads);
ducc0::dst(ain, aout, axes, type, fct, ortho, nthreads);
}
return std::move(out);
}
......@@ -265,7 +265,7 @@ template<typename T> py::array c2r_internal(const py::array &in,
{
py::gil_scoped_release release;
T fct = norm_fct<T>(inorm, aout.shape(), axes);
mr::c2r(ain, aout, axes, forward, fct, nthreads);
ducc0::c2r(ain, aout, axes, forward, fct, nthreads);
}
return std::move(out);
}
......@@ -287,7 +287,7 @@ template<typename T> py::array separable_hartley_internal(const py::array &in,
{
py::gil_scoped_release release;
T fct = norm_fct<T>(inorm, ain.shape(), axes);
mr::r2r_separable_hartley(ain, aout, axes, fct, nthreads);
ducc0::r2r_separable_hartley(ain, aout, axes, fct, nthreads);
}
return std::move(out);
}
......@@ -309,7 +309,7 @@ template<typename T> py::array genuine_hartley_internal(const py::array &in,
{
py::gil_scoped_release release;
T fct = norm_fct<T>(inorm, ain.shape(), axes);
mr::r2r_genuine_hartley(ain, aout, axes, fct, nthreads);
ducc0::r2r_genuine_hartley(ain, aout, axes, fct, nthreads);
}
return std::move(out);
}
......@@ -341,7 +341,7 @@ PyObject * good_size(PyObject * /*self*/, PyObject * args)
return nullptr;
}
const auto n = static_cast<size_t>(n_);
using namespace mr::detail_fft;
using namespace ducc0::detail_fft;
return PyLong_FromSize_t(
real ? util1d::good_size_real(n) : util1d::good_size_cmplx(n));
}
......
......@@ -36,7 +36,7 @@
#include "ducc0/infra/mav.h"
#include "ducc0/math/es_kernel.h"
namespace mr {
namespace ducc0 {
namespace detail_gridder {
......@@ -1121,6 +1121,6 @@ template<typename T> void dirty2ms(const mav<double,2> &uvw,
using detail_gridder::ms2dirty;
using detail_gridder::dirty2ms;
} // namespace mr
} // namespace ducc0
#endif
......@@ -39,7 +39,7 @@
#include "ducc0/math/geom_utils.h"
#include "ducc0/bindings/pybind_utils.h"
namespace mr {
namespace ducc0 {
namespace detail_pymodule_healpix {
......
......@@ -37,7 +37,7 @@
#include "ducc0/bindings/pybind_utils.h"
#include "python/alm.h"
namespace mr {
namespace ducc0 {
namespace detail_pymodule_misc {
......
......@@ -38,7 +38,7 @@
#include "ducc0/math/constants.h"
#include "ducc0/bindings/pybind_utils.h"
namespace mr {
namespace ducc0 {
namespace detail_pymodule_sht {
......
......@@ -7,7 +7,7 @@
#include <pybind11/numpy.h>
#include "python/totalconvolve.h"
namespace mr {
namespace ducc0 {
namespace detail_pymodule_totalconvolve {
......
......@@ -23,7 +23,7 @@
#include "python/alm.h"
#include "ducc0/math/fft.h"
namespace mr {
namespace ducc0 {
namespace detail_fft {
......
......@@ -24,7 +24,7 @@
#include "ducc0/bindings/pybind_utils.h"
#include "python/gridder_cxx.h"
namespace mr {
namespace ducc0 {
namespace detail_pymodule_wgridder {
......
......@@ -6,7 +6,7 @@
#include "ducc0/infra/mav.h"
namespace mr {
namespace ducc0 {
namespace detail_pybind {
......
......@@ -35,7 +35,7 @@
#include "ducc0/infra/mav.h"
#include "ducc0/math/space_filling.h"
namespace mr {
namespace ducc0 {
namespace detail_healpix {
......
......@@ -37,7 +37,7 @@
#include "ducc0/math/pointing.h"
#include "ducc0/math/rangeset.h"
namespace mr {
namespace ducc0 {
namespace detail_healpix {
......
......@@ -33,7 +33,7 @@
#include "ducc0/infra/string_utils.h"
#include "ducc0/infra/error_handling.h"
namespace mr {
namespace ducc0 {
namespace detail_healpix {
......
......@@ -35,7 +35,7 @@
#include <cstdint>
#include <string>
namespace mr {
namespace ducc0 {
namespace detail_healpix {
......
......@@ -25,7 +25,7 @@
#include <cstdlib>
#include <memory>
namespace mr {
namespace ducc0 {
namespace detail_aligned_array {
......
......@@ -5,7 +5,7 @@
#include "ducc0/infra/communication.h"
#include "ducc0/infra/error_handling.h"
namespace mr {
namespace ducc0 {
namespace detail_communication {
......
......@@ -33,7 +33,7 @@
#include "ducc0/infra/types.h"
namespace mr {
namespace ducc0 {
namespace detail_communication {
......
......@@ -27,14 +27,14 @@
#include "ducc0/infra/useful_macros.h"
namespace mr {
namespace ducc0 {
namespace detail_error_handling {
#if defined (__GNUC__)
#define DUCC0_ERROR_HANDLING_LOC_ ::mr::detail_error_handling::CodeLocation(__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define DUCC0_ERROR_HANDLING_LOC_ ::ducc0::detail_error_handling::CodeLocation(__FILE__, __LINE__, __PRETTY_FUNCTION__)
#else
#define DUCC0_ERROR_HANDLING_LOC_ ::mr::detail_error_handling::CodeLocation(__FILE__, __LINE__)
#define DUCC0_ERROR_HANDLING_LOC_ ::ducc0::detail_error_handling::CodeLocation(__FILE__, __LINE__)
#endif
// to be replaced with std::source_location once generally available
......@@ -81,13 +81,13 @@ template<typename ...Args>
[[noreturn]] void DUCC0_NOINLINE fail__(Args&&... args)
{
::std::ostringstream msg; \
::mr::detail_error_handling::streamDump__(msg, args...); \
::ducc0::detail_error_handling::streamDump__(msg, args...); \
throw ::std::runtime_error(msg.str()); \
}
#define MR_fail(...) \
do { \
::mr::detail_error_handling::fail__(DUCC0_ERROR_HANDLING_LOC_, "\n", ##__VA_ARGS__, "\n"); \
::ducc0::detail_error_handling::fail__(DUCC0_ERROR_HANDLING_LOC_, "\n", ##__VA_ARGS__, "\n"); \
} while(0)
#define MR_assert(cond,...) \
......
......@@ -29,7 +29,7 @@
#include <numeric>
#include "ducc0/infra/error_handling.h"
namespace mr {
namespace ducc0 {
namespace detail_mav {
......
......@@ -48,7 +48,7 @@
#include <x86intrin.h>
#endif
namespace mr {
namespace ducc0 {
namespace detail_simd {
......
......@@ -40,7 +40,7 @@
#include "ducc0/infra/string_utils.h"
#include "ducc0/infra/error_handling.h"
namespace mr {
namespace ducc0 {
namespace detail_string_utils {
......
......@@ -25,7 +25,7 @@
#include <vector>
#include <map>
namespace mr {
namespace ducc0 {
namespace detail_string_utils {
......
......@@ -28,7 +28,7 @@
#include "ducc0/infra/system.h"
#include "ducc0/infra/string_utils.h"
namespace mr {
namespace ducc0 {
namespace detail_system {
......
......@@ -25,7 +25,7 @@
#include <string>
#include <cstdlib>
namespace mr {
namespace ducc0 {
namespace detail_system {
......
......@@ -34,7 +34,7 @@
#endif
#endif
namespace mr {
namespace ducc0 {
namespace detail_threading {
......
......@@ -24,7 +24,7 @@
#include <functional>
namespace mr {
namespace ducc0 {
namespace detail_threading {
......@@ -73,6 +73,6 @@ using detail_threading::execDynamic;
using detail_threading::execGuided;
using detail_threading::execParallel;
} // end of namespace mr
} // end of namespace ducc0
#endif
......@@ -28,7 +28,7 @@
#include "ducc0/infra/error_handling.h"
namespace mr {
namespace ducc0 {
class SimpleTimer
{
......
......@@ -32,7 +32,7 @@
#include "ducc0/infra/error_handling.h"
#include "ducc0/infra/mav.h"
namespace mr {
namespace ducc0 {
namespace detail_transpose {
......
......@@ -26,7 +26,7 @@
using namespace std;
namespace mr {
namespace ducc0 {
namespace detail_types {
......
......@@ -28,7 +28,7 @@
#include <unordered_map>
#include "ducc0/infra/error_handling.h"
namespace mr {
namespace ducc0 {
namespace detail_types {
......
......@@ -22,7 +22,7 @@
#ifndef DUCC0_CMPLX_H
#define DUCC0_CMPLX_H
namespace mr {
namespace ducc0 {
template<typename T> struct Cmplx {
T r, i;
......
......@@ -29,7 +29,7 @@
#ifndef DUCC0_CONSTANTS_H
#define DUCC0_CONSTANTS_H
namespace mr {
namespace ducc0 {
/*! \defgroup mathconstgroup Mathematical constants */
/*! \{ */
......
......@@ -30,7 +30,7 @@
#include "ducc0/math/constants.h"
#include "ducc0/math/gl_integrator.h"
namespace mr {
namespace ducc0 {
namespace detail_es_kernel {
......
......@@ -55,7 +55,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <mutex>
#endif
namespace mr {
namespace ducc0 {
namespace detail_fft {
......@@ -117,7 +117,7 @@ struct util // hack to avoid duplicate symbols
size_t parallel = size / (info.shape(axis) * vlen);
if (info.shape(axis) < 1000)
parallel /= 4;
size_t max_threads = (nthreads==0) ? mr::max_threads() : nthreads;
size_t max_threads = (nthreads==0) ? ducc0::max_threads() : nthreads;
return std::max(size_t(1), std::min(parallel, max_threads));
}
#endif
......@@ -1190,6 +1190,6 @@ using detail_fft::r2r_genuine_hartley;
using detail_fft::dct;
using detail_fft::dst;
} // namespace mr
} // namespace ducc0
#endif // POCKETFFT_HDRONLY_H
......@@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ducc0/infra/aligned_array.h"
#include "ducc0/math/unity_roots.h"
namespace mr {
namespace ducc0 {
namespace detail_fft {
......
......@@ -30,7 +30,7 @@
#include "ducc0/math/geom_utils.h"
#include "ducc0/infra/error_handling.h"
namespace mr {
namespace ducc0 {
namespace detail_geom_utils {
......
......@@ -38,7 +38,7 @@
#include "ducc0/math/math_utils.h"
#include "ducc0/math/vec3.h"
namespace mr {
namespace ducc0 {
namespace detail_geom_utils {
......
......@@ -27,7 +27,7 @@
#include "ducc0/infra/error_handling.h"
#include "ducc0/infra/threading.h"
namespace mr {
namespace ducc0 {
namespace detail_gl_integrator {
......
......@@ -36,7 +36,7 @@
#include <cstdint>
#include <vector>
namespace mr {
namespace ducc0 {
/*! Returns \e true if | \a a-b | <= \a epsilon * | \a b |, else \e false. */
template<typename F> inline bool approx (F a, F b, F epsilon=F(1e-5L))
......
......@@ -35,7 +35,7 @@
using namespace std;
namespace mr {
namespace ducc0 {
vec3 pointing::to_vec3() const
{
......
......@@ -35,7 +35,7 @@
#include <cmath>
#include "ducc0/math/vec3.h"
namespace mr {
namespace ducc0 {
/*! \defgroup pointinggroup Pointings */
/*! \{ */
......
......@@ -39,7 +39,7 @@
#include "ducc0/infra/error_handling.h"
#include "ducc0/math/math_utils.h"
namespace mr {
namespace ducc0 {
/*! Class for storing sets of ranges of integer numbers */
template<typename T> class rangeset
......
......@@ -31,7 +31,7 @@
#include "ducc0/math/space_filling.h"
namespace mr {
namespace ducc0 {
#ifndef __BMI2__
......
......@@ -40,7 +40,7 @@
#include <x86intrin.h>
#endif
namespace mr {
namespace ducc0 {
#ifndef __BMI2__
......
......@@ -26,7 +26,7 @@
#include <type_traits>
#include <vector>