Skip to content

Commit

Permalink
Merge pull request #751 from valassi/pptt
Browse files Browse the repository at this point in the history
Minor fixes for param_card.dat path
  • Loading branch information
valassi authored Aug 15, 2023
2 parents 27069e0 + 7ad2135 commit fe3cdf7
Show file tree
Hide file tree
Showing 99 changed files with 495 additions and 367 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cassert>
#include <cmath>
#include <cstring>
#include <filesystem>
#include <iostream>
#include <memory>
#include <type_traits>
Expand Down Expand Up @@ -244,14 +245,21 @@ namespace mg5amcCpu
}
std::cout << "WARNING! Instantiate device Bridge (nevt=" << m_nevt << ", gpublocks=" << m_gpublocks << ", gputhreads=" << m_gputhreads
<< ", gpublocks*gputhreads=" << m_gpublocks * m_gputhreads << ")" << std::endl;
CPPProcess process( /*verbose=*/false );
m_pmek.reset( new MatrixElementKernelDevice( m_devMomentaC, m_devGs, m_devRndHel, m_devRndCol, m_devMEs, m_devSelHel, m_devSelCol, m_gpublocks, m_gputhreads ) );
#else
std::cout << "WARNING! Instantiate host Bridge (nevt=" << m_nevt << ")" << std::endl;
CPPProcess process( /*verbose=*/false );
m_pmek.reset( new MatrixElementKernelHost( m_hstMomentaC, m_hstGs, m_hstRndHel, m_hstRndCol, m_hstMEs, m_hstSelHel, m_hstSelCol, m_nevt ) );
#endif // __CUDACC__
process.initProc( "../../Cards/param_card.dat" );
// Create a process object, read param card and set parameters
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton? what if fbridgecreate is called from several Fortran threads?
CPPProcess process( /*verbose=*/false );
std::string paramCard = "../../Cards/param_card.dat";
if( !std::filesystem::exists( paramCard ) )
{
paramCard = "../" + paramCard;
}
process.initProc( paramCard );
}

#ifdef __CUDACC__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ main( int argc, char** argv )
const std::string procKey = "0a ProcInit";
timermap.start( procKey );

// Create a process object
// Create a process object, read param card and set parameters
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton? (for instance, in bridge mode this will be called twice here?)
CPPProcess process( verbose );

// Read param_card and set parameters
process.initProc( "../../Cards/param_card.dat" );
const fptype energy = 1500; // historical default, Ecms = 1500 GeV = 1.5 TeV (above the Z peak)
//const fptype energy = 91.2; // Ecms = 91.2 GeV (Z peak)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ extern "C"
#ifdef __CUDACC__
CudaRuntime::setUp();
#endif
// Create a process object, read parm card and set parameters
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton? what if fbridgecreate is called from several Fortran threads?
CPPProcess process( /*verbose=*/false );
process.initProc( "../../Cards/param_card.dat" );
// (NB: CPPProcess::initProc no longer needs to be executed here because it is called in the Bridge constructor)
// FIXME: disable OMP in Bridge when called from Fortran
*ppbridge = new Bridge<FORTRANFPTYPE>( *pnevtF, *pnparF, *pnp4F );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ struct CPUTest : public CUDA_CPU_TestBase
, hstSelCol( nevt )
, hstIsGoodHel( CPPProcess::ncomb )
{
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton?
process.initProc( "../../Cards/param_card.dat" );
}

Expand Down Expand Up @@ -183,6 +185,8 @@ struct CUDATest : public CUDA_CPU_TestBase
, devSelCol( nevt )
, devIsGoodHel( CPPProcess::ncomb )
{
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton?
process.initProc( "../../Cards/param_card.dat" );
}

