Skip to content

Commit

Permalink
Version 1.2.3 imported from tarball.
Browse files Browse the repository at this point in the history
  • Loading branch information
thuer committed Nov 5, 2015
1 parent 5053c5e commit 93cda16
Show file tree
Hide file tree
Showing 39 changed files with 5,264 additions and 2,375 deletions.
64 changes: 50 additions & 14 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Contact

[email protected]

If you would like to receive notifications about OpenLoops updates and news
per e-mail, please sign up to our mailing list at

https://www.hepforge.org/lists/listinfo/openloops-announce

OpenLoops is a Fortran 90 package for the calculation of tree and one-loop
matrix elements for Standard Model processes based on

Expand Down Expand Up @@ -63,35 +68,66 @@ Compile

Download and compile process libraries

./scons auto=<processes>
./openloops libinstall <processes>

where <processes> is a white space separated list of the processes or
process collections (with suffix ".coll") which should be installed.
Some process collections are defined in the process repository (in
particular "all.coll" to install all processes from the repository).
User-defined collections can be set up as plain text files with file
extension ".coll" with line break separated names of process libraries.

where <processes> is a comma separated list of the processes or
process collections (ending with "/") which should be installed.
A list of the available process libraries can be found here

http://openloops.hepforge.org/processes

Process libraries usually include all real correction processes required
for an NLO calculation. However these processes are not compiled by default.
Note that Sherpa uses its own matrix elements for real corrections, thus
compiling OpenLoops real corrections is not required for usage with Sherpa.
In order to activate the compilation of real corrections, create a file named
"openloops.cfg" in your installation directory which contains the following
(besides other options which you might have set):

[OpenLoops]
compile_extra = 1

The set of available processes will be extended continuously.
If you need a process which is not (yet) available, please contact the
OpenLoops authors.


================================================================
Update OpenLoops from SVN (when it's already installed from SVN)
================================================================
======================================
Update OpenLoops and process libraries
======================================

To pull updates from SVN and compile
Note that automatic updates of the process independent OpenLoops code
are only supported when OpenLoops was installed from SVN.

svn update
./scons
To update from SVN and update all installed processes

./openloops update

To only update installed processes, but not OpenLoops itself
(this also works when OpenLoops was not installed from SVN)

./openloops update --processes

Updating individual process libraries works the same way as installing
new processes.

./openloops libinstall <processes>

To update process libraries (will install new libraries if available and
replace old libraries if newer versions are available)
If process collections are used, new processes in the collection
will be installed and previously installed processes will be updated
if newer versions are available. E.g.

./scons auto=lhc/
./openloops libinstall all.coll

After updating OpenLoops, updating the installed processes might be required
for compatibility.
Updating/installing processes also creates/updates a local database
of all processes which are available for download. This database is used
at runtime to report if a requested process is available for download,
if it is not yet installed.


=====================
Expand Down
133 changes: 93 additions & 40 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

#dd_version = ''
dd_version = '_dp19032014'
#dd_version = '_06082014'
if dd_version != '_06082014':
dd_cppdef = ['COLLIER_LEGACY']
#dd_version = '_03092015'
if dd_version != '_03092015':
dd_cppdef = ['COLLIER_LEGACY', 'collierdd']
else:
dd_cppdef = []

Expand Down Expand Up @@ -157,7 +157,7 @@ cpp_defines = map(lambda lib: 'USE_' + lib.upper(), config['link_libraries'])
cpp_defines += [('KIND_TYPES', 'kind_types'),
('DREALKIND', 'dp'),
('QREALKIND', 'qp'),
'USE_' + config['fortran_compiler'].upper(),
'USE_' + config['fortran_tool'].upper(),
('OL_INSTALL_PATH', '\\"' + install_path + '\\"'),
'SING'] + dd_cppdef

Expand All @@ -175,7 +175,7 @@ for libname in ['olcommon', 'rambo', 'qcdloop', 'oneloop', 'cuttools', 'samurai'
lib_mod_dirs[libname] = os.path.join(config['lib_src_dir'], libname, 'mod')

# OLCommon
olcommon_dp_src = ['kind_types.F90']
olcommon_dp_src = ['kind_types.F90', 'debug.F90', 'cwrappers.c']
olcommon_mp_src = ['common.F90']

# Rambo
Expand Down Expand Up @@ -276,11 +276,24 @@ if dd_version == '_dp19032014':
'bt_GramCayley.F90', 'bt_LightCone.F90', 'bt_MatrixManipulations.F90',
'bt_TensorManipulations.F90', 'bt_TensorReduction.F90', 'bt_TI_interface.F90']

if dd_version == '_06082014':
if dd_version == '_03092015':
collier_inc_dp = []
collier_src_mp = []
collier_src_dp = [
"BuildTensors.F90", "cache.F90", "coli_aux2.F90", "coli_aux.F", "coli_b0.F", "coli_c0.F", "coli_d0.F", "coli_d0reg.F", "coli_stat.F90", "collier_aux.F90", "collier_coefs.F90", "COLLIER.F90", "collier_global.F90", "collier_init.F90", "collier_tensors.F90", "Combinatorics.F90", "dcuhre.f", "DD_2pt.F", "DD_3pt_coll.F", "DD_3pt.F", "DD_4pt.F", "DD_5pt.F", "DD_6pt.F", "DD_aux.F", "DD_to_COLLIER.F", "InitTensors.F90", "master.F90", "reductionAB.F90", "reductionC.F90", "reductionD.F90", "reductionEFG.F90", "reductionTN.F90", "TensorReduction.F90"]
# Aux/
'Combinatorics.F90', 'cache.F90', 'master.F90',
# COLI/
'coli_aux.F', 'coli_aux2.F90', 'coli_b0.F', 'coli_c0.F', 'coli_d0.F',
'coli_d0reg.F', 'coli_stat.F90', 'reductionAB.F90', 'reductionC.F90',
'reductionD.F90', 'reductionEFG.F90', 'reductionTN.F90',
# DDlib/
'DD_2pt.F', 'DD_3pt.F', 'DD_3pt_coll.F', 'DD_4pt.F', 'DD_5pt.F',
'DD_6pt.F', 'DD_aux.F', 'DD_to_COLLIER.F', 'dcuhre.f',
# tensors/
'BuildTensors.F90', 'InitTensors.F90', 'TensorReduction.F90',
# ./
'COLLIER.F90', 'collier_aux.F90', 'collier_coefs.F90',
'collier_global.F90', 'collier_init.F90', 'collier_tensors.F90']

