From 39cf1ee90be666028360eb2d14c278b57f69fd04 Mon Sep 17 00:00:00 2001 From: Martin Reinecke Date: Wed, 4 Jul 2012 14:01:43 +0200 Subject: [PATCH] missing stuff from last commit --- c_utils/c_utils.c | 66 +--------------------------------- c_utils/c_utils.h | 4 --- libsharp/oracle.inc | 2 +- libsharp/planck.make | 2 +- libsharp/sharp.c | 4 +-- libsharp/sharp_acctest.c | 3 +- libsharp/sharp_bench.c | 3 +- libsharp/sharp_complex_hacks.h | 8 ++--- libsharp/sharp_core.c | 6 ++-- libsharp/sharp_core.h | 2 +- libsharp/sharp_test.c | 3 +- libsharp/sharp_vecsupport.h | 8 ++--- libsharp/sharp_vecutil.h | 6 ++-- libsharp/sharp_ylmgen_c.c | 2 +- libsharp/sharp_ylmgen_c.h | 6 ++-- 15 files changed, 30 insertions(+), 95 deletions(-) diff --git a/c_utils/c_utils.c b/c_utils/c_utils.c index d8601e7..96bd765 100644 --- a/c_utils/c_utils.c +++ b/c_utils/c_utils.c @@ -25,21 +25,12 @@ /* * Convenience functions * - * Copyright (C) 2008, 2009, 2010, 2011 Max-Planck-Society + * Copyright (C) 2008, 2009, 2010, 2011, 2012 Max-Planck-Society * Author: Martin Reinecke */ #include -#include -#include #include "c_utils.h" -#include "vec_utils.h" -#ifdef _OPENMP -#include -#endif -#ifdef USE_MPI -#include -#endif void util_fail_ (const char *file, int line, const char *func, const char *msg) { @@ -88,58 +79,3 @@ void *util_malloc_ (size_t sz) void util_free_ (void *ptr) { if ((ptr)!=NULL) free(ptr); } #endif - -static void OpenMP_status(void) - { -#ifndef _OPENMP - printf("OpenMP: not supported by this binary\n"); -#else - int threads = omp_get_max_threads(); - if (threads>1) - printf("OpenMP active: max. %d threads.\n",threads); - else - printf("OpenMP active, but running with 1 thread only.\n"); -#endif - } - -static void MPI_status(void) - { -#ifndef USE_MPI - printf("MPI: not supported by this binary\n"); -#else - int tasks; - MPI_Comm_size(MPI_COMM_WORLD,&tasks); - if (tasks>1) - printf("MPI active with %d tasks.\n",tasks); - else - printf("MPI active, but running with 1 task only.\n"); -#endif - } - -static void vecmath_status(void) - { printf("Supported vector length: %d\n",VLEN); } - -void announce_c (const char *name) - { - size_t m, nlen=strlen(name); - printf("\n+-"); - for (m=0; m #include "ls_fft.h" -#include "ylmgen_c.h" +#include "sharp_ylmgen_c.h" #include "sharp.h" #include "c_utils.h" #include "sharp_core.h" -#include "vec_utils.h" +#include "sharp_vecutil.h" #include "walltime_c.h" typedef complex double dcmplx; diff --git a/libsharp/sharp_acctest.c b/libsharp/sharp_acctest.c index 3f36877..37ee25b 100644 --- a/libsharp/sharp_acctest.c +++ b/libsharp/sharp_acctest.c @@ -38,6 +38,7 @@ #include "sharp_geomhelpers.h" #include "sharp_almhelpers.h" #include "c_utils.h" +#include "sharp_announce.h" #include "sharp_core.h" typedef complex double dcmplx; @@ -183,7 +184,7 @@ int main(void) #ifdef USE_MPI MPI_Init(NULL,NULL); #endif - module_startup_c("sharp_acctest",1,1,"",1); + sharp_module_startup("sharp_acctest",1,1,"",1); int lmax=127; diff --git a/libsharp/sharp_bench.c b/libsharp/sharp_bench.c index 185dc9e..b578b39 100644 --- a/libsharp/sharp_bench.c +++ b/libsharp/sharp_bench.c @@ -36,6 +36,7 @@ #include "sharp_geomhelpers.h" #include "sharp_almhelpers.h" #include "c_utils.h" +#include "sharp_announce.h" #include "sharp_core.h" typedef complex double dcmplx; @@ -94,7 +95,7 @@ int main(void) #ifdef USE_MPI MPI_Init(NULL,NULL); #endif - module_startup_c("sharp_bench",1,1,"",1); + sharp_module_startup("sharp_bench",1,1,"",1); printf("Benchmarking SHTs.\n\n"); FILE *fp=fopen("oracle.inc","w"); diff --git a/libsharp/sharp_complex_hacks.h b/libsharp/sharp_complex_hacks.h index 99a7c2b..d06741e 100644 --- a/libsharp/sharp_complex_hacks.h +++ b/libsharp/sharp_complex_hacks.h @@ -22,19 +22,19 @@ * (DLR). */ -/* \file complex_hacks.h +/* \file sharp_complex_hacks.h * support for converting vector types and complex numbers * * Copyright (C) 2012 Max-Planck-Society * Author: Martin Reinecke */ -#ifndef COMPLEX_HACKS_H -#define COMPLEX_HACKS_H +#ifndef SHARP_COMPLEX_HACKS_H +#define SHARP_COMPLEX_HACKS_H #include #include -#include "vecsupport.h" +#include "sharp_vecsupport.h" #define UNSAFE_CODE diff --git a/libsharp/sharp_core.c b/libsharp/sharp_core.c index ba5cd88..ec02975 100644 --- a/libsharp/sharp_core.c +++ b/libsharp/sharp_core.c @@ -32,9 +32,9 @@ #include #include #include -#include "vecsupport.h" -#include "complex_hacks.h" -#include "ylmgen_c.h" +#include "sharp_vecsupport.h" +#include "sharp_complex_hacks.h" +#include "sharp_ylmgen_c.h" #include "sharp.h" #include "sharp_core.h" #include "c_utils.h" diff --git a/libsharp/sharp_core.h b/libsharp/sharp_core.h index 0699074..38ec41d 100644 --- a/libsharp/sharp_core.h +++ b/libsharp/sharp_core.h @@ -33,7 +33,7 @@ #define PLANCK_SHARP_CORE_H #include "sharp.h" -#include "ylmgen_c.h" +#include "sharp_ylmgen_c.h" #ifdef __cplusplus extern "C" { diff --git a/libsharp/sharp_test.c b/libsharp/sharp_test.c index 6bcd253..bd0fe28 100644 --- a/libsharp/sharp_test.c +++ b/libsharp/sharp_test.c @@ -59,6 +59,7 @@ #include "sharp_geomhelpers.h" #include "sharp_almhelpers.h" #include "c_utils.h" +#include "sharp_announce.h" #include "sharp_core.h" typedef complex double dcmplx; @@ -188,7 +189,7 @@ int main(int argc, char **argv) #ifdef USE_MPI MPI_Init(NULL,NULL); #endif - module_startup_c("sharp_test",argc,7, + sharp_module_startup("sharp_test",argc,7, " ",1); int lmax=atoi(argv[2]); diff --git a/libsharp/sharp_vecsupport.h b/libsharp/sharp_vecsupport.h index ccb9364..0fe7540 100644 --- a/libsharp/sharp_vecsupport.h +++ b/libsharp/sharp_vecsupport.h @@ -22,18 +22,18 @@ * (DLR). */ -/* \file vecsupport.h +/* \file sharp_vecsupport.h * Convenience functions for vector arithmetics * * Copyright (C) 2012 Max-Planck-Society * Author: Martin Reinecke */ -#ifndef VECSUPPORT_H -#define VECSUPPORT_H +#ifndef SHARP_VECSUPPORT_H +#define SHARP_VECSUPPORT_H #include -#include "vec_utils.h" +#include "sharp_vecutil.h" typedef double Ts; diff --git a/libsharp/sharp_vecutil.h b/libsharp/sharp_vecutil.h index 50066f8..5b64c5a 100644 --- a/libsharp/sharp_vecutil.h +++ b/libsharp/sharp_vecutil.h @@ -22,15 +22,15 @@ * (DLR). */ -/*! \file vec_utils.h +/*! \file sharp_vecutil.h * Functionality related to vector instruction support * * Copyright (C) 2012 Max-Planck-Society * \author Martin Reinecke */ -#ifndef PLANCK_VEC_UTILS_H -#define PLANCK_VEC_UTILS_H +#ifndef SHARP_VECUTIL_H +#define SHARP_VECUTIL_H #if (defined (__AVX__) && (!defined (DISABLE_AVX)) && (!defined (DISABLE_SSE2))) #define VLEN 4 diff --git a/libsharp/sharp_ylmgen_c.c b/libsharp/sharp_ylmgen_c.c index e674e63..48a1f7b 100644 --- a/libsharp/sharp_ylmgen_c.c +++ b/libsharp/sharp_ylmgen_c.c @@ -31,7 +31,7 @@ #include #include -#include "ylmgen_c.h" +#include "sharp_ylmgen_c.h" #include "c_utils.h" void Ylmgen_init (Ylmgen_C *gen, int l_max, int m_max, int spin) diff --git a/libsharp/sharp_ylmgen_c.h b/libsharp/sharp_ylmgen_c.h index 6462478..cbfd42c 100644 --- a/libsharp/sharp_ylmgen_c.h +++ b/libsharp/sharp_ylmgen_c.h @@ -22,15 +22,15 @@ * (DLR). */ -/*! \file ylmgen_c.h +/*! \file sharp_ylmgen_c.h * Code for efficient calculation of Y_lm(phi=0,theta) * * Copyright (C) 2005-2012 Max-Planck-Society * \author Martin Reinecke */ -#ifndef PLANCK_YLMGEN_C_H -#define PLANCK_YLMGEN_C_H +#ifndef SHARP_YLMGEN_C_H +#define SHARP_YLMGEN_C_H #ifdef __cplusplus extern "C" {