Expand Down
16 changes: 8 additions & 8 deletions epochX/cudacpp/ee_mumu.mad/CODEGEN_mad_ee_mumu_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ generate e+ e- > mu+ mu-
No model currently active, so we import the Standard Model
INFO: load particles
INFO: load vertices
DEBUG: model prefixing takes 0.004727363586425781 
DEBUG: model prefixing takes 0.004712820053100586 
INFO: Restrict model sm with file models/sm/restrict_default.dat .
DEBUG: Simplifying conditional expressions 
DEBUG: remove interactions: u s w+ at order: QED=1 
Expand Down Expand Up @@ -176,7 +176,7 @@ INFO: Creating files in directory P1_epem_mupmum
DEBUG: Entering PLUGIN_OneProcessExporter.__init__ [model_handling.py at line 1039] 
DEBUG: kwargs[prefix] = 0 [model_handling.py at line 1040] 
DEBUG: proc_id =  1 [model_handling.py at line 1046] 
DEBUG: process_exporter_cpp =  <PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_OneProcessExporter object at 0x7fe88ec9b550> [export_v4.py at line 6180] 
DEBUG: process_exporter_cpp =  <PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_OneProcessExporter object at 0x7ff1e2800550> [export_v4.py at line 6180] 
INFO: Creating files in directory .
DEBUG: Entering PLUGIN_OneProcessExporter.generate_process_files [model_handling.py at line 1298] 
DEBUG: self.include_multi_channel is already defined: this is madevent+second_exporter mode [model_handling.py at line 1300] 
Expand Down Expand Up @@ -210,19 +210,19 @@ INFO: Created files CPPProcess.h and CPPProcess.cc in directory ./.
INFO: Generating Feynman diagrams for Process: e+ e- > mu+ mu- WEIGHTED<=4 @1
INFO: Finding symmetric diagrams for subprocess group epem_mupmum
Generated helas calls for 1 subprocesses (2 diagrams) in 0.004 s
Wrote files for 8 helas calls in 0.100 s
Wrote files for 8 helas calls in 0.094 s
ALOHA: aloha starts to compute helicity amplitudes
ALOHA: aloha creates FFV1 routines
ALOHA: aloha creates FFV2 routines
ALOHA: aloha creates FFV4 routines
ALOHA: aloha creates 3 routines in 0.177 s
ALOHA: aloha creates 3 routines in 0.193 s
DEBUG: Entering PLUGIN_ProcessExporter.convert_model (create the model) [output.py at line 195] 
ALOHA: aloha starts to compute helicity amplitudes
ALOHA: aloha creates FFV1 routines
ALOHA: aloha creates FFV2 routines
ALOHA: aloha creates FFV4 routines
ALOHA: aloha creates FFV2_4 routines
ALOHA: aloha creates 7 routines in 0.215 s
ALOHA: aloha creates 7 routines in 0.223 s
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV2
Expand Down Expand Up @@ -338,6 +338,6 @@ Type "launch" to generate events from this process, or see
Run "open index.html" to see more information about this process.
quit

real 0m2.550s
user 0m1.990s
sys 0m0.376s
real 0m2.680s
user 0m2.013s
sys 0m0.356s
14 changes: 11 additions & 3 deletions epochX/cudacpp/ee_mumu.mad/SubProcesses/Bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cassert>
#include <cmath>
#include <cstring>
#include <filesystem>
#include <iostream>
#include <memory>
#include <type_traits>
Expand Down Expand Up @@ -244,14 +245,21 @@ namespace mg5amcCpu
}
std::cout << "WARNING! Instantiate device Bridge (nevt=" << m_nevt << ", gpublocks=" << m_gpublocks << ", gputhreads=" << m_gputhreads
<< ", gpublocks*gputhreads=" << m_gpublocks * m_gputhreads << ")" << std::endl;
CPPProcess process( /*verbose=*/false );
m_pmek.reset( new MatrixElementKernelDevice( m_devMomentaC, m_devGs, m_devRndHel, m_devRndCol, m_devMEs, m_devSelHel, m_devSelCol, m_gpublocks, m_gputhreads ) );
#else
std::cout << "WARNING! Instantiate host Bridge (nevt=" << m_nevt << ")" << std::endl;
CPPProcess process( /*verbose=*/false );
m_pmek.reset( new MatrixElementKernelHost( m_hstMomentaC, m_hstGs, m_hstRndHel, m_hstRndCol, m_hstMEs, m_hstSelHel, m_hstSelCol, m_nevt ) );
#endif // __CUDACC__
process.initProc( "../../Cards/param_card.dat" );
// Create a process object, read param card and set parameters
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton? what if fbridgecreate is called from several Fortran threads?
CPPProcess process( /*verbose=*/false );
std::string paramCard = "../../Cards/param_card.dat";
if( !std::filesystem::exists( paramCard ) )
{
paramCard = "../" + paramCard;
}
process.initProc( paramCard );
}

#ifdef __CUDACC__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ main( int argc, char** argv )
const std::string procKey = "0a ProcInit";
timermap.start( procKey );

// Create a process object
// Create a process object, read param card and set parameters
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton? (for instance, in bridge mode this will be called twice here?)
CPPProcess process( verbose );

// Read param_card and set parameters
process.initProc( "../../Cards/param_card.dat" );
const fptype energy = 1500; // historical default, Ecms = 1500 GeV = 1.5 TeV (above the Z peak)
//const fptype energy = 91.2; // Ecms = 91.2 GeV (Z peak)
Expand Down
6 changes: 1 addition & 5 deletions epochX/cudacpp/ee_mumu.mad/SubProcesses/fbridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ extern "C"
#ifdef __CUDACC__
CudaRuntime::setUp();
#endif
// Create a process object, read parm card and set parameters
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton? what if fbridgecreate is called from several Fortran threads?
CPPProcess process( /*verbose=*/false );
process.initProc( "../../Cards/param_card.dat" );
// (NB: CPPProcess::initProc no longer needs to be executed here because it is called in the Bridge constructor)
// FIXME: disable OMP in Bridge when called from Fortran
*ppbridge = new Bridge<FORTRANFPTYPE>( *pnevtF, *pnparF, *pnp4F );
}
Expand Down
4 changes: 4 additions & 0 deletions epochX/cudacpp/ee_mumu.mad/SubProcesses/runTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ struct CPUTest : public CUDA_CPU_TestBase
, hstSelCol( nevt )
, hstIsGoodHel( CPPProcess::ncomb )
{
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton?
process.initProc( "../../Cards/param_card.dat" );
}

Expand Down Expand Up @@ -183,6 +185,8 @@ struct CUDATest : public CUDA_CPU_TestBase
, devSelCol( nevt )
, devIsGoodHel( CPPProcess::ncomb )
{
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton?
process.initProc( "../../Cards/param_card.dat" );
}

Expand Down
10 changes: 5 additions & 5 deletions epochX/cudacpp/ee_mumu.sa/CODEGEN_cudacpp_ee_mumu_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ generate e+ e- > mu+ mu-
No model currently active, so we import the Standard Model
INFO: load particles
INFO: load vertices
DEBUG: model prefixing takes 0.0047245025634765625 
DEBUG: model prefixing takes 0.004635810852050781 
INFO: Restrict model sm with file models/sm/restrict_default.dat .
DEBUG: Simplifying conditional expressions 
DEBUG: remove interactions: u s w+ at order: QED=1 
Expand Down Expand Up @@ -202,7 +202,7 @@ ALOHA: aloha creates FFV1 routines
ALOHA: aloha creates FFV2 routines
ALOHA: aloha creates FFV4 routines
ALOHA: aloha creates FFV2_4 routines
ALOHA: aloha creates 4 routines in 0.230 s
ALOHA: aloha creates 4 routines in 0.227 s
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV2
Expand All @@ -225,6 +225,6 @@ INFO: /data/avalassi/GPU2023/MG5aMC/ghav-mg5amcnlo/CODEGEN_cudacpp_ee_mumu/src/.
DEBUG: 'Entering PLUGIN_ProcessExporter.finalize', self.in_madevent_mode =  Entering PLUGIN_ProcessExporter.finalize False [output.py at line 204] 
quit

real 0m0.638s
user 0m0.567s
sys 0m0.057s
real 0m0.630s
user 0m0.555s
sys 0m0.069s
14 changes: 11 additions & 3 deletions epochX/cudacpp/ee_mumu.sa/SubProcesses/Bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cassert>
#include <cmath>
#include <cstring>
#include <filesystem>
#include <iostream>
#include <memory>
#include <type_traits>
Expand Down Expand Up @@ -244,14 +245,21 @@ namespace mg5amcCpu
}
std::cout << "WARNING! Instantiate device Bridge (nevt=" << m_nevt << ", gpublocks=" << m_gpublocks << ", gputhreads=" << m_gputhreads
<< ", gpublocks*gputhreads=" << m_gpublocks * m_gputhreads << ")" << std::endl;
CPPProcess process( /*verbose=*/false );
m_pmek.reset( new MatrixElementKernelDevice( m_devMomentaC, m_devGs, m_devRndHel, m_devRndCol, m_devMEs, m_devSelHel, m_devSelCol, m_gpublocks, m_gputhreads ) );
#else
std::cout << "WARNING! Instantiate host Bridge (nevt=" << m_nevt << ")" << std::endl;
CPPProcess process( /*verbose=*/false );
m_pmek.reset( new MatrixElementKernelHost( m_hstMomentaC, m_hstGs, m_hstRndHel, m_hstRndCol, m_hstMEs, m_hstSelHel, m_hstSelCol, m_nevt ) );
#endif // __CUDACC__
process.initProc( "../../Cards/param_card.dat" );
// Create a process object, read param card and set parameters
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton? what if fbridgecreate is called from several Fortran threads?
CPPProcess process( /*verbose=*/false );
std::string paramCard = "../../Cards/param_card.dat";
if( !std::filesystem::exists( paramCard ) )
{
paramCard = "../" + paramCard;
}
process.initProc( paramCard );
}

#ifdef __CUDACC__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ main( int argc, char** argv )
const std::string procKey = "0a ProcInit";
timermap.start( procKey );

// Create a process object
// Create a process object, read param card and set parameters
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton? (for instance, in bridge mode this will be called twice here?)
CPPProcess process( verbose );

// Read param_card and set parameters
process.initProc( "../../Cards/param_card.dat" );
const fptype energy = 1500; // historical default, Ecms = 1500 GeV = 1.5 TeV (above the Z peak)
//const fptype energy = 91.2; // Ecms = 91.2 GeV (Z peak)
Expand Down
6 changes: 1 addition & 5 deletions epochX/cudacpp/ee_mumu.sa/SubProcesses/fbridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ extern "C"
#ifdef __CUDACC__
CudaRuntime::setUp();
#endif
// Create a process object, read parm card and set parameters
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton? what if fbridgecreate is called from several Fortran threads?
CPPProcess process( /*verbose=*/false );
process.initProc( "../../Cards/param_card.dat" );
// (NB: CPPProcess::initProc no longer needs to be executed here because it is called in the Bridge constructor)
// FIXME: disable OMP in Bridge when called from Fortran
*ppbridge = new Bridge<FORTRANFPTYPE>( *pnevtF, *pnparF, *pnp4F );
}
Expand Down
4 changes: 4 additions & 0 deletions epochX/cudacpp/ee_mumu.sa/SubProcesses/runTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ struct CPUTest : public CUDA_CPU_TestBase
, hstSelCol( nevt )
, hstIsGoodHel( CPPProcess::ncomb )
{
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton?
process.initProc( "../../Cards/param_card.dat" );
}

Expand Down Expand Up @@ -183,6 +185,8 @@ struct CUDATest : public CUDA_CPU_TestBase
, devSelCol( nevt )
, devIsGoodHel( CPPProcess::ncomb )
{
// FIXME: the process instance can happily go out of scope because it is only needed to read parameters?
// FIXME: the CPPProcess should really be a singleton?
process.initProc( "../../Cards/param_card.dat" );
}