if compile_libraries:
cpp_container = CPPContainer(scons_cmd = scons_cmd,
Expand All @@ -292,13 +305,14 @@ if compile_libraries:
target_prefix = os.path.join('..', 'obj', ''))

if 'olcommon' in compile_libraries:
olcommon_lib = OLLibrary(name = 'olcommon',
linklibs = ['dl'],
target_dir = config['generic_lib_dir'],
src_dir = lib_src_dirs['olcommon'],
dp_src = olcommon_dp_src,
mp_src = olcommon_mp_src,
to_cpp = cpp_container)
olcommon_lib = OLLibrary(
name = 'olcommon',
linklibs = ([] if sys.platform.startswith('freebsd') else ['dl']),
target_dir = config['generic_lib_dir'],
src_dir = lib_src_dirs['olcommon'],
dp_src = olcommon_dp_src,
mp_src = olcommon_mp_src,
to_cpp = cpp_container)

if 'rambo' in compile_libraries:
VariantDir(lib_obj_dirs['rambo'],
Expand Down Expand Up @@ -375,36 +389,50 @@ if 'openloops' in compile_libraries:
version_src = [openloops_version_src],
to_cpp = cpp_container)


if compile_libraries:
if not GetOption('clean'):
if not cpp_container.run():
print '*** cpp failed ***'
Exit(1)


if config['import_path']:
env_path = os.environ.get('PATH', '')
env_ld_library_path = os.environ.get('LD_LIBRARY_PATH', '')
if '@all' in config['import_env']:
imported_env = os.environ
else:
env_path = []
env_ld_library_path = []
imported_env = {}
for envvar in config['import_env']:
imported_env[envvar] = os.environ.get(envvar, '')

