mirror of
https://github.com/cosmo-sims/monofonIC.git
synced 2024-09-19 17:03:45 +02:00
fix compiler error and warnings in clang
This commit is contained in:
parent
981432269b
commit
d1fc6a2e67
11 changed files with 29 additions and 25 deletions
|
@ -226,7 +226,7 @@ template<typename T >
|
|||
inline void HDFReadSelect( const std::string Filename, const std::string ObjName, const std::vector<unsigned>& ii, std::vector<T> &Data ){
|
||||
|
||||
hid_t HDF_Type, HDF_FileID, HDF_DatasetID, HDF_DataspaceID, HDF_MemspaceID;
|
||||
hsize_t HDF_StorageSize;
|
||||
// hsize_t HDF_StorageSize;
|
||||
|
||||
HDF_Type = GetDataType<T>();
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ public:
|
|||
music::ilog << "Linear growth factors: D+_target = " << Dplus_target_ << ", D+_start = " << Dplus_start_ << std::endl;
|
||||
|
||||
// set up transfer functions and compute normalisation
|
||||
transfer_function_ = std::move(select_TransferFunction_plugin(cf, cosmo_param_));
|
||||
transfer_function_ = select_TransferFunction_plugin(cf, cosmo_param_);
|
||||
transfer_function_->intialise();
|
||||
if( !transfer_function_->tf_isnormalised_ ){
|
||||
cosmo_param_.set("pnorm", this->compute_pnorm_from_sigma8() );
|
||||
|
|
|
@ -175,13 +175,14 @@ struct grid_interpolate
|
|||
|
||||
MPI_Alltoall(&sendcounts[0], 1, MPI_INT, &recvcounts[0], 1, MPI_INT, MPI_COMM_WORLD);
|
||||
|
||||
size_t tot_receive = recvcounts[0], tot_send = sendcounts[0];
|
||||
size_t tot_receive = recvcounts[0];
|
||||
// size_t tot_send = sendcounts[0];
|
||||
for (int i = 1; i < MPI::get_size(); ++i)
|
||||
{
|
||||
sendoffsets[i] = sendcounts[i - 1] + sendoffsets[i - 1];
|
||||
recvoffsets[i] = recvcounts[i - 1] + recvoffsets[i - 1];
|
||||
tot_receive += recvcounts[i];
|
||||
tot_send += sendcounts[i];
|
||||
// tot_send += sendcounts[i];
|
||||
}
|
||||
|
||||
std::vector<vec3> recvbuf(tot_receive/3,{0.,0.,0.});
|
||||
|
|
|
@ -45,12 +45,15 @@ public:
|
|||
: data_(std::move(v.data_)), x(data_[0]), y(data_[1]), z(data_[2]){}
|
||||
|
||||
//! construct vec3_t from initializer list
|
||||
template<typename ...E>
|
||||
vec3_t(E&&...e)
|
||||
: data_{{std::forward<E>(e)...}}, x{data_[0]}, y{data_[1]}, z{data_[2]}
|
||||
{}
|
||||
// vec3_t( T a, T b, T c )
|
||||
// : data_{{a,b,c}}, x(data_[0]), y(data_[1]), z(data_[2]){}
|
||||
// template<typename ...E>
|
||||
// vec3_t(E&&...e)
|
||||
// : data_{{std::forward<E>(e)...}}, x{data_[0]}, y{data_[1]}, z{data_[2]}
|
||||
// {}
|
||||
vec3_t( T a, T b, T c )
|
||||
: data_{{a,b,c}}, x(data_[0]), y(data_[1]), z(data_[2]){}
|
||||
|
||||
explicit vec3_t( T a)
|
||||
: data_{{a,a,a}}, x(data_[0]), y(data_[1]), z(data_[2]){}
|
||||
|
||||
//! bracket index access to vector components
|
||||
T &operator[](size_t i) noexcept{ return data_[i];}
|
||||
|
|
|
@ -421,7 +421,7 @@ private:
|
|||
|
||||
if( !is_in(i,j,k,mat_invrecip) ){
|
||||
auto average_lv = [&]( const auto& t1, const auto& t2, const auto& t3, vec3_t<real_t>& v, vec3_t<real_t>& l ) {
|
||||
v = real_t(0.0); l = real_t(0.0);
|
||||
v = vec3_t<real_t>(0.0); l = vec3_t<real_t>(0.0);
|
||||
int count(0);
|
||||
|
||||
auto add_lv = [&]( auto it ) -> void {
|
||||
|
|
|
@ -62,9 +62,9 @@ std::unique_ptr<cosmology::calculator> the_cosmo_calc;
|
|||
*/
|
||||
int initialise( config_file& the_config )
|
||||
{
|
||||
the_random_number_generator = std::move(select_RNG_plugin(the_config));
|
||||
the_random_number_generator = select_RNG_plugin(the_config);
|
||||
the_cosmo_calc = std::make_unique<cosmology::calculator>(the_config);
|
||||
the_output_plugin = std::move(select_output_plugin(the_config, the_cosmo_calc));
|
||||
the_output_plugin = select_output_plugin(the_config, the_cosmo_calc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -150,12 +150,12 @@ int run( config_file& the_config )
|
|||
//--------------------------------------------------------------------------------------------------------
|
||||
//! add beyond box tidal field modes following Schmidt et al. (2018) [https://arxiv.org/abs/1803.03274]
|
||||
bool bAddExternalTides = the_config.contains_key("cosmology", "LSS_aniso_lx")
|
||||
& the_config.contains_key("cosmology", "LSS_aniso_ly")
|
||||
& the_config.contains_key("cosmology", "LSS_aniso_lz");
|
||||
&& the_config.contains_key("cosmology", "LSS_aniso_ly")
|
||||
&& the_config.contains_key("cosmology", "LSS_aniso_lz");
|
||||
|
||||
if( bAddExternalTides && !( the_config.contains_key("cosmology", "LSS_aniso_lx")
|
||||
| the_config.contains_key("cosmology", "LSS_aniso_ly")
|
||||
| the_config.contains_key("cosmology", "LSS_aniso_lz") ))
|
||||
|| the_config.contains_key("cosmology", "LSS_aniso_ly")
|
||||
|| the_config.contains_key("cosmology", "LSS_aniso_lz") ))
|
||||
{
|
||||
music::elog << "Not all dimensions of LSS_aniso_l{x,y,z} specified! Will ignore external tidal field!" << std::endl;
|
||||
bAddExternalTides = false;
|
||||
|
|
|
@ -74,7 +74,7 @@ std::unique_ptr<output_plugin> select_output_plugin( config_file& cf, std::uniqu
|
|||
music::ilog << std::setw(32) << std::left << "Output plugin" << " : " << formatname << std::endl;
|
||||
}
|
||||
|
||||
return std::move(the_output_plugin_creator->create( cf, pcc ));
|
||||
return the_output_plugin_creator->create( cf, pcc );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ void RNG_music::parse_random_parameters(void)
|
|||
//... generate some dummy seed which only depends on the level, negative so we know it's not
|
||||
//... an actual seed and thus should not be used as a constraint for coarse levels
|
||||
// rngseeds_.push_back( -abs((unsigned)(ltemp-i)%123+(unsigned)(ltemp+827342523521*i)%123456789) );
|
||||
rngseeds_.push_back(-abs((long)(ltemp - i) % 123 + (long)(ltemp + 7342523521 * i) % 123456789));
|
||||
rngseeds_.push_back(-std::abs((long)(ltemp - i) % 123 + (long)(ltemp + 7342523521 * i) % 123456789));
|
||||
else
|
||||
{
|
||||
if (ltemp <= 0)
|
||||
|
|
|
@ -163,7 +163,7 @@ private:
|
|||
music::ilog << "Computing transfer function via ClassEngine..." << std::endl;
|
||||
double wtime = get_wtime();
|
||||
|
||||
the_ClassEngine_ = std::move(std::make_unique<ClassEngine>(pars_, false));
|
||||
the_ClassEngine_ = std::make_unique<ClassEngine>(pars_, false);
|
||||
|
||||
wtime = get_wtime() - wtime;
|
||||
music::ilog << "CLASS took " << wtime << " s." << std::endl;
|
||||
|
|
|
@ -77,5 +77,5 @@ std::unique_ptr<RNG_plugin> select_RNG_plugin(config_file &cf)
|
|||
music::ilog << std::setw(32) << std::left << "Random number generator plugin" << " : " << rngname << std::endl;
|
||||
}
|
||||
|
||||
return std::move(the_RNG_plugin_creator->Create(cf));
|
||||
return the_RNG_plugin_creator->Create(cf);
|
||||
}
|
||||
|
|
|
@ -75,5 +75,5 @@ std::unique_ptr<TransferFunction_plugin> select_TransferFunction_plugin(config_f
|
|||
music::ilog << std::setw(32) << std::left << "Transfer function plugin" << " : " << tfname << std::endl;
|
||||
}
|
||||
|
||||
return std::move(the_TransferFunction_plugin_creator->create(cf, cosmo_param));
|
||||
return the_TransferFunction_plugin_creator->create(cf, cosmo_param);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue