missing stuff from last commit
This commit is contained in:
parent
71d5ed4d7c
commit
39cf1ee90b
15 changed files with 30 additions and 95 deletions
|
@ -25,21 +25,12 @@
|
||||||
/*
|
/*
|
||||||
* Convenience functions
|
* Convenience functions
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008, 2009, 2010, 2011 Max-Planck-Society
|
* Copyright (C) 2008, 2009, 2010, 2011, 2012 Max-Planck-Society
|
||||||
* Author: Martin Reinecke
|
* Author: Martin Reinecke
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "c_utils.h"
|
#include "c_utils.h"
|
||||||
#include "vec_utils.h"
|
|
||||||
#ifdef _OPENMP
|
|
||||||
#include <omp.h>
|
|
||||||
#endif
|
|
||||||
#ifdef USE_MPI
|
|
||||||
#include <mpi.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void util_fail_ (const char *file, int line, const char *func, const char *msg)
|
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)
|
void util_free_ (void *ptr)
|
||||||
{ if ((ptr)!=NULL) free(ptr); }
|
{ if ((ptr)!=NULL) free(ptr); }
|
||||||
#endif
|
#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<nlen; ++m) printf("-");
|
|
||||||
printf("-+\n");
|
|
||||||
printf("| %s |\n", name);
|
|
||||||
printf("+-");
|
|
||||||
for (m=0; m<nlen; ++m) printf("-");
|
|
||||||
printf("-+\n\n");
|
|
||||||
vecmath_status();
|
|
||||||
OpenMP_status();
|
|
||||||
MPI_status();
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void module_startup_c (const char *name, int argc, int argc_expected,
|
|
||||||
const char *argv_expected, int verbose)
|
|
||||||
{
|
|
||||||
if (verbose) announce_c (name);
|
|
||||||
if (argc==argc_expected) return;
|
|
||||||
if (verbose) fprintf(stderr, "Usage: %s %s\n", name, argv_expected);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
|
@ -46,10 +46,6 @@ void util_warn_ (const char *file, int line, const char *func, const char *msg);
|
||||||
void *util_malloc_ (size_t sz);
|
void *util_malloc_ (size_t sz);
|
||||||
void util_free_ (void *ptr);
|
void util_free_ (void *ptr);
|
||||||
|
|
||||||
void announce_c (const char *name);
|
|
||||||
void module_startup_c (const char *name, int argc, int argc_expected,
|
|
||||||
const char *argv_expected, int verbose);
|
|
||||||
|
|
||||||
#if defined (__GNUC__)
|
#if defined (__GNUC__)
|
||||||
#define UTIL_FUNC_NAME__ __func__
|
#define UTIL_FUNC_NAME__ __func__
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -2,7 +2,7 @@ static const int maxtr = 6;
|
||||||
static const int nv_opt[6][2][3] = {
|
static const int nv_opt[6][2][3] = {
|
||||||
{{4,2,-1},{2,1,-1}},
|
{{4,2,-1},{2,1,-1}},
|
||||||
{{4,2,-1},{2,1,-1}},
|
{{4,2,-1},{2,1,-1}},
|
||||||
{{5,2,-1},{5,2,-1}},
|
{{5,2,-1},{5,1,-1}},
|
||||||
{{5,2,-1},{5,2,-1}},
|
{{5,2,-1},{5,2,-1}},
|
||||||
{{5,2,-1},{5,2,-1}},
|
{{5,2,-1},{5,2,-1}},
|
||||||
{{5,2,-1},{5,2,-1}}
|
{{5,2,-1},{5,2,-1}}
|
||||||
|
|
|
@ -8,7 +8,7 @@ FULL_INCLUDE+= -I$(SD)
|
||||||
HDR_$(PKG):=$(SD)/*.h
|
HDR_$(PKG):=$(SD)/*.h
|
||||||
LIB_$(PKG):=$(LIBDIR)/libsharp.a
|
LIB_$(PKG):=$(LIBDIR)/libsharp.a
|
||||||
BIN:=sharp_test sharp_acctest sharp_test_mpi sharp_bench
|
BIN:=sharp_test sharp_acctest sharp_test_mpi sharp_bench
|
||||||
LIBOBJ:=ylmgen_c.o sharp.o sharp_geomhelpers.o sharp_almhelpers.o sharp_core.o
|
LIBOBJ:=sharp_ylmgen_c.o sharp.o sharp_announce.o sharp_geomhelpers.o sharp_almhelpers.o sharp_core.o
|
||||||
ALLOBJ:=$(LIBOBJ) sharp_test.o sharp_acctest.o sharp_test_mpi.o sharp_bench.o
|
ALLOBJ:=$(LIBOBJ) sharp_test.o sharp_acctest.o sharp_test_mpi.o sharp_bench.o
|
||||||
LIBOBJ:=$(LIBOBJ:%=$(OD)/%)
|
LIBOBJ:=$(LIBOBJ:%=$(OD)/%)
|
||||||
ALLOBJ:=$(ALLOBJ:%=$(OD)/%)
|
ALLOBJ:=$(ALLOBJ:%=$(OD)/%)
|
||||||
|
|
|
@ -31,11 +31,11 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "ls_fft.h"
|
#include "ls_fft.h"
|
||||||
#include "ylmgen_c.h"
|
#include "sharp_ylmgen_c.h"
|
||||||
#include "sharp.h"
|
#include "sharp.h"
|
||||||
#include "c_utils.h"
|
#include "c_utils.h"
|
||||||
#include "sharp_core.h"
|
#include "sharp_core.h"
|
||||||
#include "vec_utils.h"
|
#include "sharp_vecutil.h"
|
||||||
#include "walltime_c.h"
|
#include "walltime_c.h"
|
||||||
|
|
||||||
typedef complex double dcmplx;
|
typedef complex double dcmplx;
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include "sharp_geomhelpers.h"
|
#include "sharp_geomhelpers.h"
|
||||||
#include "sharp_almhelpers.h"
|
#include "sharp_almhelpers.h"
|
||||||
#include "c_utils.h"
|
#include "c_utils.h"
|
||||||
|
#include "sharp_announce.h"
|
||||||
#include "sharp_core.h"
|
#include "sharp_core.h"
|
||||||
|
|
||||||
typedef complex double dcmplx;
|
typedef complex double dcmplx;
|
||||||
|
@ -183,7 +184,7 @@ int main(void)
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
MPI_Init(NULL,NULL);
|
MPI_Init(NULL,NULL);
|
||||||
#endif
|
#endif
|
||||||
module_startup_c("sharp_acctest",1,1,"",1);
|
sharp_module_startup("sharp_acctest",1,1,"",1);
|
||||||
|
|
||||||
int lmax=127;
|
int lmax=127;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "sharp_geomhelpers.h"
|
#include "sharp_geomhelpers.h"
|
||||||
#include "sharp_almhelpers.h"
|
#include "sharp_almhelpers.h"
|
||||||
#include "c_utils.h"
|
#include "c_utils.h"
|
||||||
|
#include "sharp_announce.h"
|
||||||
#include "sharp_core.h"
|
#include "sharp_core.h"
|
||||||
|
|
||||||
typedef complex double dcmplx;
|
typedef complex double dcmplx;
|
||||||
|
@ -94,7 +95,7 @@ int main(void)
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
MPI_Init(NULL,NULL);
|
MPI_Init(NULL,NULL);
|
||||||
#endif
|
#endif
|
||||||
module_startup_c("sharp_bench",1,1,"",1);
|
sharp_module_startup("sharp_bench",1,1,"",1);
|
||||||
|
|
||||||
printf("Benchmarking SHTs.\n\n");
|
printf("Benchmarking SHTs.\n\n");
|
||||||
FILE *fp=fopen("oracle.inc","w");
|
FILE *fp=fopen("oracle.inc","w");
|
||||||
|
|
|
@ -22,19 +22,19 @@
|
||||||
* (DLR).
|
* (DLR).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* \file complex_hacks.h
|
/* \file sharp_complex_hacks.h
|
||||||
* support for converting vector types and complex numbers
|
* support for converting vector types and complex numbers
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Max-Planck-Society
|
* Copyright (C) 2012 Max-Planck-Society
|
||||||
* Author: Martin Reinecke
|
* Author: Martin Reinecke
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMPLEX_HACKS_H
|
#ifndef SHARP_COMPLEX_HACKS_H
|
||||||
#define COMPLEX_HACKS_H
|
#define SHARP_COMPLEX_HACKS_H
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include "vecsupport.h"
|
#include "sharp_vecsupport.h"
|
||||||
|
|
||||||
#define UNSAFE_CODE
|
#define UNSAFE_CODE
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,9 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "vecsupport.h"
|
#include "sharp_vecsupport.h"
|
||||||
#include "complex_hacks.h"
|
#include "sharp_complex_hacks.h"
|
||||||
#include "ylmgen_c.h"
|
#include "sharp_ylmgen_c.h"
|
||||||
#include "sharp.h"
|
#include "sharp.h"
|
||||||
#include "sharp_core.h"
|
#include "sharp_core.h"
|
||||||
#include "c_utils.h"
|
#include "c_utils.h"
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#define PLANCK_SHARP_CORE_H
|
#define PLANCK_SHARP_CORE_H
|
||||||
|
|
||||||
#include "sharp.h"
|
#include "sharp.h"
|
||||||
#include "ylmgen_c.h"
|
#include "sharp_ylmgen_c.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
#include "sharp_geomhelpers.h"
|
#include "sharp_geomhelpers.h"
|
||||||
#include "sharp_almhelpers.h"
|
#include "sharp_almhelpers.h"
|
||||||
#include "c_utils.h"
|
#include "c_utils.h"
|
||||||
|
#include "sharp_announce.h"
|
||||||
#include "sharp_core.h"
|
#include "sharp_core.h"
|
||||||
|
|
||||||
typedef complex double dcmplx;
|
typedef complex double dcmplx;
|
||||||
|
@ -188,7 +189,7 @@ int main(int argc, char **argv)
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
MPI_Init(NULL,NULL);
|
MPI_Init(NULL,NULL);
|
||||||
#endif
|
#endif
|
||||||
module_startup_c("sharp_test",argc,7,
|
sharp_module_startup("sharp_test",argc,7,
|
||||||
"<healpix|ecp|gauss> <lmax> <nside|nphi> <niter> <spin> <ntrans>",1);
|
"<healpix|ecp|gauss> <lmax> <nside|nphi> <niter> <spin> <ntrans>",1);
|
||||||
|
|
||||||
int lmax=atoi(argv[2]);
|
int lmax=atoi(argv[2]);
|
||||||
|
|
|
@ -22,18 +22,18 @@
|
||||||
* (DLR).
|
* (DLR).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* \file vecsupport.h
|
/* \file sharp_vecsupport.h
|
||||||
* Convenience functions for vector arithmetics
|
* Convenience functions for vector arithmetics
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Max-Planck-Society
|
* Copyright (C) 2012 Max-Planck-Society
|
||||||
* Author: Martin Reinecke
|
* Author: Martin Reinecke
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef VECSUPPORT_H
|
#ifndef SHARP_VECSUPPORT_H
|
||||||
#define VECSUPPORT_H
|
#define SHARP_VECSUPPORT_H
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "vec_utils.h"
|
#include "sharp_vecutil.h"
|
||||||
|
|
||||||
typedef double Ts;
|
typedef double Ts;
|
||||||
|
|
||||||
|
|
|
@ -22,15 +22,15 @@
|
||||||
* (DLR).
|
* (DLR).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \file vec_utils.h
|
/*! \file sharp_vecutil.h
|
||||||
* Functionality related to vector instruction support
|
* Functionality related to vector instruction support
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Max-Planck-Society
|
* Copyright (C) 2012 Max-Planck-Society
|
||||||
* \author Martin Reinecke
|
* \author Martin Reinecke
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PLANCK_VEC_UTILS_H
|
#ifndef SHARP_VECUTIL_H
|
||||||
#define PLANCK_VEC_UTILS_H
|
#define SHARP_VECUTIL_H
|
||||||
|
|
||||||
#if (defined (__AVX__) && (!defined (DISABLE_AVX)) && (!defined (DISABLE_SSE2)))
|
#if (defined (__AVX__) && (!defined (DISABLE_AVX)) && (!defined (DISABLE_SSE2)))
|
||||||
#define VLEN 4
|
#define VLEN 4
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "ylmgen_c.h"
|
#include "sharp_ylmgen_c.h"
|
||||||
#include "c_utils.h"
|
#include "c_utils.h"
|
||||||
|
|
||||||
void Ylmgen_init (Ylmgen_C *gen, int l_max, int m_max, int spin)
|
void Ylmgen_init (Ylmgen_C *gen, int l_max, int m_max, int spin)
|
||||||
|
|
|
@ -22,15 +22,15 @@
|
||||||
* (DLR).
|
* (DLR).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \file ylmgen_c.h
|
/*! \file sharp_ylmgen_c.h
|
||||||
* Code for efficient calculation of Y_lm(phi=0,theta)
|
* Code for efficient calculation of Y_lm(phi=0,theta)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005-2012 Max-Planck-Society
|
* Copyright (C) 2005-2012 Max-Planck-Society
|
||||||
* \author Martin Reinecke
|
* \author Martin Reinecke
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PLANCK_YLMGEN_C_H
|
#ifndef SHARP_YLMGEN_C_H
|
||||||
#define PLANCK_YLMGEN_C_H
|
#define SHARP_YLMGEN_C_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue