madgraph5 / madgraph4gpu

GPU development for the Madgraph5_aMC@NLO event generator software package
30 stars 33 forks source link

Determine number of BSM parameters when generating CPPProcess.cc (get rid of MGONGPUCPP_NBSMINDEPPARAM_GT_0) #827

Open valassi opened 6 months ago

valassi commented 6 months ago

Hi @oliviermattelaer this is one issue I mentioned in between lines, but maybe better make an explicit issue.

In Parameters.h from PR #824 I have this code

// AV Jan 2024 (PR #625): this ugly #define was the only way I found to avoid creating arrays[nBsm] in CPPProcess.cc if nBsm is 0
// The problem is that nBsm is determined when generating Parameters.h, which happens after CPPProcess.cc has already been generated
// For simplicity, keep this code hardcoded also for SM processes (a nullptr is needed as in the case nBsm == 0)
#define MGONGPUCPP_NBSMINDEPPARAM_GT_0 1

The comments says it all: in the code generation, I deteremine the "extra BSM parameters" when generating Parameters.h, but I would prefer to know this already when generating CPPProcess.cc, so that some dead code can be removed.

I guess I could understand this myself if I look at the code, but maybe for you it's totally obvious what I need to do?

Thanks Andrea

valassi commented 6 months ago

As mentioned here https://github.com/madgraph5/madgraph4gpu/pull/824#discussion_r1557538324 there is one line of CODEGEN that is an explicit reminder of this issue "# FIXME! Here there should be different code generated depending on MGONGPUCPP_NBSMINDEPPARAM_GT_0"