Skip to content

Commit c16e2d5

Browse files
authored
Merge pull request #199 from WireCell/check-test
Improve test situation
2 parents 710fa10 + dc2e717 commit c16e2d5

470 files changed

Lines changed: 24399 additions & 1326 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,13 @@ ltximg
6666
auto
6767
latexmk-out
6868
*.tex
69-
7069
svg-inkscape
7170
*.html
71+
tmp
72+
*.tar
73+
*.md
74+
README.tex
7275
larsoft-cfg
7376
*.dot
7477
configure
78+

README.org

Lines changed: 59 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,67 @@
11
#+TITLE: Wire-Cell Toolkit
2+
#+SETUPFILE: setup-readme.org
23

3-
Welcome to the Wire-Cell Toolkit source repository.
4+
Welcome to the Wire-Cell Toolkit (WCT) source repository at https://github.com/wirecell/wire-cell-toolkit.
45

5-
See http://wirecell.bnl.gov/ for documentation including user manual and news "blog".
6+
* Overview
67

7-
[[https://travis-ci.org/WireCell/wire-cell-toolkit][https://api.travis-ci.org/WireCell/wire-cell-toolkit.svg?branch=master]]
8+
The WCT is a multi-faceted, high performance software project developed for liquid argon time projection chamber (LArTPC) simulation and data processing. Some features of wCT include:
9+
10+
- Layered tool design culminating in a modular execution policy and reference command-line interface program.
11+
- A multi-threaded execution model constructed following the data flow programming paradigm.
12+
- Plugin, factory and configuration subsystems.
13+
- Components providing simulation, signal processing and physics reconstruction algorithms.
14+
- Suite of abstract interface classes.
15+
- Low level utility algorithms, data structures and streaming data I/O formats.
16+
17+
Additional "README" information is available in the WCT sub packages:
18+
19+
- [[file:apps/README.org][apps]]
20+
- [[file:aux/README.org][aux]]
21+
- [[file:cfg/README.org][cfg]]
22+
- [[file:cuda/README.org][cuda]]
23+
- [[file:gen/README.org][gen]]
24+
- [[file:iface/README.org][iface]]
25+
- [[file:img/README.org][img]]
26+
- [[file:pgraph/README.org][pgraph]]
27+
- [[file:pytorch/README.org][pytorch]]
28+
- [[file:root/README.org][root]]
29+
- [[file:sigproc/README.org][sigproc]]
30+
- [[file:sio/README.org][sio]]
31+
- [[file:tbb/README.org][tbb]]
32+
- [[file:test/README.org][test]]
33+
- [[file:util/README.org][util]]
34+
- [[file:waft/README.org][waft]]
35+
- [[file:zio/README.org][zio]]
36+
37+
See http://wirecell.bnl.gov/ for the home of Wire-Cell Toolkit documentation and news "blog".
838

939

1040
* Installation
1141

12-
Wire-Cell Toolkit provides simple and automatic installation which
13-
gives you, the installer, some options.
42+
Wire-Cell Toolkit provides simple and automated installation while allowing you to adapt it so you may provide the required dependencies in a variety of ways.
1443

1544
** External software dependencies
1645

17-
The WCT dependency tree:
46+
The WCT dependencies are curated and minimized with some required and some optional. Below shows the intra- and inter-package dependency tree:
1847

1948
[[file:wct-deps.png]]
2049

21-
Anything that the ~WireCellUtil~ package depends on is required. The
22-
rest are optional. Missing optional dependencies will cause the
23-
dependent WCT package to not be built.
50+
Black arrows are library dependencies, blue are for applications and gray are for testing programs. They represent compile/link time dependencies.
51+
52+
The dependencies for the ~WireCellUtil~ package are required. The rest are optional. Missing optional dependencies, or ones specifically turned off, will cause the dependent WCT package to not be built.
2453

2554
Some external dependencies have explicit minimum required versions:
2655

2756
- TBB (oneAPI) 2021.1.1
2857
- Boost 1.75.0
2958

30-
You may provide the necessary external software dependencies in a
31-
manner of your own choosing and some options include:
59+
You may provide the necessary external software dependencies in a manner of your own choosing and some options include:
3260

61+
- Packages provided by your OS or built "by hand".
3362
- [[https://github.com/WireCell/wire-cell-spack][Spack-based install]] automatically builds all (non-OS) externals and WCT itself
3463
- Some WCT releases are built at FNAL as a UPS product named =wirecell=.
35-
- Exploit the above with a [[https://github.com/WireCell/wire-cell-singularity][Singularity container and CVMFS]] (currently recommended)
64+
- Exploit the above with a [[https://github.com/WireCell/wire-cell-singularity][Singularity container and CVMFS]].
3665

3766
** Developer Source
3867

@@ -44,9 +73,7 @@ Developers check out =master= branch via SSH.
4473

4574
** User Source
4675

47-
Users typically should build a release branch, either the tip or a
48-
tagged release on that branch. Tagged releases are shown on the [[https://github.com/WireCell/wire-cell-toolkit/releases][this
49-
GitHub release page]].
76+
Users typically should build a release branch, either the tip or a tagged release on that branch. Tagged releases are shown on the [[https://github.com/WireCell/wire-cell-toolkit/releases][this GitHub release page]].
5077

5178
Users may also anonymously clone in the usual way:
5279

@@ -62,16 +89,13 @@ On well-behaved systems, configuring the source may be as simple as:
6289
$ ./wcb configure --prefix=/path/to/install
6390
#+END_EXAMPLE
6491

65-
Software dependencies which can not automatically be located in system
66-
areas or via ~pkg-config~ can be manually specified. For a list of
67-
options run:
92+
Software dependencies which can not automatically be located in system areas or via ~pkg-config~ can be manually specified. For a list of options run:
6893

6994
#+BEGIN_EXAMPLE
7095
$ ./wcb --help
7196
#+END_EXAMPLE
7297

73-
Here is an example where some packages are found automatically and
74-
some need help and others are explicitly turned off:
98+
Here is an example where some packages are found automatically and some need help and others are explicitly turned off:
7599

76100
#+begin_example
77101
$ ./wcb configure \
@@ -89,69 +113,42 @@ some need help and others are explicitly turned off:
89113

90114
** Building
91115

92-
It is suggested to first build the code before running tests.
116+
The libraries and programs may be built with:
93117

94118
#+BEGIN_EXAMPLE
95-
$ ./wcb -p --notests
119+
$ ./wcb
96120
#+END_EXAMPLE
97121

98122
** Installing
99123

100-
To install the built toolkit and its configuration support files while
101-
still avoiding the tests do:
124+
To install:
102125

103126
#+BEGIN_EXAMPLE
104-
$ ./wcb -p --notests install
127+
$ ./wcb install
105128
#+END_EXAMPLE
106129

107-
Optionally, the *reference* configuration and data files for one or more
108-
supported experiments may be installed by giving naming them with the
109-
~--install-config~ option. A name matches a sub-directory under
110-
[[file:cfg/pgrapher/experiment/][cfg/pgrapher/experiment/]] or the special ~all~ name will install all.
130+
Optionally, the *reference* configuration and data files for one or more supported experiments may be installed by giving naming them with the ~--install-config~ option. A name matches a sub-directory under [[file:cfg/pgrapher/experiment/][cfg/pgrapher/experiment/]] or the special ~all~ name will install all.
111131

112132
#+begin_example
113-
$ ./wcb -p --notests --install-config=<name> install
133+
$ ./wcb --install-config=<name> install
114134
#+end_example
115135

116136
** Testing
117137

118-
Running the tests can take a while but should be run on new
119-
installations and after any significant development. The developers
120-
try not to leave broken tests so any test failure should be treated as
121-
important. However, some tests require proper environment to run
122-
successfully. In particular, tests need to find Wire-Cell
123-
configuration and the shared libraries of the external software
124-
dependencies need to be located. Below shows an example:
138+
Running the tests can take a while but are off by default. They may be run with:
139+
#+begin_example
140+
$ ./wcb --tests
141+
#+end_example
125142

126-
#+BEGIN_EXAMPLE
127-
$ export WIRECELL_PATH=$HOME/dev/wct/wire-cell-data:$HOME/dev/wct/wire-cell-toolkit/cfg
128-
$ export LD_LIBRARY_PATH=$HOME/dev/wct/install/lib:$HOME/opt/jsonnet/lib
129-
$ ./wcb -p --alltests
130-
...
131-
execution summary
132-
tests that pass 83/83
133-
...
134-
tests that fail 0/83
135-
'build' finished successfully (15.192s)
136-
#+END_EXAMPLE
143+
See [[file:tests/README.org]] for more details on testing.
137144

138145
* Release management
139146

140-
To make releases, the above details are baked into two test scripts
141-
[[https://github.com/WireCell/waf-tools/blob/master/make-release.sh][make-release.sh]] and [[https://github.com/WireCell/waf-tools/blob/master/test-release.sh][test-release.sh]]. See comments at the top of each
142-
for how to run them. These scripts can be used by others but are
143-
meant for developers to make official releases.
144-
145-
* Meta
146-
147-
A new =wcb= build script is made from [[https://github.com/waf-project/waf][waf source]] via:
147+
WCT uses an ~X.Y.Z~ version string. While ~X=0~, a ~0.Y.0~ version indicates a new release that may extend or break API or ABI compared to ~Y-1~. A ~Z>0~ indicates a bug fix to ~Z-1~ which should otherwise retain the API and ABI. Bug fixes will be made on a branch rooted on ~0.X.0~ called ~0.X.x~.
148148

149-
#+BEGIN_EXAMPLE
150-
$ cd waf-tools
151-
$ ./refresh-wcb -o /path/to/wire-cell-toolkit/wcb
152-
$ cd /path/to/wire-cell-toolkit/
153-
$ git commit -am "update wcb" && git push
154-
#+END_EXAMPLE
149+
To make releases, the above details are baked into two test scripts [[https://github.com/WireCell/waf-tools/blob/master/make-release.sh][make-release.sh]] and [[https://github.com/WireCell/waf-tools/blob/master/test-release.sh][test-release.sh]]. See comments at the top of each for how to run them. These scripts can be used by others but are meant for developers to make official releases.
155150

151+
* Meta
156152

153+
Prior to 0.25.0, ~wcb~ was a custom version of [[https://waf.io][Waf]] and is now simply a copy of ~waf~. The customized tools are held in the [[file:waft/]] directory.
157154

apps/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

apps/README.org

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
#+title: Wire Cell Toolkit Apps
2+
#+SETUPFILE: ../setup-readme.org
3+
4+
5+
* Overview
6+
7+
This package provides toolkit layers at the top of an application
8+
stack. This includes
9+
10+
- main command line programs, in particular ~wire-cell~.
11+
12+
- a ~Main~ class used in CLI and other application interfaces (such as /art/).
13+
14+
- a few so called "apps" which are WCT components that provide a
15+
high-level execution policy. See also ~TbbFlow~ in sub package ~tbb~
16+
and ~Pgrapher~ in
17+
18+
* Programs
19+
20+
** ~wire-cell~
21+
22+
The ~wire-cell~ command line program provides a "reference" application
23+
of the toolkit. It is a generic, "policy free" program that is fully
24+
driven by configuration.
25+
26+
#+begin_src bash :results output
27+
wire-cell --help
28+
wire-cell --version
29+
#+end_src
30+
31+
#+RESULTS:
32+
#+begin_example
33+
Command line interface to the Wire-Cell Toolkit
34+
35+
Usage:
36+
wire-cell [options] [configuration ...]
37+
38+
Options:
39+
-h [ --help ] produce help message
40+
-l [ --logsink ] arg set log sink as <filename> or 'stdout' or 'stderr', a
41+
log level for the sink may be given by appending
42+
':<level>'
43+
-L [ --loglevel ] arg set lowest log level for a log in form 'name:level' or
44+
just give 'level' value for all (level one of:
45+
critical,error,warn,info,debug,trace)
46+
-a [ --app ] arg application component to invoke
47+
-c [ --config ] arg provide a configuration file
48+
-p [ --plugin ] arg specify a plugin as name[:lib]
49+
-V [ --ext-str ] arg specify a Jsonnet external variable=<string>
50+
-C [ --ext-code ] arg specify a Jsonnet external variable=<code>
51+
-A [ --tla-str ] arg specify a Jsonnet top level arguments variable=<string>
52+
--tla-code arg specify a Jsonnet top level arguments variable=<code>
53+
-P [ --path ] arg add to JSON/Jsonnet search path
54+
-t [ --threads ] arg limit number of threads used
55+
-v [ --version ] print the compiled version to stdout
56+
57+
0.24.0-33-gf9d92c77
58+
#+end_example
59+
60+
** ~wcsonnet~
61+
62+
The ~wcsonnet~ program is a thin wrapper around the Jsonnet library used to build WCT. It can be preferable to the standard ~jsonnet~ program for the following reasons:
63+
64+
- It uses the Go Jsonnet library which is substantially faster than the C/C++ library used by ~jsonnet~.
65+
- It honors the ~WIRECELL_PATH~ to locate files.
66+
67+
#+begin_src shell :results output
68+
wcsonnet --help
69+
#+end_src
70+
71+
#+RESULTS:
72+
#+begin_example
73+
wcsonnet is a Wire-Cell Toolkit aware Jsonnet compiler
74+
Usage: wcsonnet [OPTIONS] [file]
75+
76+
Positionals:
77+
file TEXT Jsonnet file to compile
78+
79+
Options:
80+
-h,--help Print this help message and exit
81+
-o,--output TEXT Output file
82+
-P,--path TEXT ... Search paths to consider in addition to those in WIRECELL_PATH
83+
-V,--ext-str TEXT ... Jsonnet external variable as <name>=<string>
84+
-C,--ext-code TEXT ... Jsonnet external code as <name>=<string>
85+
-A,--tla-str TEXT ... Jsonnet level argument value <name>=<string>
86+
-S,--tla-code TEXT ... Jsonnet level argument code <name>=<string>
87+
88+
#+end_example
89+
90+
** ~wcwires~
91+
92+
One of the main input configurations to many WCT algorithms is the
93+
"wire geometry". This is typically an exhaustive list of wire (or
94+
strip) endpoints and their channel and other identifiers. In many
95+
cases, the "wires files" are provided with errors. They may not
96+
follow correct ordering conventions or they may have poor precision in
97+
wire endpoints. WCT provides a way to validate and correct the wire
98+
geometry when a "wires file" is read in and ~wcwires~ provides this
99+
functionality in a convenient command line interface.
100+
101+
#+begin_src shell :results output
102+
wcwires --help
103+
#+end_src
104+
105+
#+RESULTS:
106+
#+begin_example
107+
wcwires converts and validates Wire-Cell Toolkit wire descriptions
108+
Usage: wcwires [OPTIONS] [file]
109+
110+
Positionals:
111+
file TEXT wires file
112+
113+
Options:
114+
-h,--help Print this help message and exit
115+
-P,--path TEXT ... Search paths to consider in addition to those in WIRECELL_PATH
116+
-o,--output TEXT Write out a wires file (def=none)
117+
-c,--correction INT Correction level: 1=load,2=order,3=direction,4=pitch (def=4)
118+
-v,--validate Perform input validation (def=false)
119+
-f,--fail-fast Fail on first validation error (def=false)
120+
-e,--epsilon FLOAT Unitless relative error determining imprecision during validation (def=1e-6)
121+
122+
#+end_example
123+
124+
125+
* WCT ~Main~
126+
127+
WCT provides a C++ class called ~Main~ which may be used to easily integrate WCT functionality into other applications. The ~wire-cell~ program provides a command line interface to ~Main~. Likewise, the ~WCLS_tool~ in the ~larwirecell~ packages of LArSoft providse an /art/ / FHiCL interface to ~Main~.
128+
129+
* WCT "apps"
130+
131+
Finally, this package provides a number of simple WCT "apps" classes.
132+
Typically, one or more "app" instance is used via ~Main~ to provide some
133+
top-level execution. Provided here are ~ConfigDumper~ and ~NodeDumper~
134+
which are more examples than useful. See ~TbbFlow~ from the ~tbb~ sub
135+
package and ~Pgrapher~ from the ~pgraph~ package for the two most used
136+
apps.

apps/apps/wcsonnet.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ int main(int argc, char** argv)
3333
{
3434
CLI::App app{"wcsonnet is a Wire-Cell Toolkit aware Jsonnet compiler"};
3535

36-
std::string filename;
36+
std::string filename, output="/dev/stdout";
3737
std::vector<std::string> load_path, extvars, extcode, tlavars, tlacode;
3838

39+
app.add_option("-o,--output", output,
40+
"Output file");
3941
app.add_option("-P,--path", load_path,
4042
"Search paths to consider in addition to those in WIRECELL_PATH")->type_size(1)->allow_extra_args(false);
4143
app.add_option("-V,--ext-str", extvars,
@@ -86,7 +88,8 @@ int main(int argc, char** argv)
8688
m_tlavars, m_tlacode);
8789

8890
auto jdat = parser.load(filename);
89-
std::cout << jdat << std::endl;
91+
std::ofstream out(output);
92+
out << jdat << std::endl;
9093

9194
return 0;
9295
}

apps/apps/wire-cell.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ int main(int argc, char* argv[])
1515

1616
try {
1717
rc = m.cmdline(argc, argv);
18-
if (rc) {
19-
return rc;
18+
if (rc == 0) {
19+
m.initialize();
20+
m();
2021
}
21-
m.initialize();
22-
m();
2322
}
2423
catch (Exception& e) {
2524
cerr << errstr(e) << endl;

apps/inc/WireCellApps/Main.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ namespace WireCell {
3030
///
3131
/// Or, one can use subsequent methods for more fine-grained
3232
/// setup and execution.
33+
///
34+
/// Return code rc:
35+
/// rc = 1 : if --help or --version,
36+
/// rc = 0 : if normal running should commence
3337
int cmdline(int argc, char* argv[]);
3438

3539
/// Individual setup methods called by cmdline() or called

0 commit comments

Comments
 (0)