Commit 6ee4f249 authored by Stefan Hoeche's avatar Stefan Hoeche

svn merge -r28525:29216 ^/branches/rel-2-2-0_anl_d2

(excluding simple mets scale)
parent e7c85977
......@@ -380,6 +380,7 @@ void Single_Virtual_Correction::SetLookUp(const bool lookup)
{
m_lookup=lookup;
if (p_LO_process) p_LO_process->SetLookUp(lookup);
if (p_loopme && lookup==0) p_loopme->SwitchMode(lookup);
}
void Single_Virtual_Correction::Minimize()
......
......@@ -49,6 +49,7 @@ namespace OpenLoops {
std::string OpenLoops_Interface::s_olprefix = std::string("");
bool OpenLoops_Interface::s_ignore_model = false;
bool OpenLoops_Interface::s_exit_on_error= true;
std::vector<std::string> OpenLoops_Interface::s_evgen_params;
OpenLoops_Interface::~OpenLoops_Interface()
{
......@@ -109,9 +110,13 @@ namespace OpenLoops {
#endif
// set remaining OL parameters specified by user
reader.VectorFromFile(s_evgen_params,"OL_PARAMETERS");
for (size_t i=1; i<s_evgen_params.size(); i=i+2)
SetParameter(s_evgen_params[i-1], s_evgen_params[i]);
vector<string> parameters;
reader.VectorFromFile(parameters,"OL_PARAMETERS");
for (size_t i=1; i<parameters.size(); i=i+2) SetParameter(parameters[i-1], parameters[i]);
if (reader.VectorFromFile(parameters,"OL_INTEGRATION_PARAMETERS"))
for (size_t i=1; i<parameters.size(); i=i+2)
SetParameter(parameters[i-1], parameters[i]);
char welcomestr[GetIntParameter("welcome_length")];
ol_welcome(welcomestr);
......@@ -191,6 +196,12 @@ namespace OpenLoops {
SetParameter(it->first, it->second);
}
void OpenLoops_Interface::SwitchMode(const int mode)
{
for (size_t i=1; i<s_evgen_params.size(); i=i+2)
SetParameter(s_evgen_params[i-1], s_evgen_params[i]);
}
int OpenLoops_Interface::RegisterProcess(const Subprocess_Info& is,
const Subprocess_Info& fs,
int amptype)
......
......@@ -20,6 +20,7 @@ namespace OpenLoops {
static std::string s_olprefix;
static bool s_ignore_model;
static bool s_exit_on_error;
static std::vector<std::string> s_evgen_params;
public :
OpenLoops_Interface() : ME_Generator_Base("OpenLoops") {}
......@@ -30,6 +31,8 @@ namespace OpenLoops {
BEAM::Beam_Spectra_Handler *const beam,
PDF::ISR_Handler *const isr);
static void SwitchMode(const int mode);
static int RegisterProcess(const PHASIC::Subprocess_Info& is,
const PHASIC::Subprocess_Info& fs,
int amptype);
......
......@@ -22,6 +22,11 @@ OpenLoops_Virtual::OpenLoops_Virtual(const Process_Info& pi,
{
}
void OpenLoops_Virtual::SwitchMode(const int mode)
{
OpenLoops_Interface::SwitchMode(mode);
}
void OpenLoops_Virtual::Calc(const Vec4D_Vector& momenta) {
OpenLoops_Interface::SetParameter("alpha", AlphaQED());
......
......@@ -18,6 +18,8 @@ namespace OpenLoops {
~OpenLoops_Virtual() {}
void SwitchMode(const int mode);
inline bool SetColours(const ATOOLS::Vec4D_Vector& momenta) {
return true;
}
......
......@@ -689,4 +689,5 @@ void COMIX::Single_Process::SetLookUp(const bool lookup)
static_cast<Single_Dipole_Term*>
((*subs)[i]->p_proc)->SetLookUp(m_lookup);
}
if (p_loop && lookup==0) p_loop->SwitchMode(lookup);
}
......@@ -339,7 +339,7 @@ double ISR_Handler::PDFWeight(const int mode,Vec4D p1,Vec4D p2,
<<p1.PPlus()<<" / "<<p_beam[0]->
OutMomentum().PPlus()<<" = "<<x1<<std::endl;
msg_IODebugging()<<" "<<p2<<" from "<<p_beam[1]->OutMomentum()<<" -> "
<<p2.PPlus()<<" / "<<p_beam[1]->
<<p2.PMinus()<<" / "<<p_beam[1]->
OutMomentum().PMinus()<<" = "<<x2<<std::endl;
if (PDF(0) && (Q12<PDF(0)->Q2Min() || Q12>PDF(0)->Q2Max())) {
msg_IODebugging()<<" Q_1^2 out of bounds"<<std::endl;
......
......@@ -41,6 +41,10 @@ Phase_Space_Integrator::Phase_Space_Integrator(Phase_Space_Handler *_psh):
else msg_Info()<<METHOD<<"(): Set n_{maxopt} = "<<maxopt<<".\n";
if (!read.ReadFromFile(ndecopt,"PSI_NDECOPT")) ndecopt=10;
else msg_Info()<<METHOD<<"(): Set n_{opt,dec} = "<<ndecopt<<".\n";
if (!read.ReadFromFile(timestep,"PSI_TIMESTEP_OFFSET")) timestep=0.0;
else msg_Info()<<METHOD<<"(): Set \\Delta t offset = "<<timestep<<".\n";
if (!read.ReadFromFile(timeslope,"PSI_TIMESTEP_SLOPE")) timeslope=0.0;
else msg_Info()<<METHOD<<"(): Set \\Delta t slope = "<<timeslope<<".\n";
addtime=0.0;
lastrss=0;
#ifdef USING__MPI
......@@ -134,16 +138,12 @@ double Phase_Space_Integrator::Calculate(double _maxerror, double _maxabserror,
#endif
addtime = 0.0;
#if (defined USING__Threading)
rlotime = rstarttime = ATOOLS::rpa->gen.Timer().RealTime();
#endif
lotime = starttime = ATOOLS::rpa->gen.Timer().UserTime();
stepstart = lotime = starttime = ATOOLS::rpa->gen.Timer().RealTime();
if (psh->Stats().size()>0)
addtime=psh->Stats().back()[6];
nstep = ncstep = 0;
lrtime = ATOOLS::rpa->gen.Timer().RealTime();
optiter=iter;
#ifdef USING__MPI
int size = MPI::COMM_WORLD.Get_size();
......@@ -194,7 +194,11 @@ bool Phase_Space_Integrator::AddPoint(const double value)
#else
ncontrib = psh->FSRIntegrator()->ValidN();
#endif
if ( ncontrib!=nlo && ncontrib>0 && ((ncontrib%optiter)==0)) {
double deltat, targettime=timestep+dabs(timeslope)*(psh->Process()->NOut()-2);
if (timeslope<0.0) targettime*=psh->Process()->Process()->Size();
if (timestep>0.0) deltat = ATOOLS::rpa->gen.Timer().RealTime()-stepstart;
if ((timestep==0.0 && ncontrib!=nlo && ncontrib>0 && ((ncontrib%optiter)==0)) ||
(timestep>0.0 && deltat>=targettime)) {
MPISync();
bool optimized=false;
bool fotime = false;
......@@ -204,10 +208,7 @@ bool Phase_Space_Integrator::AddPoint(const double value)
if (ncontrib%iter1==0) {
(psh->Process())->OptimizeResult();
if ((psh->Process())->SPoints()==0) {
#if (defined USING__Threading)
rlotime = ATOOLS::rpa->gen.Timer().RealTime();
#endif
lotime = ATOOLS::rpa->gen.Timer().UserTime();
lotime = ATOOLS::rpa->gen.Timer().RealTime();
}
}
fotime = true;
......@@ -223,36 +224,20 @@ bool Phase_Space_Integrator::AddPoint(const double value)
(psh->Process())->ResetMax(1);
(psh->Process())->InitWeightHistogram();
(psh->Process())->EndOptimize();
#if (defined USING__Threading)
rlotime = ATOOLS::rpa->gen.Timer().RealTime();
#endif
lotime = ATOOLS::rpa->gen.Timer().UserTime();
lotime = ATOOLS::rpa->gen.Timer().RealTime();
}
#if (defined USING__Threading)
double rtime = ATOOLS::rpa->gen.Timer().RealTime();
double rtimeest=0.;
rtimeest = (5*iter0+(nopt-5)*iter1+2*maxopt*iter1)/double(ncontrib)*(rtime-rstarttime);
#endif
double time = ATOOLS::rpa->gen.Timer().UserTime();
double time = ATOOLS::rpa->gen.Timer().RealTime();
double timeest=0.;
timeest = (5*iter0+(nopt-5)*iter1+2*maxopt*iter1)/double(ncontrib)*(time-starttime);
if (!fotime) {
if (fin_opt==1) {
timeest = ATOOLS::Max(timeest,(psh->Process())->RemainTimeFactor(maxerror)*
(time-lotime)+lotime-starttime);
#if (defined USING__Threading)
rtimeest = ATOOLS::Max(rtimeest,(psh->Process())->RemainTimeFactor(maxerror)*
(rtime-rlotime)+rlotime-rstarttime);
#endif
}
else {
timeest = (psh->Process())->RemainTimeFactor(maxerror)*
(time-lotime)+lotime-starttime;
#if (defined USING__Threading)
rtimeest = (psh->Process())->RemainTimeFactor(maxerror)*
(rtime-rlotime)+rlotime-rstarttime;
#endif
}
}
double error=dabs(psh->Process()->TotalVar()/psh->Process()->TotalResult());
......@@ -268,19 +253,9 @@ bool Phase_Space_Integrator::AddPoint(const double value)
msg_Info()<<"full optimization: ";
}
else msg_Info()<<"integration time: ";
#if (defined USING__Threading)
msg_Info()<<" ( "<<FormatTime(size_t(rtime-rstarttime+0.5))<<" ("
<<FormatTime(size_t(time-starttime+0.5))<<") elapsed / "
<<FormatTime(size_t(rtimeest+0.5)
-size_t((rtime-rstarttime+0.5)))<<" ("
<<FormatTime(size_t(timeest+0.5)
-size_t((time-starttime+0.5)))
<<") left ) ["<<rpa->gen.Timer().StrFTime("%H:%M:%S")<<"] "<<endl;
#else
msg_Info()<<" ( "<<FormatTime(size_t(time-starttime))<<" elapsed / "
<<FormatTime(size_t(timeest)-size_t((time-starttime)))
<<" left ) ["<<rpa->gen.Timer().StrFTime("%H:%M:%S")<<"] "<<endl;
#endif
size_t currentrss=GetCurrentRSS();
if (lastrss==0) lastrss=currentrss;
else if (currentrss>lastrss+ToType<int>
......@@ -309,6 +284,7 @@ bool Phase_Space_Integrator::AddPoint(const double value)
if (MPI::COMM_WORLD.Get_rank()==0) optiter+=iter-(iter/size)*size;
#endif
}
stepstart=ATOOLS::rpa->gen.Timer().RealTime();
bool wannabreak = dabs(error)<maxerror ||
dabs(psh->Process()->TotalVar()*rpa->Picobarn())<maxabserror;
if (fin_opt==0 && nopt>psh->Stats().size() && wannabreak) nopt=psh->Stats().size();
......
......@@ -14,7 +14,7 @@ namespace PHASIC {
static long unsigned int nmax;
double starttime, lotime, addtime, lrtime;
double value, maxerror, maxabserror, rstarttime, rlotime;
double value, maxerror, maxabserror, stepstart, timestep, timeslope;
long unsigned int n, ncontrib, maxopt, nlo, fin_opt, nstep, ncstep;
long int mn, mnstep, mncstep;
size_t lastrss;
......
......@@ -23,6 +23,10 @@ Virtual_ME2_Base::~Virtual_ME2_Base()
{
}
void Virtual_ME2_Base::SwitchMode(const int mode)
{
}
double Virtual_ME2_Base::Eps_Scheme_Factor(const ATOOLS::Vec4D_Vector& mom)
{
//MSbar
......
......@@ -22,6 +22,8 @@ namespace PHASIC {
const ATOOLS::Flavour_Vector& flavs);
virtual ~Virtual_ME2_Base();
virtual void SwitchMode(const int mode=0);
virtual void Calc(const ATOOLS::Vec4D_Vector& momenta)=0;
inline const METOOLS::DivArrD& Result() { return m_res; }
......
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