Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion MG5aMC/mg5amcnlo
Submodule mg5amcnlo updated 694 files
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ namespace mg5amcCpu
* @param selcol the pointer to the output selected colors
* @param goodHelOnly quit after computing good helicities?
*/
void gpu_sequence( const FORTRANFPTYPE* momenta, const FORTRANFPTYPE* gs, const FORTRANFPTYPE* rndhel, const FORTRANFPTYPE* rndcol, const unsigned int* channelIds, FORTRANFPTYPE* mes, int* selhel, int* selcol, const bool goodHelOnly = false );
void gpu_sequence( const FORTRANFPTYPE* momenta, const FORTRANFPTYPE* gs, const FORTRANFPTYPE* rndhel, const FORTRANFPTYPE* rndcol, const unsigned int* channelIds, const int* igraph, FORTRANFPTYPE* mes, int* selhel, int* selcol, const bool goodHelOnly = false );
#else
/**
* Sequence to be executed for the vectorized CPU matrix element calculation
Expand All @@ -143,7 +143,7 @@ namespace mg5amcCpu
* @param selcol the pointer to the output selected colors
* @param goodHelOnly quit after computing good helicities?
*/
void cpu_sequence( const FORTRANFPTYPE* momenta, const FORTRANFPTYPE* gs, const FORTRANFPTYPE* rndhel, const FORTRANFPTYPE* rndcol, const unsigned int* channelIds, FORTRANFPTYPE* mes, int* selhel, int* selcol, const bool goodHelOnly = false );
void cpu_sequence( const FORTRANFPTYPE* momenta, const FORTRANFPTYPE* gs, const FORTRANFPTYPE* rndhel, const FORTRANFPTYPE* rndcol, const unsigned int* channelIds, const int* igraph, FORTRANFPTYPE* mes, int* selhel, int* selcol, const bool goodHelOnly = false );
#endif

// Return the number of good helicities (-1 initially when they have not yet
Expand Down Expand Up @@ -343,6 +343,7 @@ paramCard; #endif
const FORTRANFPTYPE* rndhel,
const FORTRANFPTYPE* rndcol,
const unsigned int* channelIds,
const int* igraph,
FORTRANFPTYPE* mes,
int* selhel,
int* selcol,
Expand Down Expand Up @@ -394,6 +395,7 @@ paramCard; #endif
"Bridge gpu_sequence: computeGoodHelicities returned nGoodHel<0" );
}
if( goodHelOnly ) return;
m_pmek->setigraph( igraph );
m_pmek->computeMatrixElements( useChannelIds );
copyHostFromDevice( m_hstMEs, m_devMEs );
#ifdef MGONGPUCPP_VERBOSE
Expand Down Expand Up @@ -423,6 +425,7 @@ paramCard; #endif
const FORTRANFPTYPE* rndhel,
const FORTRANFPTYPE* rndcol,
const unsigned int* channelIds,
const int* igraph,
FORTRANFPTYPE* mes,
int* selhel,
int* selcol,
Expand Down Expand Up @@ -454,6 +457,7 @@ paramCard; #endif
"Bridge cpu_sequence: computeGoodHelicities returned nGoodHel<0" );
}
if( goodHelOnly ) return;
m_pmek->setigraph( igraph );
m_pmek->computeMatrixElements( useChannelIds );
#ifdef MGONGPUCPP_VERBOSE
flagAbnormalMEs( m_hstMEs.data(), m_nevt );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace mg5amcCpu
{
constexpr bool goodHelOnly = true;
constexpr unsigned int* pChannelIds = nullptr; // disable multi-channel for helicity filtering
m_bridge.cpu_sequence( m_fortranMomenta.data(), m_gs.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), goodHelOnly );
m_bridge.cpu_sequence( m_fortranMomenta.data(), m_gs.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, nullptr, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), goodHelOnly );
return m_bridge.nGoodHel();
}

Expand All @@ -90,7 +90,7 @@ namespace mg5amcCpu
{
constexpr bool goodHelOnly = false;
const unsigned int* pChannelIds = ( useChannelIds ? m_channelIds.data() : nullptr );
m_bridge.cpu_sequence( m_fortranMomenta.data(), m_gs.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), goodHelOnly );
m_bridge.cpu_sequence( m_fortranMomenta.data(), m_gs.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_igraph, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), goodHelOnly );
}

//--------------------------------------------------------------------------
Expand Down Expand Up @@ -139,7 +139,7 @@ namespace mg5amcGpu
{
constexpr bool goodHelOnly = true;
constexpr unsigned int* pChannelIds = nullptr; // disable multi-channel for helicity filtering
m_bridge.gpu_sequence( m_fortranMomenta.data(), m_gs.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), goodHelOnly );
m_bridge.gpu_sequence( m_fortranMomenta.data(), m_gs.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, nullptr, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), goodHelOnly );
return m_bridge.nGoodHel();
}

Expand All @@ -149,7 +149,7 @@ namespace mg5amcGpu
{
constexpr bool goodHelOnly = false;
const unsigned int* pChannelIds = ( useChannelIds ? m_channelIds.data() : nullptr );
m_bridge.gpu_sequence( m_fortranMomenta.data(), m_gs.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), goodHelOnly );
m_bridge.gpu_sequence( m_fortranMomenta.data(), m_gs.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_igraph, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), goodHelOnly );
}

//--------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ namespace mg5amcCpu
computeDependentCouplings( m_gs.data(), m_couplings.data(), m_gs.size() );
#ifdef MGONGPU_SUPPORTS_MULTICHANNEL
const unsigned int* pChannelIds = ( useChannelIds ? m_channelIds.data() : nullptr );
sigmaKin( m_momenta.data(), m_couplings.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), m_numerators.data(), m_denominators.data(), nevt() );
sigmaKin( m_momenta.data(), m_couplings.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_igraph, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), m_numerators.data(), m_denominators.data(), nevt() );
#else
assert( useChannelIds == false );
sigmaKin( m_momenta.data(), m_couplings.data(), m_rndhel.data(), m_matrixElements.data(), m_selhel.data(), nevt() );
Expand Down Expand Up @@ -504,7 +504,7 @@ namespace mg5amcGpu
#endif
#ifdef MGONGPU_SUPPORTS_MULTICHANNEL
const unsigned int* pChannelIds = ( useChannelIds ? m_channelIds.data() : nullptr );
sigmaKin( m_momenta.data(), m_couplings.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), m_colJamp2s.data(), m_pHelNumerators->data(), m_pHelDenominators->data(), m_pHelMEs->data(), m_pHelJamps->data(), ghelAllBlasTmp, pBlasHandle, m_helStreams, m_gpublocks, m_gputhreads );
sigmaKin( m_momenta.data(), m_couplings.data(), m_rndhel.data(), m_rndcol.data(), pChannelIds, m_igraph, m_matrixElements.data(), m_selhel.data(), m_selcol.data(), m_colJamp2s.data(), m_pHelNumerators->data(), m_pHelDenominators->data(), m_pHelMEs->data(), m_pHelJamps->data(), ghelAllBlasTmp, pBlasHandle, m_helStreams, m_gpublocks, m_gputhreads );
#else
assert( useChannelIds == false );
sigmaKin( m_momenta.data(), m_couplings.data(), m_rndhel.data(), m_matrixElements.data(), m_selhel.data(), m_pHelMEs->data(), m_pHelJamps->data(), ghelAllBlasTmp, pBlasHandle, m_helStreams, m_gpublocks, m_gputhreads );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ namespace mg5amcCpu
// Compute good helicities (returns nGoodHel, the number of good helicity combinations out of ncomb)
virtual int computeGoodHelicities() = 0;

// Set the per-event MLM graph array (nullptr = no MLM matching; must be called before computeMatrixElements if needed)
void setigraph( const int* igraph ) { m_igraph = igraph; }

// Compute matrix elements
virtual void computeMatrixElements( const bool useChannelIds ) = 0;

