Commit d6a73148 authored by Valerio Bertone's avatar Valerio Bertone
Browse files

Merge branch 'InterfaceToLHAPDF' into 'master'

Interface to lhapdf

See merge request !31
parents 7d107893 b28adc29
......@@ -7,7 +7,11 @@ cmake_minimum_required(VERSION 3.2)
project(PARTONS CXX)
# define c++ standard and issue all the warning demanded by this standard
add_definitions(-std=c++11 -pedantic -Wno-vla-extension)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_definitions(-std=c++11 -pedantic -Wno-vla-extension)
else()
add_definitions(-std=c++11 -pedantic -Wno-vla-extension -fext-numeric-literals)
endif()
set(CMAKE_CXX_STANDARD 11)
if (NOT DEFINED CMAKE_MACOSX_RPATH)
......@@ -48,25 +52,50 @@ add_definitions(${QT_DEFINITIONS})
# find libraries: additional modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# find libraries: SFML
find_package(SFML COMPONENTS system REQUIRED)
# find libraries: CLN
find_package(CLN REQUIRED)
# find libraries: ElementaryUtils
find_package(ElementaryUtils REQUIRED)
# find libraries: NumA++
find_package(NumA++ REQUIRED)
# find libraries: SFML
find_package(SFML COMPONENTS system REQUIRED)
# find libraries: CLN
find_package(CLN REQUIRED)
# find libraries: GSL
find_package(GSL REQUIRED)
# find libraries: Apfel++
find_package(Apfel++ REQUIRED)
# find libraries: LHAPDF
find_package(LHAPDF REQUIRED)
# directories containing headers
include_directories(${QT_INCLUDE_DIRS} ${SFML_INCLUDE_DIR} ${CLN_INCLUDE_DIR} ${ElementaryUtils_INCLUDE_DIR} ${NumA++_INCLUDE_DIR})
include_directories(${QT_INCLUDE_DIRS} ${SFML_INCLUDE_DIR} ${CLN_INCLUDE_DIR} ${ElementaryUtils_INCLUDE_DIR} ${NumA++_INCLUDE_DIR} ${Apfel++_INCLUDE_DIR} ${LHAPDF_INCLUDE_DIR})
include_directories(include)
# ENVIRONMENT VARIABLES ========================================================================
execute_process(COMMAND bash -c "cd ../../elementary-utils/; git branch --show-current" OUTPUT_VARIABLE ELEMUTILS_BRANCH)
execute_process(COMMAND bash -c "cd ../../elementary-utils/; git rev-parse HEAD;" OUTPUT_VARIABLE ELEMUTILS_REVISION)
string(REGEX REPLACE "\n$" "" ELEMUTILS_BRANCH "${ELEMUTILS_BRANCH}")
string(REGEX REPLACE "\n$" "" ELEMUTILS_REVISION "${ELEMUTILS_REVISION}")
execute_process(COMMAND bash -c "cd ../../numa/; git branch --show-current" OUTPUT_VARIABLE NUMA_BRANCH)
execute_process(COMMAND bash -c "cd ../../numa/; git rev-parse HEAD;" OUTPUT_VARIABLE NUMA_REVISION)
string(REGEX REPLACE "\n$" "" NUMA_BRANCH "${NUMA_BRANCH}")
string(REGEX REPLACE "\n$" "" NUMA_REVISION "${NUMA_REVISION}")
execute_process(COMMAND bash -c "git branch --show-current" OUTPUT_VARIABLE PARTONS_BRANCH)
execute_process(COMMAND bash -c "git rev-parse HEAD" OUTPUT_VARIABLE PARTONS_REVISION)
string(REGEX REPLACE "\n$" "" PARTONS_BRANCH "${PARTONS_BRANCH}")
string(REGEX REPLACE "\n$" "" PARTONS_REVISION "${PARTONS_REVISION}")
configure_file("${CMAKE_SOURCE_DIR}/data/config/environment_configuration.dat.in" "${CMAKE_SOURCE_DIR}/data/config/environment_configuration.dat")
# FINALIZE ==================================================================================
# generate list of source files
......@@ -108,6 +137,10 @@ target_link_libraries(
${GSL_LIBRARIES}
${Apfel++_LIBRARIES}
${LHAPDF_LIBRARIES}
Qt5::Core
Qt5::Sql
......
# APFEL++
find_program(Apfel++_CONFIG apfelxx-config REQUIRED)
if (Apfel++_CONFIG)
exec_program(${Apfel++_CONFIG}
ARGS --cppflags
OUTPUT_VARIABLE Apfel++_CXX_FLAGS
)
set(Apfel++_CXX_FLAGS ${Apfel++_CXX_FLAGS} CACHE STRING INTERNAL)
exec_program(${Apfel++_CONFIG}
ARGS --ldflags
OUTPUT_VARIABLE Apfel++_LIBRARIES
)
set(Apfel++_LIBRARIES ${Apfel++_LIBRARIES} CACHE STRING INTERNAL)
exec_program(${Apfel++_CONFIG}
ARGS --version
OUTPUT_VARIABLE Apfel++_VERSION
)
set(Apfel++_VERSION ${Apfel++_VERSION} CACHE STRING INTERNAL)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Apfel++ REQUIRED_VARS Apfel++_LIBRARIES VERSION_VAR Apfel++_VERSION)
endif(Apfel++_CONFIG)
......@@ -26,7 +26,7 @@ function(_cl_get_version _out_major _out_minor _out_patch _cl_version_h)
message(FATAL_ERROR "failed to determine CL_VERSION_PATCHLEVEL, "
"expected a number, got ${${_out_patch}}")
endif()
message(STATUS "found CLN [${_cl_version_h}], version ${${_out_major}}.${${_out_minor}}.${${_out_patch}}")
#message(STATUS "found CLN [${_cl_version_h}], version ${${_out_major}}.${${_out_minor}}.${${_out_patch}}")
set(${_out_major} ${${_out_major}} PARENT_SCOPE)
set(${_out_minor} ${${_out_minor}} PARENT_SCOPE)
set(${_out_patch} ${${_out_patch}} PARENT_SCOPE)
......@@ -74,6 +74,7 @@ if (CLN_INCLUDE_DIR)
endif()
endif()
set(CMAKE_REQUIRED_QUIET TRUE)
# Check if the version embedded into the library is the same as the one in the headers.
if (CLN_INCLUDE_DIR AND CLN_LIBRARIES AND NOT CMAKE_CROSSCOMPILING)
include(CheckCXXSourceRuns)
......
......@@ -36,7 +36,7 @@ else (ElementaryUtils_INCLUDE_DIR AND ElementaryUtils_LIBRARIES)
PATH_SUFFIXES lib/PARTONS lib64/PARTONS bin/PARTONS lib lib64 bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ElementaryUtils DEFAULT_MSG ElementaryUtils_INCLUDE_DIR ElementaryUtils_LIBRARIES)
find_package_handle_standard_args(ElementaryUtils DEFAULT_MSG ElementaryUtils_LIBRARIES)
endif(ElementaryUtils_INCLUDE_DIR AND ElementaryUtils_LIBRARIES)
# LHAPDF
find_program(LHAPDF_CONFIG lhapdf-config REQUIRED)
if (LHAPDF_CONFIG)
exec_program(${LHAPDF_CONFIG}
ARGS --cppflags
OUTPUT_VARIABLE LHAPDF_CXX_FLAGS
)
set(LHAPDF_CXX_FLAGS ${LHAPDF_CXX_FLAGS} CACHE STRING INTERNAL)
exec_program(${LHAPDF_CONFIG}
ARGS --ldflags
OUTPUT_VARIABLE LHAPDF_LIBRARIES
)
set(LHAPDF_LIBRARIES ${LHAPDF_LIBRARIES} CACHE STRING INTERNAL)
exec_program(${LHAPDF_CONFIG}
ARGS --version
OUTPUT_VARIABLE LHAPDF_VERSION
)
set(LHAPDF_VERSION ${LHAPDF_VERSION} CACHE STRING INTERNAL)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LHAPDF REQUIRED_VARS LHAPDF_LIBRARIES VERSION_VAR LHAPDF_VERSION)
endif(LHAPDF_CONFIG)
......@@ -40,7 +40,7 @@ else (NumA++_INCLUDE_DIR AND NumA++_LIBRARIES)
PATH_SUFFIXES lib/PARTONS lib64/PARTONS bin/PARTONS lib lib64 bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NumA++ DEFAULT_MSG NumA++_INCLUDE_DIR NumA++_LIBRARIES)
find_package_handle_standard_args(NumA++ DEFAULT_MSG NumA++_LIBRARIES)
endif(NumA++_INCLUDE_DIR AND NumA++_LIBRARIES)
......@@ -365,5 +365,7 @@ endif()
# handle success
if(SFML_FOUND AND NOT SFML_FIND_QUIETLY)
message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH} in ${SFML_INCLUDE_DIR}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SFML REQUIRED_VARS SFML_LIBRARIES VERSION_VAR SFML_VERSION_MINOR)
endif()
set(SFML_VERSION "${SFML_VERSION_MAJOR}-${SFML_VERSION_MINOR}-${SFML_VERSION_PATCH}")
\ No newline at end of file
# environment_configuration.dat
# The content of this file is stored in the database during the insertion of data,
# so latter one can easily reproduce the used computational environment.
system: @CMAKE_SYSTEM_NAME@ @CMAKE_SYSTEM_VERSION@
g++: @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@
qt: @Qt5Core_VERSION@
smfl: @SFML_VERSION@
cln: @CLN_VERSION@
gsl: @GSL_VERSION@
apfel++: @Apfel++_VERSION@
lhapdf: @LHAPDF_VERSION@
elementary-utils: @ELEMUTILS_BRANCH@/@ELEMUTILS_REVISION@
numa: @NUMA_BRANCH@/@NUMA_REVISION@
partons: @PARTONS_BRANCH@/@PARTONS_REVISION@
......@@ -39,5 +39,6 @@ computation.nb.processor = 1
# Maximum size of batch for a given type (in one task several batches may be run in separate threads)
gpd.service.batch.size = 10000
collinear_distribution.service.batch.size = 10000
ccf.service.batch.size = 1000
observable.service.batch.size = 1000
......@@ -10,7 +10,7 @@ scenario_hash_sum VARCHAR(40));
CREATE TABLE environment_configuration (
env_conf_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
env_conf_store_date TIMESTAMP,
env_conf_configuration VARCHAR(255),
env_conf_configuration VARCHAR(10000),
env_conf_hash_sum VARCHAR(40));
CREATE TABLE computation (
......@@ -24,6 +24,11 @@ scenario_task_index_number INTEGER,
scenario_id INTEGER NOT NULL,
computation_id INTEGER NOT NULL);
CREATE TABLE collinear_distribution_type (
collinear_distribution_type_id INTEGER NOT NULL PRIMARY KEY,
collinear_distribution_type_short_name VARCHAR(10),
collinear_distribution_type_long_name VARCHAR(255));
CREATE TABLE gpd_type (
gpd_type_id INTEGER NOT NULL PRIMARY KEY,
gpd_type_short_name VARCHAR(10),
......@@ -62,6 +67,32 @@ INNER JOIN scenario_computation sc ON sc.computation_id = c.computation_id
INNER JOIN scenario s ON sc.scenario_id = s.scenario_id
ORDER BY c.computation_id;
/* === collinear_distribution_type === */
INSERT INTO collinear_distribution_type (collinear_distribution_type_id, collinear_distribution_type_short_name, collinear_distribution_type_long_name)
VALUES ('0', 'UNDEFINED', 'UNDEFINED');
INSERT INTO collinear_distribution_type (collinear_distribution_type_id, collinear_distribution_type_short_name, collinear_distribution_type_long_name)
VALUES ('1', 'ALL', 'ALL');
INSERT INTO collinear_distribution_type (collinear_distribution_type_id, collinear_distribution_type_short_name, collinear_distribution_type_long_name)
VALUES ('2', 'UnpolPDF', 'UnpolPDF');
INSERT INTO collinear_distribution_type (collinear_distribution_type_id, collinear_distribution_type_short_name, collinear_distribution_type_long_name)
VALUES ('3', 'PolPDF', 'PolPDF');
INSERT INTO collinear_distribution_type (collinear_distribution_type_id, collinear_distribution_type_short_name, collinear_distribution_type_long_name)
VALUES ('4', 'TransPDF', 'TransPDF');
INSERT INTO collinear_distribution_type (collinear_distribution_type_id, collinear_distribution_type_short_name, collinear_distribution_type_long_name)
VALUES ('5', 'UnpolFF', 'UnpolFF');
INSERT INTO collinear_distribution_type (collinear_distribution_type_id, collinear_distribution_type_short_name, collinear_distribution_type_long_name)
VALUES ('6', 'PolFF', 'PolFF');
INSERT INTO collinear_distribution_type (collinear_distribution_type_id, collinear_distribution_type_short_name, collinear_distribution_type_long_name)
VALUES ('7', 'TransFF', 'TransFF');
/* === gpd_type === */
INSERT INTO gpd_type (gpd_type_id, gpd_type_short_name, gpd_type_long_name)
......
/* MYSQL syntax */
CREATE TABLE collinear_distribution_kinematic (
collinear_distribution_kinematic_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
x DOUBLE,
x_unit INTEGER NOT NULL,
MuF2 DOUBLE,
MuF2_unit INTEGER NOT NULL,
MuR2 DOUBLE,
MuR2_unit INTEGER NOT NULL,
hash_sum VARCHAR(40) NOT NULL);
CREATE INDEX collinear_distribution_kinematic_index ON collinear_distribution_kinematic (hash_sum);
CREATE TABLE gpd_kinematic (
gpd_kinematic_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
x DOUBLE,
......@@ -15,6 +26,13 @@ MuR2_unit INTEGER NOT NULL,
hash_sum VARCHAR(40) NOT NULL);
CREATE INDEX gpd_kinematic_index ON gpd_kinematic (hash_sum);
CREATE TABLE collinear_distribution_result (
collinear_distribution_result_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
computation_module_name VARCHAR(255) NOT NULL,
collinear_distribution_kinematic_id INTEGER NOT NULL,
computation_id INTEGER NOT NULL);
CREATE INDEX collinear_distribution_result_index ON collinear_distribution_result (computation_id);
CREATE TABLE gpd_result (
gpd_result_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
computation_module_name VARCHAR(255) NOT NULL,
......@@ -26,6 +44,14 @@ CREATE TABLE parton_distribution (
parton_distribution_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
gluon_distribution_value DOUBLE);
CREATE TABLE collinear_distribution_result_parton_distribution (
collinear_distribution_result_parton_distribution_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
collinear_distribution_type_id INTEGER NOT NULL,
collinear_distribution_result_id INTEGER NOT NULL,
parton_distribution_id INTEGER NOT NULL);
CREATE INDEX cdrpd_index_a ON collinear_distribution_result_parton_distribution (parton_distribution_id, collinear_distribution_result_id);
CREATE INDEX cdrpd_index_b ON collinear_distribution_result_parton_distribution (collinear_distribution_result_id);
CREATE TABLE gpd_result_parton_distribution (
gpd_result_parton_distribution_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
gpd_type_id INTEGER NOT NULL,
......@@ -50,11 +76,26 @@ CREATE INDEX pdqd_index_b ON parton_distribution_quark_distribution (parton_dist
/* view */
CREATE VIEW collinear_distribution_kinematic_view AS
SELECT k.collinear_distribution_kinematic_id, k.x, k.x_unit, k.MuF2, k.MuF2_unit, k.MuR2, k.MuR2_unit, k.hash_sum
FROM collinear_distribution_kinematic k
ORDER BY k.collinear_distribution_kinematic_id;
CREATE VIEW gpd_kinematic_view AS
SELECT k.gpd_kinematic_id, k.x, k.x_unit, k.xi, k.xi_unit, k.t, k.t_unit, k.MuF2, k.MuF2_unit, k.MuR2, k.MuR2_unit, k.hash_sum
FROM gpd_kinematic k
ORDER BY k.gpd_kinematic_id;
CREATE VIEW collinear_distribution_result_view AS
SELECT gr.collinear_distribution_result_id, pd.parton_distribution_id, gr.computation_module_name, grpd.collinear_distribution_type_id, pd.gluon_distribution_value, qd.quark_flavor_id, qd.quark_distribution, qd.quark_distribution_plus, qd.quark_distribution_minus, gr.computation_id, gr.collinear_distribution_kinematic_id
FROM collinear_distribution_result gr
INNER JOIN computation c ON gr.computation_id = c.computation_id
INNER JOIN collinear_distribution_result_parton_distribution grpd ON gr.collinear_distribution_result_id = grpd.collinear_distribution_result_id
INNER JOIN parton_distribution pd ON grpd.parton_distribution_id = pd.parton_distribution_id
INNER JOIN parton_distribution_quark_distribution pdqd ON pd.parton_distribution_id = pdqd.parton_distribution_id
INNER JOIN quark_distribution qd ON pdqd.quark_distribution_id = qd.quark_distribution_id
ORDER BY pd.parton_distribution_id;
CREATE VIEW gpd_result_view AS
SELECT gr.gpd_result_id, pd.parton_distribution_id, gr.computation_module_name, grpd.gpd_type_id, pd.gluon_distribution_value, qd.quark_flavor_id, qd.quark_distribution, qd.quark_distribution_plus, qd.quark_distribution_minus, gr.computation_id, gr.gpd_kinematic_id
FROM gpd_result gr
......@@ -67,6 +108,29 @@ ORDER BY pd.parton_distribution_id;
/* view for plots */
CREATE VIEW collinear_distribution_plot_2d_view AS
SELECT gr.computation_id, gk.collinear_distribution_kinematic_id,
gk.x, gk.x_unit,
gk.MuF2, gk.MuF2_unit,
gk.MuR2, gk.MuR2_unit,
gr.collinear_distribution_result_id, gr.computation_module_name,
gt.collinear_distribution_type_short_name,
pd.gluon_distribution_value, '1' as 'gluon_distribution_value_unit',
qf.quark_flavor_short_name,
qd.quark_distribution, '1' as 'quark_distribution_unit',
qd.quark_distribution_plus, '1' as 'quark_distribution_plus_unit',
qd.quark_distribution_minus, '1' as 'quark_distribution_minus_unit'
FROM collinear_distribution_result gr
INNER JOIN collinear_distribution_kinematic gk ON gr.collinear_distribution_kinematic_id = gk.collinear_distribution_kinematic_id
INNER JOIN computation c ON gr.computation_id = c.computation_id
INNER JOIN collinear_distribution_result_parton_distribution grpd ON gr.collinear_distribution_result_id = grpd.collinear_distribution_result_id
INNER JOIN parton_distribution pd ON grpd.parton_distribution_id = pd.parton_distribution_id
INNER JOIN parton_distribution_quark_distribution pdqd ON pd.parton_distribution_id = pdqd.parton_distribution_id
INNER JOIN quark_distribution qd ON pdqd.quark_distribution_id = qd.quark_distribution_id
INNER JOIN collinear_distribution_type gt ON grpd.collinear_distribution_type_id = gt.collinear_distribution_type_id
INNER JOIN quark_flavor qf ON qd.quark_flavor_id = qf.quark_flavor_id
ORDER BY gr.collinear_distribution_result_id;
CREATE VIEW gpd_plot_2d_view AS
SELECT gr.computation_id, gk.gpd_kinematic_id,
gk.x, gk.x_unit,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment