diff --git a/Makefile.am b/Makefile.am index f946f3a..44f5b35 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,10 +3,8 @@ ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libsharp.la libsharp_la_SOURCES = \ - c_utils/c_utils.c \ - c_utils/c_utils.h \ - c_utils/walltime_c.c \ - c_utils/walltime_c.h \ + libsharp/sharp_utils.c \ + libsharp/sharp_utils.h \ libsharp/sharp.c \ libsharp/sharp_almhelpers.c \ libsharp/sharp_core.c \ @@ -48,7 +46,7 @@ EXTRA_DIST = \ runtest.sh check_PROGRAMS = sharp_testsuite -sharp_testsuite_SOURCES = libsharp/sharp_testsuite.c c_utils/memusage.c c_utils/memusage.h +sharp_testsuite_SOURCES = test/sharp_testsuite.c test/memusage.c test/memusage.h sharp_testsuite_LDADD = libsharp.la @POCKETFFT_LIBS@ TESTS = runtest.sh diff --git a/c_utils/walltime_c.c b/c_utils/walltime_c.c deleted file mode 100644 index f6b8a08..0000000 --- a/c_utils/walltime_c.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of libc_utils. - * - * libc_utils 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. - * - * libc_utils 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 libc_utils; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* libc_utils is being developed at the Max-Planck-Institut fuer Astrophysik */ - -/* - * Functionality for reading wall clock time - * - * Copyright (C) 2010-2019 Max-Planck-Society - * Author: Martin Reinecke - */ - -#if defined (_OPENMP) -#include -#elif defined (USE_MPI) -#include "mpi.h" -#elif defined (_WIN32) -#include -#else -#include -#include -#endif - -#include "c_utils/walltime_c.h" - -double wallTime(void) - { -#if defined (_OPENMP) - return omp_get_wtime(); -#elif defined (USE_MPI) - return MPI_Wtime(); -#elif defined (_WIN32) - static double inv_freq = -1.; - if (inv_freq<0) - { - LARGE_INTEGER freq; - QueryPerformanceFrequency(&freq); - inv_freq = 1. / double(freq.QuadPart); - } - LARGE_INTEGER count; - QueryPerformanceCounter(&count); - return count.QuadPart*inv_freq; -#else - struct timeval t; - gettimeofday(&t, NULL); - return t.tv_sec + 1e-6*t.tv_usec; -#endif - } diff --git a/c_utils/walltime_c.h b/c_utils/walltime_c.h deleted file mode 100644 index d74dc6c..0000000 --- a/c_utils/walltime_c.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of libc_utils. - * - * libc_utils 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. - * - * libc_utils 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 libc_utils; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* libc_utils is being developed at the Max-Planck-Institut fuer Astrophysik */ - -/*! \file walltime_c.h - * Functionality for reading wall clock time - * - * Copyright (C) 2010-2019 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_WALLTIME_C_H -#define PLANCK_WALLTIME_C_H - -#ifdef __cplusplus -extern "C" { -#endif - -/*! Returns an approximation of the current wall time (in seconds). - The first available of the following timers will be used: -
    -
  • \a omp_get_wtime(), if OpenMP is available -
  • \a MPI_Wtime(), if MPI is available -
  • \a gettimeofday() otherwise -
- \note Only useful for measuring time differences. - \note This function has an execution time between 10 and 100 nanoseconds. */ -double wallTime(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libsharp/sharp.c b/libsharp/sharp.c index 58d2565..a4345f2 100644 --- a/libsharp/sharp.c +++ b/libsharp/sharp.c @@ -30,8 +30,7 @@ #include "pocketfft/pocketfft.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_utils.h" #include "libsharp/sharp_almhelpers.h" #include "libsharp/sharp_geomhelpers.h" @@ -836,7 +835,7 @@ NOINLINE static void phase2map (sharp_job *job, int mmax, int llim, int ulim) NOINLINE static void sharp_execute_job (sharp_job *job) { - double timer=wallTime(); + double timer=sharp_wallTime(); job->opcnt=0; int lmax = job->ainfo->lmax, mmax=sharp_get_mmax(job->ainfo->mval, job->ainfo->nm); @@ -910,7 +909,7 @@ NOINLINE static void sharp_execute_job (sharp_job *job) DEALLOC(job->norm_l); dealloc_phase (job); - job->time=wallTime()-timer; + job->time=sharp_wallTime()-timer; } static void sharp_build_job_common (sharp_job *job, sharp_jobtype type, diff --git a/libsharp/sharp.h b/libsharp/sharp.h index 657e369..1fe1566 100644 --- a/libsharp/sharp.h +++ b/libsharp/sharp.h @@ -25,8 +25,8 @@ * \author Martin Reinecke \author Dag Sverre Seljebotn */ -#ifndef PLANCK_SHARP_H -#define PLANCK_SHARP_H +#ifndef SHARP_SHARP_H +#define SHARP_SHARP_H #include @@ -253,6 +253,10 @@ int sharp_execute_mpi_maybe (void *pcomm, sharp_jobtype type, int spin, /*! \} */ +int sharp_get_mlim (int lmax, int spin, double sth, double cth); +int sharp_veclen(void); +const char *sharp_architecture(void); + #ifdef __cplusplus } #endif diff --git a/libsharp/sharp_almhelpers.c b/libsharp/sharp_almhelpers.c index c744b47..59b564c 100644 --- a/libsharp/sharp_almhelpers.c +++ b/libsharp/sharp_almhelpers.c @@ -26,7 +26,7 @@ */ #include "libsharp/sharp_almhelpers.h" -#include "c_utils/c_utils.h" +#include "libsharp/sharp_utils.h" void sharp_make_triangular_alm_info (int lmax, int mmax, int stride, sharp_alm_info **alm_info) diff --git a/libsharp/sharp_almhelpers.h b/libsharp/sharp_almhelpers.h index 1d40d01..3dc85f5 100644 --- a/libsharp/sharp_almhelpers.h +++ b/libsharp/sharp_almhelpers.h @@ -25,8 +25,8 @@ * \author Martin Reinecke */ -#ifndef PLANCK_SHARP_ALMHELPERS_H -#define PLANCK_SHARP_ALMHELPERS_H +#ifndef SHARP_ALMHELPERS_H +#define SHARP_ALMHELPERS_H #include "libsharp/sharp.h" diff --git a/libsharp/sharp_core.c b/libsharp/sharp_core.c index 2c78f2b..1dec17a 100644 --- a/libsharp/sharp_core.c +++ b/libsharp/sharp_core.c @@ -105,6 +105,7 @@ DECL2(avx) architecture_ = sharp_architecture_default; } +#pragma GCC visibility push(hidden) void inner_loop (sharp_job *job, const int *ispair,const double *cth, const double *sth, int llim, int ulim, sharp_Ylmgen_C *gen, int mi, @@ -113,16 +114,20 @@ void inner_loop (sharp_job *job, const int *ispair,const double *cth, if (!inner_loop_) assign_funcs(); inner_loop_(job, ispair, cth, sth, llim, ulim, gen, mi, mlim); } -int sharp_veclen(void) - { - if (!veclen_) assign_funcs(); - return veclen_(); - } + int sharp_max_nvec(int spin) { if (!max_nvec_) assign_funcs(); return max_nvec_(spin); } + +#pragma GCC visibility pop + +int sharp_veclen(void) + { + if (!veclen_) assign_funcs(); + return veclen_(); + } const char *sharp_architecture(void) { if (!architecture_) assign_funcs(); diff --git a/libsharp/sharp_core_inc.c b/libsharp/sharp_core_inc.c index 682558c..612a778 100644 --- a/libsharp/sharp_core_inc.c +++ b/libsharp/sharp_core_inc.c @@ -40,7 +40,9 @@ #include "libsharp/sharp_vecsupport.h" #include "libsharp/sharp.h" #include "libsharp/sharp_internal.h" -#include "c_utils/c_utils.h" +#include "libsharp/sharp_utils.h" + +#pragma GCC visibility push(hidden) // In the following, we explicitly allow the compiler to contract floating // point operations, like multiply-and-add. @@ -1208,6 +1210,8 @@ const char *XARCH(sharp_architecture)(void) return xstr(ARCH); } +#pragma GCC visibility pop + #endif #endif diff --git a/libsharp/sharp_cxx.h b/libsharp/sharp_cxx.h index e37d491..60995ed 100644 --- a/libsharp/sharp_cxx.h +++ b/libsharp/sharp_cxx.h @@ -25,8 +25,8 @@ * \author Martin Reinecke */ -#ifndef PLANCK_SHARP_CXX_H -#define PLANCK_SHARP_CXX_H +#ifndef SHARP_CXX_H +#define SHARP_CXX_H #include #include "libsharp/sharp.h" diff --git a/libsharp/sharp_geomhelpers.c b/libsharp/sharp_geomhelpers.c index f8f5152..cd7c6fa 100644 --- a/libsharp/sharp_geomhelpers.c +++ b/libsharp/sharp_geomhelpers.c @@ -28,7 +28,7 @@ #include #include "libsharp/sharp_geomhelpers.h" #include "libsharp/sharp_legendre_roots.h" -#include "c_utils/c_utils.h" +#include "libsharp/sharp_utils.h" #include "pocketfft/pocketfft.h" void sharp_make_subset_healpix_geom_info (int nside, int stride, int nrings, diff --git a/libsharp/sharp_geomhelpers.h b/libsharp/sharp_geomhelpers.h index 27b1246..d0a4f33 100644 --- a/libsharp/sharp_geomhelpers.h +++ b/libsharp/sharp_geomhelpers.h @@ -25,8 +25,8 @@ * \author Martin Reinecke */ -#ifndef PLANCK_SHARP_GEOMHELPERS_H -#define PLANCK_SHARP_GEOMHELPERS_H +#ifndef SHARP_GEOMHELPERS_H +#define SHARP_GEOMHELPERS_H #include "libsharp/sharp.h" diff --git a/libsharp/sharp_internal.h b/libsharp/sharp_internal.h index 78ff666..89c4429 100644 --- a/libsharp/sharp_internal.h +++ b/libsharp/sharp_internal.h @@ -25,8 +25,8 @@ * \author Martin Reinecke \author Dag Sverre Seljebotn */ -#ifndef PLANCK_SHARP_INTERNAL_H -#define PLANCK_SHARP_INTERNAL_H +#ifndef SHARP_INTERNAL_H +#define SHARP_INTERNAL_H #ifdef __cplusplus #error This header file cannot be included from C++, only from C @@ -54,14 +54,10 @@ typedef struct unsigned long long opcnt; } sharp_job; -int sharp_get_mlim (int lmax, int spin, double sth, double cth); - void inner_loop (sharp_job *job, const int *ispair,const double *cth, const double *sth, int llim, int ulim, sharp_Ylmgen_C *gen, int mi, const int *mlim); -int sharp_veclen(void); int sharp_max_nvec(int spin); -const char *sharp_architecture(void); #endif diff --git a/libsharp/sharp_legendre_roots.c b/libsharp/sharp_legendre_roots.c index ec81ecb..648cfca 100644 --- a/libsharp/sharp_legendre_roots.c +++ b/libsharp/sharp_legendre_roots.c @@ -8,7 +8,7 @@ #include #include "libsharp/sharp_legendre_roots.h" -#include "c_utils/c_utils.h" +#include "libsharp/sharp_utils.h" static inline double one_minus_x2 (double x) { return (fabs(x)>0.1) ? (1.+x)*(1.-x) : 1.-x*x; } diff --git a/libsharp/sharp_mpi.c b/libsharp/sharp_mpi.c index 02c76c3..2be016a 100644 --- a/libsharp/sharp_mpi.c +++ b/libsharp/sharp_mpi.c @@ -211,7 +211,7 @@ static void sharp_execute_job_mpi (sharp_job *job, MPI_Comm comm) { sharp_execute_job (job); return; } MPI_Barrier(comm); - double timer=wallTime(); + double timer=sharp_wallTime(); job->opcnt=0; sharp_mpi_info minfo; sharp_make_mpi_info(comm, job, &minfo); @@ -306,7 +306,7 @@ static void sharp_execute_job_mpi (sharp_job *job, MPI_Comm comm) dealloc_phase (job); } sharp_destroy_mpi_info(&minfo); - job->time=wallTime()-timer; + job->time=sharp_wallTime()-timer; } void sharp_execute_mpi (MPI_Comm comm, sharp_jobtype type, int spin, diff --git a/libsharp/sharp_mpi.h b/libsharp/sharp_mpi.h index bb26ff0..0195032 100644 --- a/libsharp/sharp_mpi.h +++ b/libsharp/sharp_mpi.h @@ -25,8 +25,8 @@ * \author Martin Reinecke \author Dag Sverre Seljebotn */ -#ifndef PLANCK_SHARP_MPI_H -#define PLANCK_SHARP_MPI_H +#ifndef SHARP_MPI_H +#define SHARP_MPI_H #include #include "libsharp/sharp.h" diff --git a/c_utils/c_utils.c b/libsharp/sharp_utils.c similarity index 58% rename from c_utils/c_utils.c rename to libsharp/sharp_utils.c index cf4f409..c73edf8 100644 --- a/c_utils/c_utils.c +++ b/libsharp/sharp_utils.c @@ -1,22 +1,22 @@ /* - * This file is part of libc_utils. + * This file is part of libsharp. * - * libc_utils is free software; you can redistribute it and/or modify + * 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. * - * libc_utils is distributed in the hope that it will be useful, + * 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 libc_utils; if not, write to the Free Software + * along with libsharp; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* libc_utils is being developed at the Max-Planck-Institut fuer Astrophysik */ +/* libsharp is being developed at the Max-Planck-Institut fuer Astrophysik */ /* * Convenience functions @@ -26,17 +26,13 @@ */ #include -#include "c_utils/c_utils.h" +#include "libsharp/sharp_utils.h" -void util_fail_ (const char *file, int line, const char *func, const char *msg) +void sharp_fail_ (const char *file, int line, const char *func, const char *msg) { fprintf(stderr,"%s, %i (%s):\n%s\n",file,line,func,msg); exit(1); } -void util_warn_ (const char *file, int line, const char *func, const char *msg) - { - fprintf(stderr,"%s, %i (%s):\n%s\n",file,line,func,msg); - } /* This function tries to avoid allocations with a total size close to a high power of two (called the "critical stride" here), by adding a few more bytes @@ -53,7 +49,7 @@ static size_t manipsize(size_t sz) #ifdef __SSE__ #include -void *util_malloc_ (size_t sz) +void *sharp_malloc_ (size_t sz) { void *res; if (sz==0) return NULL; @@ -61,10 +57,10 @@ void *util_malloc_ (size_t sz) UTIL_ASSERT(res,"_mm_malloc() failed"); return res; } -void util_free_ (void *ptr) +void sharp_free_ (void *ptr) { if ((ptr)!=NULL) _mm_free(ptr); } #else -void *util_malloc_ (size_t sz) +void *sharp_malloc_ (size_t sz) { void *res; if (sz==0) return NULL; @@ -72,6 +68,41 @@ void *util_malloc_ (size_t sz) UTIL_ASSERT(res,"malloc() failed"); return res; } -void util_free_ (void *ptr) +void sharp_free_ (void *ptr) { if ((ptr)!=NULL) free(ptr); } #endif + +#if defined (_OPENMP) +#include +#elif defined (USE_MPI) +#include "mpi.h" +#elif defined (_WIN32) +#include +#else +#include +#include +#endif + +double sharp_wallTime(void) + { +#if defined (_OPENMP) + return omp_get_wtime(); +#elif defined (USE_MPI) + return MPI_Wtime(); +#elif defined (_WIN32) + static double inv_freq = -1.; + if (inv_freq<0) + { + LARGE_INTEGER freq; + QueryPerformanceFrequency(&freq); + inv_freq = 1. / double(freq.QuadPart); + } + LARGE_INTEGER count; + QueryPerformanceCounter(&count); + return count.QuadPart*inv_freq; +#else + struct timeval t; + gettimeofday(&t, NULL); + return t.tv_sec + 1e-6*t.tv_usec; +#endif + } diff --git a/c_utils/c_utils.h b/libsharp/sharp_utils.h similarity index 68% rename from c_utils/c_utils.h rename to libsharp/sharp_utils.h index 5aed9a1..d2a1c74 100644 --- a/c_utils/c_utils.h +++ b/libsharp/sharp_utils.h @@ -26,8 +26,8 @@ * \note This file should only be included from .c files, NOT from .h files. */ -#ifndef PLANCK_C_UTILS_H -#define PLANCK_C_UTILS_H +#ifndef SHARP_UTILS_H +#define SHARP_UTILS_H #include #include @@ -37,10 +37,9 @@ extern "C" { #endif -void util_fail_ (const char *file, int line, const char *func, const char *msg); -void util_warn_ (const char *file, int line, const char *func, const char *msg); -void *util_malloc_ (size_t sz); -void util_free_ (void *ptr); +void sharp_fail_ (const char *file, int line, const char *func, const char *msg); +void *sharp_malloc_ (size_t sz); +void sharp_free_ (void *ptr); #if defined (__GNUC__) #define UTIL_FUNC_NAME__ __func__ @@ -53,43 +52,32 @@ void util_free_ (void *ptr); source file name and line number of the call, as well as \a msg; then exit the program with an error status. */ #define UTIL_ASSERT(cond,msg) \ - if(!(cond)) util_fail_(__FILE__,__LINE__,UTIL_FUNC_NAME__,msg) + if(!(cond)) sharp_fail_(__FILE__,__LINE__,UTIL_FUNC_NAME__,msg) /*! \def UTIL_WARN(cond,msg) If \a cond is false, print an warning containing function name, source file name and line number of the call, as well as \a msg. */ -#define UTIL_WARN(cond,msg) \ - if(!(cond)) util_warn_(__FILE__,__LINE__,UTIL_FUNC_NAME__,msg) -/*! \def UTIL_FAIL(msg) - Print an error message containing function name, - source file name and line number of the call, as well as \a msg; - then exit the program with an error status. */ #define UTIL_FAIL(msg) \ - util_fail_(__FILE__,__LINE__,UTIL_FUNC_NAME__,msg) + sharp_fail_(__FILE__,__LINE__,UTIL_FUNC_NAME__,msg) /*! \def ALLOC(ptr,type,num) Allocate space for \a num objects of type \a type. Make sure that the allocation succeeded, else stop the program with an error. Return the resulting pointer in \a ptr. */ #define ALLOC(ptr,type,num) \ - do { (ptr)=(type *)util_malloc_((num)*sizeof(type)); } while (0) + do { (ptr)=(type *)sharp_malloc_((num)*sizeof(type)); } while (0) /*! \def RALLOC(type,num) Allocate space for \a num objects of type \a type. Make sure that the allocation succeeded, else stop the program with an error. Cast the resulting pointer to \a (type*). */ #define RALLOC(type,num) \ - ((type *)util_malloc_((num)*sizeof(type))) + ((type *)sharp_malloc_((num)*sizeof(type))) /*! \def DEALLOC(ptr) Deallocate \a ptr. It must have been allocated using \a ALLOC or \a RALLOC. */ #define DEALLOC(ptr) \ - do { util_free_(ptr); (ptr)=NULL; } while(0) + do { sharp_free_(ptr); (ptr)=NULL; } while(0) #define RESIZE(ptr,type,num) \ - do { util_free_(ptr); ALLOC(ptr,type,num); } while(0) -#define GROW(ptr,type,sz_old,sz_new) \ - do { \ - if ((sz_new)>(sz_old)) \ - { RESIZE(ptr,type,2*(sz_new));sz_old=2*(sz_new); } \ - } while(0) + do { sharp_free_(ptr); ALLOC(ptr,type,num); } while(0) /*! \def SET_ARRAY(ptr,i1,i2,val) Set the entries \a ptr[i1] ... \a ptr[i2-1] to \a val. */ #define SET_ARRAY(ptr,i1,i2,val) \ @@ -97,14 +85,6 @@ void util_free_ (void *ptr); ptrdiff_t cnt_; \ for (cnt_=(i1);cnt_<(i2);++cnt_) (ptr)[cnt_]=(val); \ } while(0) -/*! \def COPY_ARRAY(src,dest,i1,i2) - Copy the entries \a src[i1] ... \a src[i2-1] to - \a dest[i1] ... \a dest[i2-1]. */ -#define COPY_ARRAY(src,dest,i1,i2) \ - do { \ - ptrdiff_t cnt_; \ - for (cnt_=(i1);cnt_<(i2);++cnt_) (dest)[cnt_]=(src)[cnt_]; \ - } while(0) #define ALLOC2D(ptr,type,num1,num2) \ do { \ @@ -119,8 +99,6 @@ void util_free_ (void *ptr); #define FAPPROX(a,b,eps) \ (fabs((a)-(b))<((eps)*fabs(b))) -#define ABSAPPROX(a,b,eps) \ - (fabs((a)-(b))<(eps)) #define IMAX(a,b) \ (((a)>(b)) ? (a) : (b)) #define IMIN(a,b) \ @@ -129,12 +107,16 @@ void util_free_ (void *ptr); #define SWAP(a,b,type) \ do { type tmp_=(a); (a)=(b); (b)=tmp_; } while(0) -#define CHECK_STACK_ALIGN(align) \ - do { \ - double foo; \ - UTIL_WARN((((size_t)(&foo))&(align-1))==0, \ - "WARNING: stack not sufficiently aligned!"); \ - } while(0) +/*! Returns an approximation of the current wall time (in seconds). + The first available of the following timers will be used: +
    +
  • \a omp_get_wtime(), if OpenMP is available +
  • \a MPI_Wtime(), if MPI is available +
  • \a gettimeofday() otherwise +
+ \note Only useful for measuring time differences. + \note This function has an execution time between 10 and 100 nanoseconds. */ +double sharp_wallTime(void); #ifdef __cplusplus } diff --git a/libsharp/sharp_ylmgen_c.c b/libsharp/sharp_ylmgen_c.c index 35f3397..791908c 100644 --- a/libsharp/sharp_ylmgen_c.c +++ b/libsharp/sharp_ylmgen_c.c @@ -28,7 +28,9 @@ #include #include #include "libsharp/sharp_ylmgen_c.h" -#include "c_utils/c_utils.h" +#include "libsharp/sharp_utils.h" + +#pragma GCC visibility push(hidden) static inline void normalize (double *val, int *scale, double xfmax) { @@ -252,3 +254,5 @@ double *sharp_Ylmgen_get_d1norm (int lmax) res[l] = (l<1) ? 0. : 0.5*sqrt(l*(l+1.)*(2*l+1.)/(4*pi)); return res; } + +#pragma GCC visibility pop diff --git a/c_utils/memusage.c b/test/memusage.c similarity index 98% rename from c_utils/memusage.c rename to test/memusage.c index 7fe5fa3..3db8e13 100644 --- a/c_utils/memusage.c +++ b/test/memusage.c @@ -27,7 +27,7 @@ #include #include -#include "c_utils/memusage.h" +#include "test/memusage.h" double residentSetSize(void) { diff --git a/c_utils/memusage.h b/test/memusage.h similarity index 96% rename from c_utils/memusage.h rename to test/memusage.h index 73c55c3..023821a 100644 --- a/c_utils/memusage.h +++ b/test/memusage.h @@ -25,8 +25,8 @@ * \author Martin Reinecke */ -#ifndef PLANCK_MEMUSAGE_H -#define PLANCK_MEMUSAGE_H +#ifndef SHARP_MEMUSAGE_H +#define SHARP_MEMUSAGE_H #ifdef __cplusplus extern "C" { diff --git a/libsharp/sharp_testsuite.c b/test/sharp_testsuite.c similarity index 99% rename from libsharp/sharp_testsuite.c rename to test/sharp_testsuite.c index 4392a61..c9986be 100644 --- a/libsharp/sharp_testsuite.c +++ b/test/sharp_testsuite.c @@ -26,6 +26,7 @@ #include #include +#include #ifdef USE_MPI #include "mpi.h" #include "libsharp/sharp_mpi.h" @@ -34,11 +35,10 @@ #include #endif #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" +#include "libsharp/sharp_utils.h" +#include "test/memusage.h" static void OpenMP_status(void) {