Expand Down Expand Up @@ -84,6 +87,9 @@ namespace mg5amcCpu
// The buffer for the channel ids for single-diagram enhancement
const BufferChannelIds& m_channelIds;

// The per-event MLM graph array (nullptr = no MLM; set via setigraph before computeMatrixElements)
const int* m_igraph = nullptr;

// The buffer for the output matrix elements
BufferMatrixElements& m_matrixElements;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ endif
# Create file with the resolved backend in case user chooses 'cppauto'
BACKEND_LOG ?= .resolved-backend
ifneq ($(BACKEND_ORIG),$(BACKEND))
$(file >$(BACKEND_LOG),$(BACKEND))
$(shell echo '$(BACKEND)' >> $(BACKEND_LOG))
endif
#-------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ extern "C"
const FORTRANFPTYPE* rndhel,
const FORTRANFPTYPE* rndcol,
const unsigned int* channelIds,
const int* igraph,
FORTRANFPTYPE* mes,
int* selhel,
int* selcol,
Expand All @@ -102,11 +103,11 @@ extern "C"
#ifdef MGONGPUCPP_GPUIMPL
// Use the device/GPU implementation in the CUDA library
// (there is also a host implementation in this library)
pbridge->gpu_sequence( momenta, gs, rndhel, rndcol, channelIds, mes, selhel, selcol, *pgoodHelOnly );
pbridge->gpu_sequence( momenta, gs, rndhel, rndcol, channelIds, igraph, mes, selhel, selcol, *pgoodHelOnly );
#else
// Use the host/CPU implementation in the C++ library
// (there is no device implementation in this library)
pbridge->cpu_sequence( momenta, gs, rndhel, rndcol, channelIds, mes, selhel, selcol, *pgoodHelOnly );
pbridge->cpu_sequence( momenta, gs, rndhel, rndcol, channelIds, igraph, mes, selhel, selcol, *pgoodHelOnly );
#endif
}

Expand All @@ -129,13 +130,14 @@ extern "C"
const FORTRANFPTYPE* gs,
const FORTRANFPTYPE* rndhel,
const FORTRANFPTYPE* rndcol,
const int* igraph,
FORTRANFPTYPE* mes,
int* selhel,
int* selcol,
const bool* pgoodHelOnly )
{
//printf("fbridgesequence_nomultichannel_ goodHelOnly=%d\n", ( *pgoodHelOnly ? 1 : 0 ) );
fbridgesequence_( ppbridge, momenta, gs, rndhel, rndcol, nullptr, mes, selhel, selcol, pgoodHelOnly );
fbridgesequence_( ppbridge, momenta, gs, rndhel, rndcol, nullptr, igraph, mes, selhel, selcol, pgoodHelOnly );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extern "C"
const FORTRANFPTYPE* rndhel,
const FORTRANFPTYPE* rndcol,
const unsigned int* channelIds,
const int* igraph,
FORTRANFPTYPE* mes,
int* selhel,
int* selcol,
Expand All @@ -39,11 +40,12 @@ extern "C"
const FORTRANFPTYPE* gs,
const FORTRANFPTYPE* rndhel,
const FORTRANFPTYPE* rndcol,
const int* igraph,
FORTRANFPTYPE* mes,
int* selhel,
int* selcol,
const bool* pgoodHelOnly );

