Commit 3a308832 authored by Juergen Reuter's avatar Juergen Reuter
Browse files

163eab5 Merge branch 'tho/working' into 'master'

parent 2cc32fd1
......@@ -36,7 +36,7 @@ nodist_execmod_HEADERS = $(OMEGALIB_MOD)
libomega_core_la_SOURCES = $(OMEGALIB_F90)
EXTRA_DIST = \
$(OMEGA_CAML) \
$(OMEGA_CONFIG_MLI) $(OMEGA_CAML) \
omegalib.nw $(OMEGALIB_F90)
OMEGA_CMXA = omega_core.cmxa omega_targets.cmxa omega_models.cmxa
......@@ -65,7 +65,9 @@ endif
include $(top_srcdir)/omega/src/Makefile.ocaml
include $(top_srcdir)/omega/src/Makefile.sources
if OCAML_AVAILABLE
if OCAML_AVAILABLE
config.cmo config.cmx: config.cmi
omega_core.a: omega_core.cmxa
omega_core.cmxa: $(OMEGA_CORE_CMX)
@if $(AM_V_P); then :; else echo " OCAMLOPT " $@; fi
......
......@@ -89,9 +89,15 @@ OMEGA_INTERFACES_MLI = \
# files to the end of the shorter list.
########################################################################
# Derived from a *.ml.in, not to be distributed
OMEGA_CONFIG_ML = \
config.ml
OMEGA_CONFIG_MLI = $(OMEGA_CONFIG_ML:.ml=.mli)
OMEGA_CORE_ML_PART1 = \
OUnit.ml OUnitDiff.ml \
config.ml partial.ml pmap.ml format_Fortran.ml \
partial.ml pmap.ml format_Fortran.ml \
thoString.ml sets.ml thoList.ml thoArray.ml bundle.ml powSet.ml \
thoFilename.ml cache.ml progress.ml trie.ml linalg.ml tree2.ml \
algebra.ml options.ml product.ml combinatorics.ml \
......@@ -115,7 +121,8 @@ OMEGA_CORE_ML = \
$(OMEGA_CORE_ML_PART1) $(OMEGA_CORE_ML_PART2) $(OMEGA_CORE_ML_PART3)
OMEGA_CORE_MLI_PRIMARY = $(OMEGA_INTERFACES_MLI) $(OMEGA_CORE_ML_PRIMARY:.ml=.mli)
OMEGA_CORE_MLI = $(OMEGA_INTERFACES_MLI) $(OMEGA_CORE_ML:.ml=.mli)
OMEGA_CORE_MLI = \
$(OMEGA_CONFIG_MLI) $(OMEGA_INTERFACES_MLI) $(OMEGA_CORE_ML:.ml=.mli)
OMEGA_MODELLIB_ML = \
modellib_SM.ml \
......@@ -206,8 +213,8 @@ OMEGA_APPLICATIONS_ML = \
omega_SM_Majorana.ml \
omega_SM_Majorana_legacy.ml
OMEGA_CORE_CMO = $(OMEGA_CORE_ML:.ml=.cmo)
OMEGA_CORE_CMX = $(OMEGA_CORE_ML:.ml=.cmx)
OMEGA_CORE_CMO = $(OMEGA_CONFIG_ML:.ml=.cmo) $(OMEGA_CORE_ML:.ml=.cmo)
OMEGA_CORE_CMX = $(OMEGA_CORE_CMO:.cmo=.cmx)
OMEGA_TARGETS_CMO = $(OMEGA_TARGETLIB_ML:.ml=.cmo)
OMEGA_TARGETS_CMX = $(OMEGA_TARGETLIB_ML:.ml=.cmx)
OMEGA_MODELS_CMO = $(OMEGA_MODELLIB_ML:.ml=.cmo)
......@@ -247,6 +254,7 @@ OMEGA_ML = \
$(OMEGA_APPLICATIONS_ML)
OMEGA_MLI = \
$(OMEGA_CONFIG_MLI) \
$(OMEGA_CORE_MLI) \
$(OMEGA_MODELLIB_MLI) \
$(OMEGA_TARGETLIB_MLI)
......
......@@ -23,10 +23,15 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *)
let search_path =
[ Filename.current_dir_name ]
(*i
let search_path =
[ Filename.current_dir_name;
ThoFilename.expand_home Config.user_cache_dir;
Config.system_cache_dir ]
i*)
module type T =
sig
......
......@@ -27,6 +27,7 @@ let status = "@PACKAGE_STATUS@"
let default_UFO_dir = "@OMEGA_DEFAULT_UFO_DIR@"
(*i
let system_cache_dir = "@OMEGA_SYSTEM_CACHE_DIR@"
let user_cache_dir = "@OMEGA_USER_CACHE_DIR@"
......@@ -39,6 +40,7 @@ let cache_prefix =
try Filename.chop_extension basename with | _ -> basename
let cache_suffix = "@OMEGA_CACHE_SUFFIX@"
i*)
let openmp = false
......
......@@ -28,6 +28,7 @@ val status : string
val default_UFO_dir : string
(*i
(* Cache writing is attempted in the order [[system_cache_dir]], [[user_cache_dir]], [["."]]
and cache reading in the opposite order. *)
......@@ -36,6 +37,7 @@ val user_cache_dir : string
val cache_prefix : string
val cache_suffix : string
i*)
val openmp : bool
......
......@@ -76,8 +76,10 @@ module type T =
val constraints : amplitude -> string option
val symmetry : amplitude -> int
val allowed : amplitude -> bool
(*i
val initialize_cache : string -> unit
val set_cache_name : string -> unit
i*)
val check_charges : unit -> flavor_sans_color list list
val count_fusions : amplitude -> int
val count_propagators : amplitude -> int
......@@ -581,12 +583,15 @@ module Tagged (Tagger : Tagger) (PT : Tuple.Poly)
let ew_order = ref (EW_order 99)
let options = Options.create
[ "ignore-cache", Arg.Unit (fun () -> cache_option := Cache_Ignore),
[
(*i
"ignore-cache", Arg.Unit (fun () -> cache_option := Cache_Ignore),
" ignore cached model tables (default)";
"use-cache", Arg.Unit (fun () -> cache_option := Cache_Use),
" use cached model tables";
"overwrite-cache", Arg.Unit (fun () -> cache_option := Cache_Overwrite),
" overwrite cached model tables";
i*)
"qcd", Arg.Int (fun n -> qcd_order := QCD_order n),
" set QCD order n [>= 0, default = 99] (ignored)";
"ew", Arg.Int (fun n -> ew_order := EW_order n),
......@@ -992,6 +997,7 @@ module Tagged (Tagger : Tagger) (PT : Tuple.Poly)
* constant Coupling.vertex4 * constant) list
* (A.flavor list * constant Coupling.vertexn * constant) list
(*i
module VCache =
Cache.Make (struct type t = vertex_table end) (struct type t = vertices end)
......@@ -1067,6 +1073,8 @@ module Tagged (Tagger : Tagger) (PT : Tuple.Poly)
result
end
| Some result -> result
i*)
let vertices = vertices_nocache
let vertices' max_degree flavors =
Printf.eprintf ">>> vertices %d ..." max_degree;
......@@ -3178,8 +3186,10 @@ module type Multi =
val amplitudes : bool -> int option ->
exclusions -> selectors -> process list -> amplitudes
val empty : amplitudes
(*i
val initialize_cache : string -> unit
val set_cache_name : string -> unit
i*)
val flavors : amplitudes -> process list
val vanishing_flavors : amplitudes -> process list
val color_flows : amplitudes -> Color.Flow.t list
......@@ -3549,9 +3559,11 @@ i*)
color_factors = color_factor_table;
constraints = C.description select_wf }
(*i
let initialize_cache = F.initialize_cache
let set_cache_name = F.set_cache_name
i*)
let empty =
{ flavors = [];
vanishing_flavors = [];
......
......@@ -180,10 +180,12 @@ module type T =
val allowed : amplitude -> bool
(*i
(* \thocwmodulesubsection{Performance Hacks} *)
val initialize_cache : string -> unit
val set_cache_name : string -> unit
i*)
(* \thocwmodulesubsection{Diagnostics} *)
......@@ -282,9 +284,11 @@ module type Multi =
exclusions -> selectors -> process list -> amplitudes
val empty : amplitudes
(*i
(* Precompute the vertex table cache. *)
val initialize_cache : string -> unit
val set_cache_name : string -> unit
i*)
(* The list of all combinations of incoming and outgoing particles
with a nonvanishing scattering amplitude. *)
......
......@@ -76,8 +76,10 @@ module type T =
val constraints : amplitude -> string option
val symmetry : amplitude -> int
val allowed : amplitude -> bool
(*i
val initialize_cache : string -> unit
val set_cache_name : string -> unit
i*)
val check_charges : unit -> flavor_sans_color list list
val count_fusions : amplitude -> int
val count_propagators : amplitude -> int
......@@ -320,12 +322,15 @@ module Tagged (Tagger : Tagger) (PT : Tuple.Poly)
let ew_order = ref (EW_order 99)
let options = Options.create
[ "ignore-cache", Arg.Unit (fun () -> cache_option := Cache_Ignore),
[
(*i
"ignore-cache", Arg.Unit (fun () -> cache_option := Cache_Ignore),
" ignore cached model tables (default)";
"use-cache", Arg.Unit (fun () -> cache_option := Cache_Use),
" use cached model tables";
"overwrite-cache", Arg.Unit (fun () -> cache_option := Cache_Overwrite),
" overwrite cached model tables";
i*)
"qcd", Arg.Int (fun n -> qcd_order := QCD_order n),
" set QCD order n [>= 0, default = 99] (ignored)";
"ew", Arg.Int (fun n -> ew_order := EW_order n),
......@@ -690,6 +695,7 @@ module Tagged (Tagger : Tagger) (PT : Tuple.Poly)
* constant Coupling.vertex4 * constant) list
* (A.flavor list * constant Coupling.vertexn * constant) list
(*i
module VCache =
Cache.Make (struct type t = vertex_table end) (struct type t = vertices end)
......@@ -765,6 +771,9 @@ module Tagged (Tagger : Tagger) (PT : Tuple.Poly)
result
end
| Some result -> result
i*)
let vertices = vertices_nocache
(* Note that we must perform any filtering of the vertices \emph{after}
caching, because the restrictions \emph{must not} influence the
......@@ -2498,8 +2507,10 @@ module type Multi =
val amplitudes : bool -> int option ->
exclusions -> selectors -> process list -> amplitudes
val empty : amplitudes
(*i
val initialize_cache : string -> unit
val set_cache_name : string -> unit
i*)
val flavors : amplitudes -> process list
val vanishing_flavors : amplitudes -> process list
val color_flows : amplitudes -> Color.Flow.t list
......@@ -2869,8 +2880,10 @@ i*)
color_factors = color_factor_table;
constraints = C.description select_wf }
(*i
let initialize_cache = F.initialize_cache
let set_cache_name = F.set_cache_name
i*)
let empty =
{ flavors = [];
......
......@@ -180,10 +180,12 @@ module type T =
val allowed : amplitude -> bool
(*i
(* \thocwmodulesubsection{Performance Hacks} *)
val initialize_cache : string -> unit
val set_cache_name : string -> unit
i*)
(* \thocwmodulesubsection{Diagnostics} *)
......@@ -280,9 +282,11 @@ module type Multi =
exclusions -> selectors -> process list -> amplitudes
val empty : amplitudes
(*i
(* Precompute the vertex table cache. *)
val initialize_cache : string -> unit
val set_cache_name : string -> unit
i*)
(* The list of all combinations of incoming and outgoing particles
with a nonvanishing scattering amplitude. *)
......
......@@ -350,15 +350,17 @@ i*)
let read_lines file =
List.rev (read_lines_rev file)
(*i
type cache_mode =
| Cache_Default
| Cache_Initialize of string
let cache_option =
ref Cache_Default
i*)
let unphysical_polarization = ref None
(* \thocwmodulesection{Main Program} *)
let main () =
......@@ -411,9 +413,11 @@ i*)
"name each line: in -> out1 out2 ...");
("-cascade", Arg.String (fun s -> cascades := s :: !cascades),
"expr select diagrams");
(*i
("-initialize",
Arg.String (fun s -> cache_option := Cache_Initialize s),
"dir precompute lookup tables and store them in directory");
i*)
("-unphysical", Arg.Int (fun i -> unphysical_polarization := Some i),
"n use unphysical polarization for n-th particle / test WIs");
("-template", Arg.Set template,
......@@ -485,9 +489,10 @@ i*)
is selected.
\end{dubious} *)
(*i
begin match processes, !cache_option, !params with
| [], Cache_Initialize dir, false ->
F.initialize_cache dir;
(* [F.initialize_cache dir;] *)
exit 0
| _, _, true ->
if !write then
......@@ -498,6 +503,18 @@ i*)
T.amplitudes_to_channel cmdline output_channel !checks CF.empty;
exit 0
| _, _, false ->
i*)
begin match processes, !params with
| _, true ->
if !write then
T.parameters_to_channel output_channel;
exit 0
| [], false ->
if !write then
T.amplitudes_to_channel cmdline output_channel !checks CF.empty;
exit 0
| _, false ->
let selectors =
let fin, fout = List.hd processes in
......
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