env = Environment(tools = ['default', 'textfile'] + [config['fortran_compiler']],
ENV = {"PATH": env_path, "LD_LIBRARY_PATH": env_ld_library_path},
env = Environment(tools = ['default', 'textfile'] + [config['fortran_tool']],
ENV = imported_env,
CCFLAGS = config['ccflags'] + config['generic_optimisation'],
FORTRANFLAGS = config['f77_flags'] + config['generic_optimisation'],
F90FLAGS = config['f90_flags'] + config['generic_optimisation'],
LINKFLAGS = config['link_flags'],
LIBPATH = [config['generic_lib_dir']],
RPATH = [Literal('\$$ORIGIN')])

RPATH = [Literal('\$$ORIGIN')],
F90 = config['fortran_compiler'],
FORTRAN = config['fortran_compiler'],
CC = config['cc'])

if env.subst('$F90') == 'gfortran':
if config['fortran_tool'] == 'gfortran':
# SCons bug: FORTRANMODDIRPREFIX is missing in gfortran tool
env.Replace(FORTRANMODDIRPREFIX = '-J')
if tuple(map(int, env.subst('$CCVERSION').split('.')[:2])) < (4,6):
print 'ERROR: This OpenLoops version requires gfortran 4.6 or later (found %s)' % env.subst('$CCVERSION')
Exit(1)
# determine gfortran version;
# do not use CCVERSION, because mit might not be from gcc
gfort_exitcode = 1
try:
gfort_proc = subprocess.Popen(
[config['fortran_compiler'], '-dumpversion'],
stdout=subprocess.PIPE)
gfort_out, gfort_err = gfort_proc.communicate()
gfort_exitcode = gfort_proc.returncode
except OSError:
pass
if not gfort_exitcode: # else ignore and continue without version check
if tuple(map(int, gfort_out.strip().split('.')[:2])) < (4,6):
print ('ERROR: This OpenLoops version requires gfortran 4.6 ' +
'or later (found %s)' % env.subst('$CCVERSION'))
Exit(1)

if compile_libraries:
if not GetOption('clean'):
if not cpp_container.run():
print '*** cpp failed ***'
Exit(1)