void fbridgegetngoodhel_( CppObjectInFortran** ppbridge, unsigned int* pngoodhel, unsigned int* pntothel );
}
#endif // _FBRIDGE_H_
#endif // _FBRIDGE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,23 @@ C - GS: the input Gs (running QCD coupling constant alphas) Fortran array
C - RNDHEL: the input random number Fortran array for helicity selection
C - RNDCOL: the input random number Fortran array for color selection
C - CHANID: the input array of channels (Feynman diagrams) to enhance
C - IGRAPH: the input per-event MLM graph array (0 = no MLM graph)
C - MES: the output matrix element Fortran array
C - SELHEL: the output selected helicity Fortran array
C - SELCOL: the output selected color Fortran array
C - HELONLY: input flag, quit after computing good helicities?
C
INTERFACE
SUBROUTINE FBRIDGESEQUENCE(PBRIDGE, MOMENTA, GS,
& RNDHEL, RNDCOL, CHANID, MES, SELHEL, SELCOL, HELONLY)
& RNDHEL, RNDCOL, CHANID, IGRAPH, MES, SELHEL, SELCOL,
& HELONLY)
INTEGER*8 PBRIDGE
DOUBLE PRECISION MOMENTA(*)
DOUBLE PRECISION GS(*)
DOUBLE PRECISION RNDHEL(*)
DOUBLE PRECISION RNDCOL(*)
INTEGER*4 CHANID(*)
INTEGER*4 IGRAPH(*)
DOUBLE PRECISION MES(*)
INTEGER*4 SELHEL(*)
INTEGER*4 SELCOL(*)
Expand All @@ -65,19 +68,21 @@ C - MOMENTA: the input 4-momenta Fortran array
C - GS: the input Gs (running QCD coupling constant alphas) Fortran array
C - RNDHEL: the input random number Fortran array for helicity selection
C - RNDCOL: the input random number Fortran array for color selection
C - IGRAPH: the input per-event MLM graph array (0 = no MLM graph)
C - MES: the output matrix element Fortran array
C - SELHEL: the output selected helicity Fortran array
C - SELCOL: the output selected color Fortran array
C - HELONLY: input flag, quit after computing good helicities?
C
INTERFACE
SUBROUTINE FBRIDGESEQUENCE_NOMULTICHANNEL(PBRIDGE, MOMENTA, GS,
& RNDHEL, RNDCOL, MES, SELHEL, SELCOL, HELONLY)
& RNDHEL, RNDCOL, IGRAPH, MES, SELHEL, SELCOL, HELONLY)
INTEGER*8 PBRIDGE
DOUBLE PRECISION MOMENTA(*)
DOUBLE PRECISION GS(*)
DOUBLE PRECISION RNDHEL(*)
DOUBLE PRECISION RNDCOL(*)
INTEGER*4 IGRAPH(*)
DOUBLE PRECISION MES(*)
INTEGER*4 SELHEL(*)
INTEGER*4 SELCOL(*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ PROGRAM FCHECK_SA
DOUBLE PRECISION RNDHEL(NEVTMAX) ! not yet used
DOUBLE PRECISION RNDCOL(NEVTMAX) ! not yet used
DOUBLE PRECISION MES(NEVTMAX)
INTEGER*4 IGRAPH(NEVTMAX) ! per-event MLM graph (0 = no MLM)
INTEGER*4 SELHEL(NEVTMAX) ! not yet used
INTEGER*4 SELCOL(NEVTMAX) ! not yet used
DOUBLE PRECISION MES_SUM ! use REAL*16 for quadruple precision
Expand Down Expand Up @@ -62,8 +63,9 @@ PROGRAM FCHECK_SA
DO IEVT = 1, NEVT
GS(IEVT) = 1.2177157847767195 ! fixed G for aS=0.118 (hardcoded for now in check_sa.cc, fcheck_sa.f, runTest.cc)
END DO
IGRAPH(:) = 0 ! no MLM graph matching in standalone check
CALL FBRIDGESEQUENCE_NOMULTICHANNEL(BRIDGE, MOMENTA, GS, ! TEMPORARY? disable multi-channel in fcheck.exe and fgcheck.exe #466
& RNDHEL, RNDCOL, MES, SELHEL, SELCOL, .FALSE.) ! do not quit after computing helicities
& RNDHEL, RNDCOL, IGRAPH, MES, SELHEL, SELCOL, .FALSE.) ! do not quit after computing helicities
DO IEVT = 1, NEVT
c DO IEXTERNAL = 1, NEXTERNAL
c WRITE(6,*) 'MOMENTA', IEVT, IEXTERNAL,
Expand Down
Loading
Loading