Skip to content

Commit

Permalink
in export_v4.py and madevent_driver.f, allow adding extra header/init…
Browse files Browse the repository at this point in the history
…ialise/finalise to driver.f (for cudacpp)
  • Loading branch information
valassi committed Oct 8, 2024
1 parent 55a291d commit c1509dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions madgraph/iolibs/export_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -6042,6 +6042,10 @@ def write_driver(self, writer, ncomb, n_grouped_proc, v5=True):
else:
replace_dict['secondparam']=''

replace_dict['DRIVER_EXTRA_HEADER'] = ""
replace_dict['DRIVER_EXTRA_INITIALISE'] = ""
replace_dict['DRIVER_EXTRA_FINALISE'] = ""

if writer:
text = open(path).read() % replace_dict
writer.write(text)
Expand Down
4 changes: 3 additions & 1 deletion madgraph/iolibs/template_files/madevent_driver.f
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ Program DRIVER
include 'coupl.inc' ! needs VECSIZE_MEMMAX (defined in vector.inc)
INTEGER VECSIZE_USED
DATA VECSIZE_USED/VECSIZE_MEMMAX/ ! can be changed at runtime

%(DRIVER_EXTRA_HEADER)s
C-----
C BEGIN CODE
C-----
call cpu_time(t_before)
CUMULATED_TIMING = t_before
%(DRIVER_EXTRA_INITIALISE)s
c
c Read process number
c
Expand Down Expand Up @@ -218,6 +219,7 @@ Program DRIVER
rewind(lun)

close(lun)
%(DRIVER_EXTRA_FINALISE)s
end

c $B$ get_user_params $B$ ! tag for MadWeight
Expand Down

0 comments on commit c1509dc

Please sign in to comment.