env_noautomatic = env.Clone()
env_noautomatic.AppendUnique(F90FLAGS = config['noautomatic'],
Expand Down Expand Up @@ -491,11 +519,19 @@ def split_processlist(loops, procs):
proclist = [(loops, proc) for proc in proclist
if not (proc.endswith('/') or coll.endswith('.coll'))]
for coll in collections:
coll_repo = False
for repo in config['process_repositories']:
if coll == OLToolbox.repo_name(repo) + '.coll':
coll_repo = repo
break
process_coll = []
if coll == 'all.coll':
for repo in config['process_repositories']:
process_db = OLToolbox.ProcessDB(db=(version_db_url % repo))
process_coll += process_db.content.keys()
elif coll_repo:
process_db = OLToolbox.ProcessDB(db=(version_db_url % coll_repo))
process_coll += process_db.content.keys()
else:
found_collection = False
first_repo = True
Expand Down Expand Up @@ -589,14 +625,29 @@ def revoke_processes():

def download_processes(processes):
"""Download processes"""
if subprocess.call(['python', config['process_download_script']] + force_download_flag + processes) != 0:
try:
err = subprocess.call(
['python2', config['process_download_script']] +
force_download_flag + processes +
['='.join(arg) for arg in commandline_options])
except OSError:
# try again with 'python' instead of 'python2'
err = subprocess.call(
['python', config['process_download_script']] +
force_download_flag + processes +
['='.join(arg) for arg in commandline_options])
if err:
print 'ERROR: process downloader failed.'
Exit(1)


def generate_process(loops, processlib):
"""Generate a process library"""
if subprocess.call([scons_cmd, '-Q'] + generator_options + ['-f', config['code_generator_script'], 'PROC=' + processlib, 'LOOPS=' + loops]) != 0:
if subprocess.call(
[scons_cmd, '-Q'] + generator_options +
['-f', config['code_generator_script'],
'PROC=' + processlib, 'LOOPS=' + loops] +
['='.join(arg) for arg in commandline_options]) != 0:
print 'ERROR: code generator failed.'
Exit(1)

Expand All @@ -609,8 +660,9 @@ if config['process_update']:

if download_process_true:
proc_ls = list(set([proc for loops, proc in process_list]))
revoke_processes()
download_processes(proc_ls)
if proc_ls or config['process_update']:
revoke_processes()
download_processes(proc_ls)

process_list = map(get_auto_loops, process_list)

Expand Down Expand Up @@ -657,7 +709,8 @@ for (loops, processlib) in process_list:
# set up process library
process_lib = OLLibrary(name = processlib_name,
target_dir = config['process_lib_dir'],
mod_dependencies = ['olcommon', 'openloops'],
# need to include oneloop mod dir for ifort
mod_dependencies = ['olcommon', 'openloops', 'oneloop'],
mod_dir = os.path.join(processlib_obj_dir, 'mod'),
mp_src = process_mp_src,
dp_src = process_dp_src,
Expand Down
2 changes: 1 addition & 1 deletion examples/OL_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int main() {
// Set parameter: strong coupling
ol_setparameter_double("alpha_s", alphas);
// Set parameter: renormalization scale
ol_setparameter_double("mu", 100.);
ol_setparameter_double("mu", mu);

// Obtain a random phase-space point in the format pp[5*N] from Rambo
double pp[5*ol_n_external(id)];
Expand Down
3 changes: 2 additions & 1 deletion examples/README
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To remove object code and executables
Before running the examples, the process library "ppzjj" must be installed.

# from the OpenLoops installation folder run
./scons auto=ppzjj
./openloops libinstall ppzjj


How to use OpenLoops in your own programs
Expand All @@ -39,6 +39,7 @@ How to use OpenLoops in your own programs
(linker option -L<ol_install_dir>/lib)
* Set LD_LIBRARY_PATH=<ol_install_dir>/lib so that the linker finds libopenloops.so at runtime
(alternatively you can set the RPATH, gcc linker option -Wl,-rpath=<ol_install_dir>/lib)
* On MacOSX you have to set DYLD_LIBRARY_PATH=<ol_install_dir>/lib

Examples

Expand Down
29 changes: 18 additions & 11 deletions examples/SConstruct
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@

cwd = Dir('..').abspath

import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join('..', 'pyol', 'tools')))
sys.path.insert(0, os.path.abspath(os.path.join(cwd, 'pyol', 'tools')))
import OLBaseConfig

OLBaseConfig.prefix = '..'
OLBaseConfig.prefix = cwd
config = OLBaseConfig.get_config(ARGLIST)

if config['import_path']:
if config['import_env']:
env_path = os.environ.get('PATH', '')
env_ld_library_path = os.environ.get('LD_LIBRARY_PATH', '')
else:
env_path = []
env_ld_library_path = []

env = Environment(tools = ['default', config['fortran_compiler']],
env = Environment(tools = ['default', config['fortran_tool']],
ENV = {"PATH": env_path, "LD_LIBRARY_PATH": env_ld_library_path},
CXX = config['cxx'],
F90 = config['fortran_compiler'],
CCFLAGS = config['ccflags'] + config['generic_optimisation'],
FORTRAN = config['fortran_compiler'],
F90FLAGS = config['f90_flags'] + config['generic_optimisation'],
F90PATH = [os.path.join('..', 'lib_src', 'openloops', 'mod')],
LIBPATH = [os.path.join('..', config['generic_lib_dir'])],
RPATH = [os.path.join('..', config['generic_lib_dir'])])
F90PATH = [os.path.join(cwd, 'lib_src', 'openloops', 'mod')],
LIBPATH = [os.path.join(cwd, config['generic_lib_dir'])],
LINKFLAGS = config['link_flags'],
RPATH = [os.path.join(cwd, config['generic_lib_dir'])])

env.Program('OL_minimal.f90', LIBS = ['openloops'])
env.Program('OL_fortran.f90', LIBS = ['openloops'])
env.Program('OL_cpp.cpp', LIBS = ['openloops'])
env.Program('OL_blha.cpp', LIBS = ['openloops'])
env.Program('OL_minimal', ['OL_minimal.f90'], LIBS = ['openloops'])
env.Program('OL_fortran', ['OL_fortran.f90'], LIBS = ['openloops'])
env.Program('OL_cpp', ['OL_cpp.cpp'], LIBS = ['openloops'])
env.Program('OL_blha', ['OL_blha.cpp'], LIBS = ['openloops'])
Loading

0 comments on commit 93cda16

Please sign in to comment.