janitorial work

This commit is contained in:
Martin Reinecke 2013-01-03 15:48:52 +01:00
parent 1d4823bfd2
commit 8bcc26a9f9
7 changed files with 26 additions and 24 deletions

View file

@ -14,7 +14,7 @@ LIBOBJ:=$(LIBOBJ:%=$(OD)/%)
ALLOBJ:=$(ALLOBJ:%=$(OD)/%) ALLOBJ:=$(ALLOBJ:%=$(OD)/%)
ODEP:=$(HDR_$(PKG)) $(HDR_libfftpack) $(HDR_c_utils) ODEP:=$(HDR_$(PKG)) $(HDR_libfftpack) $(HDR_c_utils)
$(OD)/sharp_core.o: $(SD)/sharp_inchelper1.inc.c $(SD)/sharp_core_inc.c $(SD)/sharp_core_inc4.c $(OD)/sharp_core.o: $(SD)/sharp_core_inchelper.c $(SD)/sharp_core_inc.c $(SD)/sharp_core_inc2.c
$(OD)/sharp.o: $(SD)/sharp_mpi.c $(OD)/sharp.o: $(SD)/sharp_mpi.c
BDEP:=$(LIB_$(PKG)) $(LIB_libfftpack) $(LIB_c_utils) BDEP:=$(LIB_$(PKG)) $(LIB_libfftpack) $(LIB_c_utils)

View file

