revamp include mechanism; update copyright; fix for OSX
This commit is contained in:
parent
e5d8adf15b
commit
db08a08f77
29 changed files with 135 additions and 171 deletions
|
@ -16,28 +16,24 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp.c
|
||||
* Spherical transform library
|
||||
*
|
||||
* Copyright (C) 2006-2016 Max-Planck-Society
|
||||
* Copyright (C) 2006-2019 Max-Planck-Society
|
||||
* \author Martin Reinecke \author Dag Sverre Seljebotn
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include "pocketfft/pocketfft.h"
|
||||
#include "sharp_ylmgen_c.h"
|
||||
#include "sharp_internal.h"
|
||||
#include "c_utils.h"
|
||||
#include "walltime_c.h"
|
||||
#include "sharp_almhelpers.h"
|
||||
#include "sharp_geomhelpers.h"
|
||||
#include "libsharp/sharp_ylmgen_c.h"
|
||||
#include "libsharp/sharp_internal.h"
|
||||
#include "c_utils/c_utils.h"
|
||||
#include "c_utils/walltime_c.h"
|
||||
#include "libsharp/sharp_almhelpers.h"
|
||||
#include "libsharp/sharp_geomhelpers.h"
|
||||
|
||||
typedef complex double dcmplx;
|
||||
typedef complex float fcmplx;
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp.h
|
||||
* Portable interface for the spherical transform library.
|
||||
|
|
|
@ -16,21 +16,17 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_almhelpers.c
|
||||
* Spherical transform library
|
||||
*
|
||||
* Copyright (C) 2008-2016 Max-Planck-Society
|
||||
* Copyright (C) 2008-2019 Max-Planck-Society
|
||||
* \author Martin Reinecke
|
||||
*/
|
||||
|
||||
#include "sharp_almhelpers.h"
|
||||
#include "c_utils.h"
|
||||
#include "libsharp/sharp_almhelpers.h"
|
||||
#include "c_utils/c_utils.h"
|
||||
|
||||
void sharp_make_triangular_alm_info (int lmax, int mmax, int stride,
|
||||
sharp_alm_info **alm_info)
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_almhelpers.h
|
||||
* SHARP helper function for the creation of a_lm data structures
|
||||
|
@ -32,7 +28,7 @@
|
|||
#ifndef PLANCK_SHARP_ALMHELPERS_H
|
||||
#define PLANCK_SHARP_ALMHELPERS_H
|
||||
|
||||
#include "sharp.h"
|
||||
#include "libsharp/sharp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -1,6 +1,33 @@
|
|||
/*
|
||||
* This file is part of libsharp.
|
||||
*
|
||||
* libsharp is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* libsharp is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with libsharp; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_core.c
|
||||
* Spherical transform library
|
||||
*
|
||||
* Copyright (C) 2019 Max-Planck-Society
|
||||
* \author Martin Reinecke
|
||||
*/
|
||||
|
||||
#define ARCH default
|
||||
#define GENERIC_ARCH
|
||||
#include "sharp_core_inc.c"
|
||||
#include "libsharp/sharp_core_inc.c"
|
||||
#undef GENERIC_ARCH
|
||||
#undef ARCH
|
||||
|
||||
|
@ -42,7 +69,9 @@ int XCONCATX2(sharp_veclen,arch) (void); \
|
|||
int XCONCATX2(sharp_max_nvec,arch) (int spin); \
|
||||
const char *XCONCATX2(sharp_architecture,arch) (void);
|
||||
|
||||
#if (!defined(__APPLE__))
|
||||
DECL(avx512f)
|
||||
#endif
|
||||
DECL(fma4)
|
||||
DECL(fma)
|
||||
DECL(avx2)
|
||||
|
@ -62,7 +91,9 @@ static void assign_funcs(void)
|
|||
architecture_ = XCONCATX2(sharp_architecture,arch); \
|
||||
return; \
|
||||
}
|
||||
#if (!defined(__APPLE__))
|
||||
DECL2(avx512f)
|
||||
#endif
|
||||
DECL2(fma4)
|
||||
DECL2(fma)
|
||||
DECL2(avx2)
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_core_inc.c
|
||||
* Computational core
|
||||
|
@ -29,6 +25,9 @@
|
|||
* \author Martin Reinecke
|
||||
*/
|
||||
|
||||
// FIXME: special ugly workaround for problems on OSX
|
||||
#if (!defined(__APPLE__)) || (!defined(__AVX512F__))
|
||||
|
||||
#if (defined(MULTIARCH) || defined(GENERIC_ARCH))
|
||||
|
||||
#define XCONCATX(a,b) a##_##b
|
||||
|
@ -38,10 +37,10 @@
|
|||
#include <complex.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include "sharp_vecsupport.h"
|
||||
#include "sharp.h"
|
||||
#include "sharp_internal.h"
|
||||
#include "c_utils.h"
|
||||
#include "libsharp/sharp_vecsupport.h"
|
||||
#include "libsharp/sharp.h"
|
||||
#include "libsharp/sharp_internal.h"
|
||||
#include "c_utils/c_utils.h"
|
||||
|
||||
typedef complex double dcmplx;
|
||||
|
||||
|
@ -1205,3 +1204,5 @@ const char *XARCH(sharp_architecture)(void)
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_cxx.h
|
||||
* Spherical transform library
|
||||
|
@ -33,9 +29,9 @@
|
|||
#define PLANCK_SHARP_CXX_H
|
||||
|
||||
#include <complex>
|
||||
#include "sharp.h"
|
||||
#include "sharp_geomhelpers.h"
|
||||
#include "sharp_almhelpers.h"
|
||||
#include "libsharp/sharp.h"
|
||||
#include "libsharp/sharp_geomhelpers.h"
|
||||
#include "libsharp/sharp_almhelpers.h"
|
||||
|
||||
class sharp_base
|
||||
{
|
||||
|
@ -89,9 +85,6 @@ class sharp_base
|
|||
if (ainfo) sharp_destroy_alm_info(ainfo);
|
||||
sharp_make_triangular_alm_info (lmax, mmax, 1, &ainfo);
|
||||
}
|
||||
|
||||
const sharp_geom_info* get_geom_info() const { return ginfo; }
|
||||
const sharp_alm_info* get_alm_info() const { return ainfo; }
|
||||
};
|
||||
|
||||
template<typename T> struct cxxjobhelper__ {};
|
||||
|
|
|
@ -16,23 +16,19 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_geomhelpers.c
|
||||
* Spherical transform library
|
||||
*
|
||||
* Copyright (C) 2006-2018 Max-Planck-Society
|
||||
* Copyright (C) 2006-2019 Max-Planck-Society
|
||||
* \author Martin Reinecke
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "sharp_geomhelpers.h"
|
||||
#include "sharp_legendre_roots.h"
|
||||
#include "c_utils.h"
|
||||
#include "libsharp/sharp_geomhelpers.h"
|
||||
#include "libsharp/sharp_legendre_roots.h"
|
||||
#include "c_utils/c_utils.h"
|
||||
#include "pocketfft/pocketfft.h"
|
||||
|
||||
void sharp_make_subset_healpix_geom_info (int nside, int stride, int nrings,
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_geomhelpers.h
|
||||
* SHARP helper function for the creation of grid geometries
|
||||
|
@ -32,7 +28,7 @@
|
|||
#ifndef PLANCK_SHARP_GEOMHELPERS_H
|
||||
#define PLANCK_SHARP_GEOMHELPERS_H
|
||||
|
||||
#include "sharp.h"
|
||||
#include "libsharp/sharp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_internal.h
|
||||
* Internally used functionality for the spherical transform library.
|
||||
|
@ -37,8 +33,8 @@
|
|||
#endif
|
||||
|
||||
#include <complex.h>
|
||||
#include "sharp.h"
|
||||
#include "sharp_ylmgen_c.h"
|
||||
#include "libsharp/sharp.h"
|
||||
#include "libsharp/sharp_ylmgen_c.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
- tweaked Newton iteration to obtain higher accuracy */
|
||||
|
||||
#include <math.h>
|
||||
#include "sharp_legendre_roots.h"
|
||||
#include "c_utils.h"
|
||||
#include "libsharp/sharp_legendre_roots.h"
|
||||
#include "c_utils/c_utils.h"
|
||||
|
||||
static inline double one_minus_x2 (double x)
|
||||
{ return (fabs(x)>0.1) ? (1.+x)*(1.-x) : 1.-x*x; }
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_legendre_roots.h
|
||||
*
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_mpi.c
|
||||
* Functionality only needed for MPI-parallel transforms
|
||||
|
@ -31,7 +27,7 @@
|
|||
|
||||
#ifdef USE_MPI
|
||||
|
||||
#include "sharp_mpi.h"
|
||||
#include "libsharp/sharp_mpi.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_mpi.h
|
||||
* Interface for the spherical transform library with MPI support.
|
||||
|
@ -33,7 +29,7 @@
|
|||
#define PLANCK_SHARP_MPI_H
|
||||
|
||||
#include <mpi.h>
|
||||
#include "sharp.h"
|
||||
#include "libsharp/sharp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/* \file sharp_testsuite.c
|
||||
*
|
||||
|
@ -32,17 +28,17 @@
|
|||
#include <string.h>
|
||||
#ifdef USE_MPI
|
||||
#include "mpi.h"
|
||||
#include "sharp_mpi.h"
|
||||
#include "libsharp/sharp_mpi.h"
|
||||
#endif
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
#include "sharp.h"
|
||||
#include "sharp_internal.h"
|
||||
#include "sharp_geomhelpers.h"
|
||||
#include "sharp_almhelpers.h"
|
||||
#include "c_utils.h"
|
||||
#include "memusage.h"
|
||||
#include "libsharp/sharp.h"
|
||||
#include "libsharp/sharp_internal.h"
|
||||
#include "libsharp/sharp_geomhelpers.h"
|
||||
#include "libsharp/sharp_almhelpers.h"
|
||||
#include "c_utils/c_utils.h"
|
||||
#include "c_utils/memusage.h"
|
||||
|
||||
static void OpenMP_status(void)
|
||||
{
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/* \file sharp_vecsupport.h
|
||||
* Convenience functions for vector arithmetics
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*
|
||||
* Helper code for efficient calculation of Y_lm(theta,phi=0)
|
||||
|
@ -31,8 +27,8 @@
|
|||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include "sharp_ylmgen_c.h"
|
||||
#include "c_utils.h"
|
||||
#include "libsharp/sharp_ylmgen_c.h"
|
||||
#include "c_utils/c_utils.h"
|
||||
|
||||
static inline void normalize (double *val, int *scale, double xfmax)
|
||||
{
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik
|
||||
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
|
||||
* (DLR).
|
||||
*/
|
||||
/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */
|
||||
|
||||
/*! \file sharp_ylmgen_c.h
|
||||
* Code for efficient calculation of Y_lm(phi=0,theta)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue