Commit 61d0b356 authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

correction cas engine=0

parent b51375cf
...@@ -4,7 +4,7 @@ use class * ...@@ -4,7 +4,7 @@ use class *
#compiler options #compiler options
#default is gcc here are the C++ compiler options #default is gcc here are the C++ compiler options
macro cppflags " -O2 -pipe -fPIC -Wall -Wno-reorder -Wno-sign-compare -Wno-unknown-pragmas -g" macro cppflags " -O3 -pipe -fPIC -Wall -Wno-reorder -Wno-sign-compare -Wno-unknown-pragmas -g"
#do we need optimzations here? #do we need optimzations here?
#macro_append cppflags "-ffast-math -m64 " #macro_append cppflags "-ffast-math -m64 "
......
...@@ -51,3 +51,5 @@ precisionFile=class_pre/hpjul2.pre ...@@ -51,3 +51,5 @@ precisionFile=class_pre/hpjul2.pre
#CMB #CMB
HiLLiPOP=HiLLiPOP/DX11dHM_superExt_CO_TT.lik HiLLiPOP=HiLLiPOP/DX11dHM_superExt_CO_TT.lik
verbose=true
...@@ -86,36 +86,25 @@ Chi2Combiner::chi2_eff(const std::vector<double>& par) const { ...@@ -86,36 +86,25 @@ Chi2Combiner::chi2_eff(const std::vector<double>& par) const {
copy(par.begin(),par.end(),ostream_iterator<double>(os,"\t")); copy(par.begin(),par.end(),ostream_iterator<double>(os,"\t"));
} }
self->OK=true;
if (engine){
#pragma omp critical #pragma omp critical
{ self->OK=engine->updateParValues(par);
if (engine){
self->OK=engine->updateParValues(par);
if (!OK) {
//A TUNER!!!!!!!!!!!!!1
chi2=chi2_prev*10.;
self->iter++;
}
if(verbose)
{
os << "0\t" << chi2 << "\t" << timer->partial();
cout << os.str() << endl;
}
return chi2;
}
} }
//loop update chi2 observables
#pragma omp parallel
{
int i;
#pragma omp for schedule(static)
for (i=0;i<obs.size();i++) chi2+=(*(obs[i]))(par);
//update chi2 observables
if (OK){
#pragma omp parallel for schedule(static)
for (size_t i=0;i<obs.size();i++) chi2+=(*(obs[i]))(par);
} }
else {
chi2=chi2_prev*10.;
}
if(verbose){ if(verbose){
os << fixed << setprecision(3) ; os << fixed << setprecision(3) ;
os << "1\t" << chi2 << "\t" << timer->partial(); os << (int)OK << "\t" << chi2 << "\t" << timer->partial();
cout << os.str() << endl; cout << os.str() << endl;
} }
self->iter++; self->iter++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment