From 71d5ed4d7c61f7a7ec96578b39fa51a75316de4e Mon Sep 17 00:00:00 2001 From: Martin Reinecke Date: Wed, 4 Jul 2012 13:59:25 +0200 Subject: [PATCH] some renaming ... try to make libsharp play well with libpsht --- libsharp/sharp_announce.c | 98 +++++++++++++++++++ libsharp/sharp_announce.h | 39 ++++++++ ...{complex_hacks.h => sharp_complex_hacks.h} | 0 libsharp/{vecsupport.h => sharp_vecsupport.h} | 0 .../vec_utils.h => libsharp/sharp_vecutil.h | 0 libsharp/{ylmgen_c.c => sharp_ylmgen_c.c} | 0 libsharp/{ylmgen_c.h => sharp_ylmgen_c.h} | 0 7 files changed, 137 insertions(+) create mode 100644 libsharp/sharp_announce.c create mode 100644 libsharp/sharp_announce.h rename libsharp/{complex_hacks.h => sharp_complex_hacks.h} (100%) rename libsharp/{vecsupport.h => sharp_vecsupport.h} (100%) rename c_utils/vec_utils.h => libsharp/sharp_vecutil.h (100%) rename libsharp/{ylmgen_c.c => sharp_ylmgen_c.c} (100%) rename libsharp/{ylmgen_c.h => sharp_ylmgen_c.h} (100%) diff --git a/libsharp/sharp_announce.c b/libsharp/sharp_announce.c new file mode 100644 index 0000000..bc6ee50 --- /dev/null +++ b/libsharp/sharp_announce.c @@ -0,0 +1,98 @@ +/* + * 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 + * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt + * (DLR). + */ + +/*! \file sharp_announce.c + * Banner for module startup + * + * Copyright (C) 2012 Max-Planck-Society + * \author Martin Reinecke + */ + +#include +#include +#include +#ifdef _OPENMP +#include +#endif +#ifdef USE_MPI +#include +#endif + +#include "sharp_announce.h" +#include "sharp_vecutil.h" + +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 sharp_announce (const char *name) + { + size_t m, nlen=strlen(name); + printf("\n+-"); + for (m=0; m