mirror of
https://github.com/cosmo-sims/MUSIC.git
synced 2024-09-19 17:03:46 +02:00
Fixed some stuff that caused intel c++ compiler warnings
This commit is contained in:
parent
5d3b66e96a
commit
506b882893
11 changed files with 29 additions and 28 deletions
4
Makefile
4
Makefile
|
@ -1,6 +1,6 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
### compile time configuration options
|
### compile time configuration options
|
||||||
MULTITHREADFFTW = yes
|
MULTITHREADFFTW = no
|
||||||
SINGLEPRECISION = no
|
SINGLEPRECISION = no
|
||||||
HAVEHDF5 = yes
|
HAVEHDF5 = yes
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ HAVEHDF5 = yes
|
||||||
### compiler and path settings
|
### compiler and path settings
|
||||||
CC = g++
|
CC = g++
|
||||||
OPT = -O3 -msse2
|
OPT = -O3 -msse2
|
||||||
CFLAGS = -Wall -fopenmp
|
CFLAGS = -fopenmp
|
||||||
LFLAGS = -fopenmp -lgsl -lgslcblas
|
LFLAGS = -fopenmp -lgsl -lgslcblas
|
||||||
CPATHS = -I. -I$(HOME)/local/include -I/opt/local/include -I/usr/local/include
|
CPATHS = -I. -I$(HOME)/local/include -I/opt/local/include -I/usr/local/include
|
||||||
LPATHS = -L$(HOME)/local/lib -L/opt/local/lib -L/usr/local/lib
|
LPATHS = -L$(HOME)/local/lib -L/opt/local/lib -L/usr/local/lib
|
||||||
|
|
|
@ -129,7 +129,7 @@ public:
|
||||||
|
|
||||||
h=xx[khi]-xx[klo];
|
h=xx[khi]-xx[klo];
|
||||||
|
|
||||||
if (h == 0.0) throw("Bad input to routine splint");
|
if (fabs(h) < 1e-10) throw("Bad input to routine splint");
|
||||||
|
|
||||||
a=(xx[khi]-x)/h;
|
a=(xx[khi]-x)/h;
|
||||||
b=(x-xx[klo])/h;
|
b=(x-xx[klo])/h;
|
||||||
|
|
|
@ -53,11 +53,11 @@ public:
|
||||||
{
|
{
|
||||||
char temp1[128];
|
char temp1[128];
|
||||||
std::string temp2;
|
std::string temp2;
|
||||||
sprintf(temp1,"constraint[%d]",i);
|
sprintf(temp1,"constraint[%u]",i);
|
||||||
if( cf.containsKey( "constraints", temp1 ) )
|
if( cf.containsKey( "constraints", temp1 ) )
|
||||||
{
|
{
|
||||||
temp2 = cf.getValue<std::string>( "constraints", temp1 );
|
temp2 = cf.getValue<std::string>( "constraints", temp1 );
|
||||||
sscanf( temp2.c_str(), "%f,%f,%f,%d,%f", &tf0, &tf1, &tf2, &ti, &tf3 );
|
sscanf( temp2.c_str(), "%f,%f,%f,%u,%f", &tf0, &tf1, &tf2, &ti, &tf3 );
|
||||||
constraint new_c;
|
constraint new_c;
|
||||||
new_c.x = tf0;
|
new_c.x = tf0;
|
||||||
new_c.y = tf1;
|
new_c.y = tf1;
|
||||||
|
|
|
@ -225,14 +225,14 @@ namespace convolution{
|
||||||
rrr[2] = rr[2]+(double)kkk*0.5*dx - 0.25*dx;
|
rrr[2] = rr[2]+(double)kkk*0.5*dx - 0.25*dx;
|
||||||
rrr2[2]= rrr[2]*rrr[2];
|
rrr2[2]= rrr[2]*rrr[2];
|
||||||
rr2 = rrr2[0]+rrr2[1]+rrr2[2];
|
rr2 = rrr2[0]+rrr2[1]+rrr2[2];
|
||||||
kdata_[idx] += tfr->compute_real(rr2)/rf8;
|
kdata_[idx] += (fftw_real)(tfr->compute_real(rr2)/rf8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
rr2 = rr[0]*rr[0]+rr[1]*rr[1]+rr[2]*rr[2];
|
rr2 = rr[0]*rr[0]+rr[1]*rr[1]+rr[2]*rr[2];
|
||||||
kdata_[idx] += tfr->compute_real(rr2);
|
kdata_[idx] += (fftw_real)tfr->compute_real(rr2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,14 +275,14 @@ namespace convolution{
|
||||||
rrr[2] = rr[2]+(double)kkk*0.5*dx - 0.25*dx;
|
rrr[2] = rr[2]+(double)kkk*0.5*dx - 0.25*dx;
|
||||||
rrr2[2]= rrr[2]*rrr[2];
|
rrr2[2]= rrr[2]*rrr[2];
|
||||||
rr2 = rrr2[0]+rrr2[1]+rrr2[2];
|
rr2 = rrr2[0]+rrr2[1]+rrr2[2];
|
||||||
kdata_[idx] += tfr->compute_real(rr2)/rf8;
|
kdata_[idx] += (fftw_real)(tfr->compute_real(rr2)/rf8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
rr2 = rr[0]*rr[0]+rr[1]*rr[1]+rr[2]*rr[2];
|
rr2 = rr[0]*rr[0]+rr[1]*rr[1]+rr[2]*rr[2];
|
||||||
kdata_[idx] += tfr->compute_real(rr2);
|
kdata_[idx] += (fftw_real)tfr->compute_real(rr2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -477,7 +477,8 @@ namespace convolution{
|
||||||
|
|
||||||
delete tfk;
|
delete tfk;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace{
|
namespace{
|
||||||
convolution::kernel_creator_concrete< convolution::kernel_real<double> > creator_d("tf_kernel_real_double");
|
convolution::kernel_creator_concrete< convolution::kernel_real<double> > creator_d("tf_kernel_real_double");
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace convolution{
|
||||||
template< typename real_t >
|
template< typename real_t >
|
||||||
void perform( kernel* pk, void *pd );
|
void perform( kernel* pk, void *pd );
|
||||||
|
|
||||||
}; //namespace convolution
|
} //namespace convolution
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -433,7 +433,7 @@ public:
|
||||||
PaddedDensitySubGrid( int ox, int oy, int oz, unsigned nx, unsigned ny, unsigned nz)
|
PaddedDensitySubGrid( int ox, int oy, int oz, unsigned nx, unsigned ny, unsigned nz)
|
||||||
: DensityGrid<real_t>(2*nx,2*ny,2*nz), ox_(ox), oy_(oy), oz_(oz)
|
: DensityGrid<real_t>(2*nx,2*ny,2*nz), ox_(ox), oy_(oy), oz_(oz)
|
||||||
{
|
{
|
||||||
if( ox-nx/4 < 0 || oy-ny/4 < 0 || oz-nz/4 < 0 )
|
if( ox-(int)nx/4 < 0 || oy-(int)ny/4 < 0 || oz-(int)nz/4 < 0 )
|
||||||
throw std::runtime_error("subgrid extends across top grid");
|
throw std::runtime_error("subgrid extends across top grid");
|
||||||
|
|
||||||
//.. the size in top grid cells is nx/2,ny/2,nz/2, so padding starts at ox-nx/4...
|
//.. the size in top grid cells is nx/2,ny/2,nz/2, so padding starts at ox-nx/4...
|
||||||
|
|
8
mesh.hh
8
mesh.hh
|
@ -868,7 +868,7 @@ class refinement_hierarchy
|
||||||
unsigned levelmin_, levelmax_, padding_;
|
unsigned levelmin_, levelmax_, padding_;
|
||||||
config_file& cf_;
|
config_file& cf_;
|
||||||
bool align_top_;
|
bool align_top_;
|
||||||
float x0ref_[3], lxref_[3];
|
double x0ref_[3], lxref_[3];
|
||||||
int xshift_[3];
|
int xshift_[3];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -894,10 +894,10 @@ public:
|
||||||
std::string temp;
|
std::string temp;
|
||||||
|
|
||||||
temp = cf_.getValue<std::string>( "setup", "ref_offset" );
|
temp = cf_.getValue<std::string>( "setup", "ref_offset" );
|
||||||
sscanf( temp.c_str(), "%g,%g,%g", &x0ref_[0], &x0ref_[1], &x0ref_[2] );
|
sscanf( temp.c_str(), "%lf,%lf,%lf", &x0ref_[0], &x0ref_[1], &x0ref_[2] );
|
||||||
|
|
||||||
temp = cf_.getValue<std::string>( "setup", "ref_extent" );
|
temp = cf_.getValue<std::string>( "setup", "ref_extent" );
|
||||||
sscanf( temp.c_str(), "%g,%g,%g", &lxref_[0],&lxref_[1],&lxref_[2] );
|
sscanf( temp.c_str(), "%lf,%lf,%lf", &lxref_[0],&lxref_[1],&lxref_[2] );
|
||||||
|
|
||||||
unsigned ncoarse = (unsigned)pow(2,levelmin_);
|
unsigned ncoarse = (unsigned)pow(2,levelmin_);
|
||||||
|
|
||||||
|
@ -1133,7 +1133,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( old_levelmin != levelmin_ )
|
if( old_levelmin != levelmin_ & print)
|
||||||
std::cerr << " - refinement_hierarchy: set new levelmin to " << levelmin_ << std::endl;
|
std::cerr << " - refinement_hierarchy: set new levelmin to " << levelmin_ << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ public:
|
||||||
inline void prolong( m1& V, m2& v, int oxc, int oyc, int ozc, int oxf, int oyf, int ozf, int R ) const
|
inline void prolong( m1& V, m2& v, int oxc, int oyc, int ozc, int oxf, int oyf, int ozf, int R ) const
|
||||||
{
|
{
|
||||||
int N = (int)pow(2,R);
|
int N = (int)pow(2,R);
|
||||||
int Nl= -N/2+1, Nr=N/2;
|
int Nl= -N/2+1;//, Nr=N/2;
|
||||||
double dx = 1.0/(double)N;
|
double dx = 1.0/(double)N;
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
//... subtract the mean difference caused by interpolation
|
//... subtract the mean difference caused by interpolation
|
||||||
double dmean = coarsemean-finemean;
|
//double dmean = coarsemean-finemean;
|
||||||
|
|
||||||
/*#pragma omp parallel for
|
/*#pragma omp parallel for
|
||||||
for( int i=0; i<nx; ++i )
|
for( int i=0; i<nx; ++i )
|
||||||
|
@ -172,7 +172,7 @@ public:
|
||||||
inline void prolong_add( m1& V, m2& v, int oxc, int oyc, int ozc, int oxf, int oyf, int ozf, int R ) const
|
inline void prolong_add( m1& V, m2& v, int oxc, int oyc, int ozc, int oxf, int oyf, int ozf, int R ) const
|
||||||
{
|
{
|
||||||
int N = (int)pow(2,R);
|
int N = (int)pow(2,R);
|
||||||
int Nl= -N/2+1, Nr=N/2;
|
int Nl= -N/2+1;//, Nr=N/2;
|
||||||
double dx = 1.0/(double)N;
|
double dx = 1.0/(double)N;
|
||||||
|
|
||||||
int nx = v.size(0), ny = v.size(1), nz = v.size(2);
|
int nx = v.size(0), ny = v.size(1), nz = v.size(2);
|
||||||
|
@ -213,7 +213,7 @@ public:
|
||||||
coarsemean /= coarsecount;
|
coarsemean /= coarsecount;
|
||||||
finemean /= finecount;
|
finemean /= finecount;
|
||||||
|
|
||||||
double dmean = coarsemean-finemean;
|
//double dmean = coarsemean-finemean;
|
||||||
|
|
||||||
/*//... subtract the mean difference caused by interpolation
|
/*//... subtract the mean difference caused by interpolation
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
|
@ -243,14 +243,14 @@ public:
|
||||||
inline double interp_cubic( int x, int y, int z, M& V, double s=1.0 ) const
|
inline double interp_cubic( int x, int y, int z, M& V, double s=1.0 ) const
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
double dx, dy, dz;
|
//double dx, dy, dz;
|
||||||
double u[4], v[4], w[4];
|
double u[4], v[4], w[4];
|
||||||
double r[4], q[4];
|
double r[4], q[4];
|
||||||
double vox = 0;
|
double vox = 0;
|
||||||
|
|
||||||
dx = 0.5*((double)sz - 0.5)*s;
|
//dx = 0.5*((double)sz - 0.5)*s;
|
||||||
dy = 0.5*((double)sy - 0.5)*s;
|
//dy = 0.5*((double)sy - 0.5)*s;
|
||||||
dz = 0.5*((double)sx - 0.5)*s;
|
//dz = 0.5*((double)sx - 0.5)*s;
|
||||||
|
|
||||||
if( sz == 1 )
|
if( sz == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,7 +73,7 @@ protected:
|
||||||
char str[128];
|
char str[128];
|
||||||
for( unsigned i=levelmin_; i<=levelmax_; ++i )
|
for( unsigned i=levelmin_; i<=levelmax_; ++i )
|
||||||
{
|
{
|
||||||
sprintf( str, "%s(%d,%d)", name.c_str(), i, icomp );
|
sprintf( str, "%s(%u,%d)", name.c_str(), i, icomp );
|
||||||
*oit = cf_.getValue<unsigned>( "setup", str );
|
*oit = cf_.getValue<unsigned>( "setup", str );
|
||||||
++oit;
|
++oit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -434,7 +434,7 @@ public:
|
||||||
if( nx!=res_ || ny!=res_ || nz!=res_ )
|
if( nx!=res_ || ny!=res_ || nz!=res_ )
|
||||||
{
|
{
|
||||||
char errmsg[128];
|
char errmsg[128];
|
||||||
sprintf(errmsg,"White noise file dimensions do not match level dimensions: %dx%dx%d vs. %d**3",nx,ny,nz,res_);
|
sprintf(errmsg,"White noise file dimensions do not match level dimensions: %ux%ux%u vs. %u**3",nx,ny,nz,res_);
|
||||||
throw std::runtime_error(errmsg);
|
throw std::runtime_error(errmsg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,11 +305,11 @@ protected:
|
||||||
out[i].re = cu.real();
|
out[i].re = cu.real();
|
||||||
out[i].im = cu.imag();
|
out[i].im = cu.imag();
|
||||||
|
|
||||||
if( (out[i].re != out[i].re)||(out[i].im != out[i].im) )
|
/*if( (out[i].re != out[i].re)||(out[i].im != out[i].im) )
|
||||||
{ std::cerr << "NaN @ i=" << i << ", U= " << U << ", phase = " << phase << ", g1 = " << g1 << ", g2 = " << g2 << std::endl;
|
{ std::cerr << "NaN @ i=" << i << ", U= " << U << ", phase = " << phase << ", g1 = " << g1 << ", g2 = " << g2 << std::endl;
|
||||||
std::cerr << "mu+1+q = " << mu+1.0+q << std::endl;
|
std::cerr << "mu+1+q = " << mu+1.0+q << std::endl;
|
||||||
//break;
|
//break;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue