-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Hi @oliviermattelaer @roiser I am finally about to merge the alphas PR #434.
As one last check, I wanted to check that heft models also work fine - they do not.
I have fixed the simple stuff (like _sm vs _heft suffixes), but there is one fundamental issue: the code to compute the dependent couplings depends itself on several parameters that I had not exported there. See below a full example.
The problem here is quite fundamental, in the sense that normally these parameters are available through the Parameters_sm instance, somehow available through the CPPProcess instanc (things that I think we should review anyway). Anyway, the computation is now part of a device function (host device inline const DependentCouplings_sv computeDependentCouplings_fromG) which can be in a kernel. If all those other parameters must be available in a kernel, one must copy them there to device memory, especially if they are read at runtime from a runcard file. The alternative is that they are taken from somewhere hardcoded in the code (where they are sent at generation time - this is what I did in the HARDCODED ifdef branch, so you see that in the full files I attach these are available.
My question is,
- should we continue supporting reading of runcards at runtime?
- or can we assume (as it is done in the fortran code in one step during the make process) that these end up into a hardcoded code file instead?
The latter solution would considerably simply things.
- In practice, I am asking whether we should use my 'hardcoded' branch as default and drop the runtime reading of runcards. *
This is certainly not a priority, but I raise the issue here for reference. I will merge the alphas PR as is, without support for heft...
Thanks!
Andrea
PS Example from my autogenerated code
namespace Parameters_heft_dependentCouplings
{
constexpr size_t ndcoup = 1; // #couplings that vary event by event because they depend on the running alphas QCD
constexpr size_t idcoup_GC_13 = 0;
struct DependentCouplings_sv
{
cxtype_sv GC_13;
};
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable" // e.g. <<warning: unused variable ‘mdl_G__exp__2’ [-Wunused-variable]>>
#pragma GCC diagnostic ignored "-Wunused-parameter" // e.g. <<warning: unused parameter ‘G’ [-Wunused-parameter]>>
#ifdef __CUDACC__
#pragma nv_diagnostic push
#pragma nv_diag_suppress 177 // e.g. <<warning #177-D: variable "mdl_G__exp__2" was declared but never referenced>>
#endif
__host__ __device__ inline const DependentCouplings_sv computeDependentCouplings_fromG( const fptype_sv& G )
{
// Model parameters dependent on aS
//const fptype_sv mdl_sqrt__aS = sqrtNR( aS );
//const fptype_sv G = 2. * mdl_sqrt__aS * sqrtNR( M_PI );
const fptype_sv mdl_G__exp__2 = ( ( G ) * ( G ) );
const fptype_sv mdl_GH = -( mdl_G__exp__2 * ( 1. + ( 13. * mdl_MH__exp__6 ) / ( 16800. * mdl_MT__exp__6 ) + mdl_MH__exp__4 / ( 168. * mdl_MT__exp__4 ) + ( 7. * mdl_MH__exp__2 ) / ( 120. * mdl_MT__exp__2 ) ) ) / ( 12. * ( ( M_PI ) * ( M_PI ) ) * mdl_v );
const fptype_sv mdl_Gphi = -( mdl_G__exp__2 * ( 1. + mdl_MH__exp__6 / ( 560. * mdl_MT__exp__6 ) + mdl_MH__exp__4 / ( 90. * mdl_MT__exp__4 ) + mdl_MH__exp__2 / ( 12. * mdl_MT__exp__2 ) ) ) / ( 8. * ( ( M_PI ) * ( M_PI ) ) * mdl_v );
// Model couplings dependent on aS
DependentCouplings_sv out;
// FIXME? should this use a model-dependent mdl_complexi instead of a hardcoded cxmake(0,1)?
out.GC_13 = -( cxmake( 0., 1. ) * mdl_GH );
return out;
}
#ifdef __CUDACC__
#pragma GCC diagnostic pop
#pragma nv_diagnostic pop
#endif
}