Expand Down
18 changes: 9 additions & 9 deletions epochX/cudacpp/gg_tt.mad/CODEGEN_mad_gg_tt_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ generate g g > t t~
No model currently active, so we import the Standard Model
INFO: load particles
INFO: load vertices
DEBUG: model prefixing takes 0.004746198654174805 
DEBUG: model prefixing takes 0.004875898361206055 
INFO: Restrict model sm with file models/sm/restrict_default.dat .
DEBUG: Simplifying conditional expressions 
DEBUG: remove interactions: u s w+ at order: QED=1 
Expand Down Expand Up @@ -155,7 +155,7 @@ INFO: Please specify coupling orders to bypass this step.
INFO: Trying coupling order WEIGHTED<=2: WEIGTHED IS QCD+2*QED
INFO: Trying process: g g > t t~ WEIGHTED<=2 @1
INFO: Process has 3 diagrams
1 processes with 3 diagrams generated in 0.007 s
1 processes with 3 diagrams generated in 0.008 s
Total: 1 processes with 3 diagrams
output madevent CODEGEN_mad_gg_tt --hel_recycling=False --vector_size=16384 --me_exporter=standalone_cudacpp
Load PLUGIN.CUDACPP_SA_OUTPUT
Expand All @@ -177,7 +177,7 @@ INFO: Creating files in directory P1_gg_ttx
DEBUG: Entering PLUGIN_OneProcessExporter.__init__ [model_handling.py at line 1039] 
DEBUG: kwargs[prefix] = 0 [model_handling.py at line 1040] 
DEBUG: proc_id =  1 [model_handling.py at line 1046] 
DEBUG: process_exporter_cpp =  <PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_OneProcessExporter object at 0x7fdc27d2af70> [export_v4.py at line 6180] 
DEBUG: process_exporter_cpp =  <PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_OneProcessExporter object at 0x7fc23cf116a0> [export_v4.py at line 6180] 
INFO: Creating files in directory .
DEBUG: Entering PLUGIN_OneProcessExporter.generate_process_files [model_handling.py at line 1298] 
DEBUG: self.include_multi_channel is already defined: this is madevent+second_exporter mode [model_handling.py at line 1300] 
Expand Down Expand Up @@ -214,16 +214,16 @@ INFO: Created files CPPProcess.h and CPPProcess.cc in directory ./.
INFO: Generating Feynman diagrams for Process: g g > t t~ WEIGHTED<=2 @1
INFO: Finding symmetric diagrams for subprocess group gg_ttx
Generated helas calls for 1 subprocesses (3 diagrams) in 0.006 s
Wrote files for 10 helas calls in 0.103 s
Wrote files for 10 helas calls in 0.106 s
ALOHA: aloha starts to compute helicity amplitudes
ALOHA: aloha creates VVV1 set of routines with options: P0
ALOHA: aloha creates FFV1 routines
ALOHA: aloha creates 2 routines in 0.125 s
ALOHA: aloha creates 2 routines in 0.127 s
DEBUG: Entering PLUGIN_ProcessExporter.convert_model (create the model) [output.py at line 195] 
ALOHA: aloha starts to compute helicity amplitudes
ALOHA: aloha creates VVV1 set of routines with options: P0
ALOHA: aloha creates FFV1 routines
ALOHA: aloha creates 4 routines in 0.113 s
ALOHA: aloha creates 4 routines in 0.112 s
<class 'aloha.create_aloha.AbstractRoutine'> VVV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
Expand Down Expand Up @@ -332,6 +332,6 @@ Type "launch" to generate events from this process, or see
Run "open index.html" to see more information about this process.
quit

real 0m2.316s
user 0m1.937s
sys 0m0.328s
real 0m2.420s
user 0m1.893s
sys 0m0.355s
Loading

0 comments on commit fe3cdf7

Please sign in to comment.