@ -50,27 +50,27 @@ typedef complex double dcmplx;
#define CONCAT3(a,b,c) XCONCAT3(a,b,c) #define CONCAT3(a,b,c) XCONCAT3(a,b,c)
#define nvec 1 #define nvec 1
#include "sharp_inchelper1.inc.c" #include "sharp_core_inchelper.c"
#undef nvec #undef nvec
#define nvec 2 #define nvec 2
#include "sharp_inchelper1.inc.c" #include "sharp_core_inchelper.c"
#undef nvec #undef nvec
#define nvec 3 #define nvec 3
#include "sharp_inchelper1.inc.c" #include "sharp_core_inchelper.c"
#undef nvec #undef nvec
#define nvec 4 #define nvec 4
#include "sharp_inchelper1.inc.c" #include "sharp_core_inchelper.c"
#undef nvec #undef nvec
#define nvec 5 #define nvec 5
#include "sharp_inchelper1.inc.c" #include "sharp_core_inchelper.c"
#undef nvec #undef nvec
#define nvec 6 #define nvec 6
#include "sharp_inchelper1.inc.c" #include "sharp_core_inchelper.c"
#undef nvec #undef nvec
void inner_loop (sharp_job *job, const int *ispair,const double *cth, void inner_loop (sharp_job *job, const int *ispair,const double *cth,

View file

@ -70,7 +70,7 @@ static inline Tb Y(Tbprod)(Tb a, Tb b)
static inline void Y(Tbmuleq)(Tb * restrict a, Tb b) static inline void Y(Tbmuleq)(Tb * restrict a, Tb b)
{ for (int i=0; i<nvec; ++i) vmuleq(a->v[i],b.v[i]); } { for (int i=0; i<nvec; ++i) vmuleq(a->v[i],b.v[i]); }
static inline void Y(Tbnormalize) (Tb * restrict val, Tb * restrict scale, static void Y(Tbnormalize) (Tb * restrict val, Tb * restrict scale,
double maxval) double maxval)
{ {
const Tv vfsmall=vload(sharp_fsmall), vfbig=vload(sharp_fbig); const Tv vfsmall=vload(sharp_fsmall), vfbig=vload(sharp_fbig);
@ -94,7 +94,7 @@ static inline void Y(Tbnormalize) (Tb * restrict val, Tb * restrict scale,
} }
} }
static inline void Y(mypow) (Tb val, int npow, Tb * restrict resd, static void Y(mypow) (Tb val, int npow, Tb * restrict resd,
Tb * restrict ress) Tb * restrict ress)
{ {
Tb scale=Y(Tbconst)(0.), scaleint=Y(Tbconst)(0.), res=Y(Tbconst)(1.); Tb scale=Y(Tbconst)(0.), scaleint=Y(Tbconst)(0.), res=Y(Tbconst)(1.);
@ -168,7 +168,7 @@ static inline int Y(TballGe)(Tb a,double b)
return vallTrue(res); return vallTrue(res);
} }
static inline void Y(getCorfac)(Tb scale, Tb * restrict corfac, static void Y(getCorfac)(Tb scale, Tb * restrict corfac,
const double * restrict cf) const double * restrict cf)
{ {
Y(Tbu) sc, corf; Y(Tbu) sc, corf;

View file

@ -22,7 +22,7 @@
* (DLR). * (DLR).
*/ */
/*! \file sharp_core_inc4.c /*! \file sharp_core_inc2.c
* Type-dependent code for the computational core * Type-dependent code for the computational core
* *
* Copyright (C) 2012 Max-Planck-Society * Copyright (C) 2012 Max-Planck-Society

View file

@ -3,10 +3,10 @@
#include "sharp_core_inc.c" #include "sharp_core_inc.c"
#if (SHARP_MAXTRANS>MAXJOB_SPECIAL) #if (SHARP_MAXTRANS>MAXJOB_SPECIAL)
#define NJ1 ,int njobs #define NJ1 , int njobs
#define NJ2 , njobs #define NJ2 , njobs
#define Z(arg) CONCAT2(arg,nvec) #define Z(arg) CONCAT2(arg,nvec)
#include "sharp_core_inc4.c" #include "sharp_core_inc2.c"
#undef Z #undef Z
#undef NJ1 #undef NJ1
#undef NJ2 #undef NJ2
@ -18,7 +18,7 @@
#if ((MAXJOB_SPECIAL>=1)&&(SHARP_MAXTRANS>=1)) #if ((MAXJOB_SPECIAL>=1)&&(SHARP_MAXTRANS>=1))
#define njobs 1 #define njobs 1
#define Z(arg) CONCAT3(arg,nvec,njobs) #define Z(arg) CONCAT3(arg,nvec,njobs)
#include "sharp_core_inc4.c" #include "sharp_core_inc2.c"
#undef Z #undef Z
#undef njobs #undef njobs
#endif #endif
@ -26,7 +26,7 @@
#if ((MAXJOB_SPECIAL>=2)&&(SHARP_MAXTRANS>=2)) #if ((MAXJOB_SPECIAL>=2)&&(SHARP_MAXTRANS>=2))
#define njobs 2 #define njobs 2
#define Z(arg) CONCAT3(arg,nvec,njobs) #define Z(arg) CONCAT3(arg,nvec,njobs)
#include "sharp_core_inc4.c" #include "sharp_core_inc2.c"
#undef Z #undef Z
#undef njobs #undef njobs
#endif #endif
@ -34,7 +34,7 @@
#if ((MAXJOB_SPECIAL>=3)&&(SHARP_MAXTRANS>=3)) #if ((MAXJOB_SPECIAL>=3)&&(SHARP_MAXTRANS>=3))
#define njobs 3 #define njobs 3
#define Z(arg) CONCAT3(arg,nvec,njobs) #define Z(arg) CONCAT3(arg,nvec,njobs)
#include "sharp_core_inc4.c" #include "sharp_core_inc2.c"
#undef Z #undef Z
#undef njobs #undef njobs
#endif #endif
@ -42,7 +42,7 @@
#if ((MAXJOB_SPECIAL>=4)&&(SHARP_MAXTRANS>=4)) #if ((MAXJOB_SPECIAL>=4)&&(SHARP_MAXTRANS>=4))
#define njobs 4 #define njobs 4
#define Z(arg) CONCAT3(arg,nvec,njobs) #define Z(arg) CONCAT3(arg,nvec,njobs)
#include "sharp_core_inc4.c" #include "sharp_core_inc2.c"
#undef Z #undef Z
#undef njobs #undef njobs
#endif #endif
@ -50,7 +50,7 @@
#if ((MAXJOB_SPECIAL>=5)&&(SHARP_MAXTRANS>=5)) #if ((MAXJOB_SPECIAL>=5)&&(SHARP_MAXTRANS>=5))
#define njobs 5 #define njobs 5
#define Z(arg) CONCAT3(arg,nvec,njobs) #define Z(arg) CONCAT3(arg,nvec,njobs)
#include "sharp_core_inc4.c" #include "sharp_core_inc2.c"
#undef Z #undef Z
#undef njobs #undef njobs
#endif #endif
@ -58,7 +58,7 @@
#if ((MAXJOB_SPECIAL>=6)&&(SHARP_MAXTRANS>=6)) #if ((MAXJOB_SPECIAL>=6)&&(SHARP_MAXTRANS>=6))
#define njobs 6 #define njobs 6
#define Z(arg) CONCAT3(arg,nvec,njobs) #define Z(arg) CONCAT3(arg,nvec,njobs)
#include "sharp_core_inc4.c" #include "sharp_core_inc2.c"
#undef Z #undef Z
#undef njobs #undef njobs
#endif #endif

View file

@ -79,7 +79,8 @@ void sharp_make_gauss_geom_info (int nrings, int nphi, double phi0,
void sharp_make_fejer1_geom_info (int nrings, int nphi, double phi0, void sharp_make_fejer1_geom_info (int nrings, int nphi, double phi0,
int stride_lon, int stride_lat, sharp_geom_info **geom_info); int stride_lon, int stride_lat, sharp_geom_info **geom_info);
/*! Old name for sharp_make_fejer1_geom_info() */ /*! Old name for sharp_make_fejer1_geom_info()
\ingroup geominfogroup */
static inline void sharp_make_ecp_geom_info (int nrings, int nphi, double phi0, static inline void sharp_make_ecp_geom_info (int nrings, int nphi, double phi0,
int stride_lon, int stride_lat, sharp_geom_info **geom_info) int stride_lon, int stride_lat, sharp_geom_info **geom_info)
{ {

View file

@ -154,11 +154,12 @@ static void get_errors (dcmplx **alm, ptrdiff_t nalms, int ncomp, double *sqsum,
double sum=0, maxdiff=0, sumtot, sqsumtot, maxdifftot; double sum=0, maxdiff=0, sumtot, sqsumtot, maxdifftot;
for (ptrdiff_t j=0; j<nalms; ++j) for (ptrdiff_t j=0; j<nalms; ++j)
{ {
sum+=creal(alm[i][j])*creal(alm[i][j]) double sqr=creal(alm[i][j])*creal(alm[i][j])
+cimag(alm[i][j])*cimag(alm[i][j]); +cimag(alm[i][j])*cimag(alm[i][j]);
if (fabs(creal(alm[i][j]))>maxdiff) maxdiff=fabs(creal(alm[i][j])); sum+=sqr;
if (fabs(cimag(alm[i][j]))>maxdiff) maxdiff=fabs(cimag(alm[i][j])); if (sqr>maxdiff) maxdiff=sqr;
} }
maxdiff=sqrt(maxdiff);
#ifdef USE_MPI #ifdef USE_MPI
MPI_Allreduce(&sum,&sumtot,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); MPI_Allreduce(&sum,&sumtot,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD);