Skip to content

Commit 9abc31a

Browse files
authored
Merge branch 'development' into development
2 parents 506e888 + a2711f3 commit 9abc31a

File tree

99 files changed

+1217
-4125
lines changed

Some content is hidden

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

99 files changed

+1217
-4125
lines changed

.containers/coatjava.Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#syntax=docker/dockerfile:1
2+
3+
FROM ubuntu:noble
4+
5+
LABEL name="coatjava"
6+
LABEL maintainer="Whitney Armstrong <[email protected]>"
7+
LABEL architecture="amd64"
8+
9+
USER root
10+
11+
12+
RUN apt update && apt upgrade -y
13+
RUN apt install cmake vim maven groovy git ca-certificates wget curl python-is-python3 \
14+
openjdk-17-jdk openjdk-17-jre openjdk-17-jdk-headless openjdk-17-jre-headless \
15+
python3-sqlalchemy -y && update-ca-certificates
16+
17+
# CA certificates
18+
ADD https://pki.jlab.org/JLabCA.crt /etc/ssl/certs/JLabCA.crt
19+
#RUN trust anchor --store /image/JLabCA.crt
20+
21+
ARG REF_NAME=development
22+
# build coatjava
23+
RUN java --version && cd /opt && \
24+
git clone https://code.jlab.org/hallb/alert/coatjava.git && cd coatjava && \
25+
git fetch origin && git checkout ${REF_NAME} && ./build-coatjava.sh --nomaps

.gitlab-ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
workflow:
2+
rules:
3+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
4+
- if: '$CI_PIPELINE_SOURCE == "web"'
5+
- if: '$CI_PIPELINE_SOURCE == "webide"'
6+
- if: '$CI_COMMIT_BRANCH == "master"'
7+
- if: '$CI_COMMIT_BRANCH == "development"'
8+
- if: '$CI_COMMIT_TAG'
9+
10+
default:
11+
image: ubuntu:noble
12+
retry: 2
13+
14+
coatjava_build:
15+
image: gcr.io/kaniko-project/executor:debug
16+
script:
17+
- echo "${CI_COMMIT_REF_NAME}"
18+
- >-
19+
/kaniko/executor
20+
--context $CI_PROJECT_DIR/docker
21+
--dockerfile $CI_PROJECT_DIR/.containers/coatjava.Dockerfile
22+
--destination $CI_REGISTRY_IMAGE/coatjava:${CI_COMMIT_REF_NAME}
23+
--build-arg REF_NAME=${CI_COMMIT_REF_NAME}
24+
25+
alert_testing:
26+
needs: ["coatjava_build"]
27+
variables:
28+
REF_NAME: "$CI_COMMIT_REF_NAME"
29+
trigger:
30+
project: hallb/alert/c12
31+
strategy: depend

bin/hipo-multi-merge

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'optparse'
4+
require 'ostruct'
5+
require 'fileutils'
6+
7+
def print_log(name, val)
8+
puts name.rjust(30) + " = #{val}"
9+
end
10+
11+
# user options
12+
@args = OpenStruct.new
13+
@args.inputs = nil
14+
@args.output_dir = nil
15+
@args.prefix = nil
16+
@args.num_merge = nil
17+
@args.use_batch = false
18+
@args.dry_run = false
19+
OptionParser.new do |o|
20+
o.banner = '''
21+
This tool merges a set of input HIPO files to a set of output HIPO files,
22+
where you may control the number of input files per output file; for example,
23+
use this tool if you have 1000 small HIPO files but would rather have 10
24+
large HIPO files.
25+
'''
26+
o.separator "USAGE: #{$0} [OPTIONS]..."
27+
o.separator ''
28+
o.separator 'REQUIRED OPTIONS:'
29+
o.on('-i', '--input INPUTS', 'input directory or file glob;', 'surround file glob in quotes') { |a| @args.inputs = a }
30+
o.on('-o', '--output OUTPUT_DIR', 'output directory') { |a| @args.output_dir = a }
31+
o.on('-p', '--prefix OUTPUT_PREFIX', 'output filename prefix; names will be:', ' [OUTPUT_DIR]/[OUTPUT_PREFIX]_#####.hipo') { |a| @args.prefix = a }
32+
o.on('-n', '--num NUM_FILES', 'number of files per output merged file') { |a| @args.num_merge = a.to_i }
33+
o.separator ''
34+
o.separator 'OPTIONAL OPTIONS:'
35+
o.on('-b', '--batch', 'submit jobs to Slurm', '(default is sequential jobs)') { |a| @args.use_batch = true }
36+
o.on('-d', '--dry-run', 'just print what would be done') { |a| @args.dry_run = true }
37+
o.on_tail('-h', '--help', 'show this message') do
38+
puts o
39+
exit
40+
end
41+
end.parse! ARGV.empty? ? ['--help'] : ARGV
42+
43+
# check required options
44+
if [@args.inputs, @args.output_dir, @args.prefix, @args.num_merge].include? nil
45+
raise 'missing required option(s;) re-run with "--help" for guidance.'
46+
end
47+
raise 'option "--num" must be greater than zero' unless @args.num_merge > 0
48+
49+
# glob inputs
50+
input_glob = File.expand_path @args.inputs
51+
input_glob = File.join input_glob, "*.hipo" if File.directory? input_glob
52+
print_log 'input glob', input_glob
53+
print_log 'output dir', @args.output_dir
54+
print_log 'output prefix', @args.prefix
55+
print_log 'num files per output', @args.num_merge
56+
57+
# chunks
58+
input_files = Dir.glob input_glob
59+
raise "no input files found with glob '#{input_glob}'" if input_files.empty?
60+
input_chunks = input_files.each_slice(@args.num_merge).to_a
61+
print_log 'num input files', input_files.size
62+
print_log 'num output files', input_chunks.size
63+
raise 'option "--num" >= num input files, therefore there is nothing to do' if input_chunks.size == 1
64+
65+
# build commands
66+
puts "="*82
67+
merge_cmds = input_chunks.each_with_index.map do |input_chunk, chunk_num|
68+
out_name = File.join @args.output_dir, "#{@args.prefix}_#{chunk_num.to_s.rjust(5, '0')}.hipo"
69+
raise "output file #{out_name} already exists; cannot overwrite! delete it or choose another path/name" if File.exist? out_name
70+
[ 'hipo-utils', '-merge', '-o', out_name, *input_chunk ].join ' '
71+
end
72+
73+
# sbatch commands
74+
if @args.use_batch
75+
sbatch_args = {
76+
'job-name' => "hipo_multi_merge___#{@args.prefix}",
77+
'account' => 'clas12',
78+
'partition' => 'production',
79+
'mem-per-cpu' => 500,
80+
'time' => '1:00:00',
81+
'ntasks' => 1,
82+
'cpus-per-task' => 1,
83+
}.map{ |opt, val| "--#{opt}=#{val.to_s}" }
84+
exe_cmds = merge_cmds.each_with_index.map do |merge_cmd, job_num|
85+
log_name = "/farm_out/%u/%x_#{job_num.to_s.rjust(5, '0')}"
86+
[
87+
'sbatch',
88+
*sbatch_args,
89+
"--output=#{log_name}.out",
90+
"--error=#{log_name}.err",
91+
"--wrap='#{merge_cmd}'",
92+
].join ' '
93+
end
94+
else
95+
exe_cmds = merge_cmds
96+
end
97+
98+
# execute
99+
if @args.dry_run
100+
puts 'THIS IS JUST A DRY RUN. Here are the commands which would be executed:'
101+
puts "="*82
102+
puts "mkdir -p #{@args.output_dir}"
103+
exe_cmds.each do |cmd| puts cmd end
104+
else
105+
FileUtils.mkdir_p @args.output_dir
106+
exe_cmds.each do |cmd| system cmd end
107+
end

bin/run-clara

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ do
3434
p) prefix=$OPTARG ;;
3535
c) CLARA_HOME=$OPTARG ;;
3636
t) threads=$OPTARG && echo $threads | grep -q -E '^[0-9]+$' || error "-t must be an integer, threads" ;;
37-
n) nevents="-e $OPTARG" && echo $nevents | grep -q -E '^-e [0-9]+$' || error "-n must be an integer, events" ;;
37+
n) nevents="-e $OPTARG" && echo "$nevents" | grep -q -E '^-e [0-9]+$' || error "-n must be an integer, events" ;;
3838
m) merge=1 ;;
3939
h) echo -e "\n$usage" && echo -e $info && exit 0 ;;
4040
esac

common-tools/clara-io/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.jlab.clas</groupId>
55
<artifactId>clara-io</artifactId>
6-
<version>11.0.3-SNAPSHOT</version>
6+
<version>11.0.5-SNAPSHOT</version>
77
<packaging>jar</packaging>
88

99
<parent>
1010
<groupId>org.jlab.clas</groupId>
1111
<artifactId>clas12rec</artifactId>
1212
<relativePath>../../parent/pom.xml</relativePath>
13-
<version>11.0.3-SNAPSHOT</version>
13+
<version>11.0.5-SNAPSHOT</version>
1414
</parent>
1515

1616
<dependencies>

common-tools/clas-analysis/pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,63 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.jlab.clas</groupId>
55
<artifactId>clas-analysis</artifactId>
6-
<version>11.0.3-SNAPSHOT</version>
6+
<version>11.0.5-SNAPSHOT</version>
77
<packaging>jar</packaging>
88

99
<parent>
1010
<groupId>org.jlab.clas</groupId>
1111
<artifactId>clas12rec</artifactId>
1212
<relativePath>../../parent/pom.xml</relativePath>
13-
<version>11.0.3-SNAPSHOT</version>
13+
<version>11.0.5-SNAPSHOT</version>
1414
</parent>
1515

1616
<dependencies>
1717
<dependency>
1818
<groupId>org.jlab.clas</groupId>
1919
<artifactId>clas-utils</artifactId>
20-
<version>11.0.3-SNAPSHOT</version>
20+
<version>11.0.5-SNAPSHOT</version>
2121
</dependency>
2222

2323
<dependency>
2424
<groupId>org.jlab.clas</groupId>
2525
<artifactId>clas-physics</artifactId>
26-
<version>11.0.3-SNAPSHOT</version>
26+
<version>11.0.5-SNAPSHOT</version>
2727
</dependency>
2828

2929
<dependency>
3030
<groupId>org.jlab.clas</groupId>
3131
<artifactId>clas-io</artifactId>
32-
<version>11.0.3-SNAPSHOT</version>
32+
<version>11.0.5-SNAPSHOT</version>
3333
</dependency>
3434

3535
<dependency>
3636
<groupId>org.jlab.clas</groupId>
3737
<artifactId>clas-geometry</artifactId>
38-
<version>11.0.3-SNAPSHOT</version>
38+
<version>11.0.5-SNAPSHOT</version>
3939
</dependency>
4040

4141
<dependency>
4242
<groupId>org.jlab.clas</groupId>
4343
<artifactId>clas-jcsg</artifactId>
44-
<version>11.0.3-SNAPSHOT</version>
44+
<version>11.0.5-SNAPSHOT</version>
4545
</dependency>
4646

4747
<dependency>
4848
<groupId>org.jlab.clas</groupId>
4949
<artifactId>swim-tools</artifactId>
50-
<version>11.0.3-SNAPSHOT</version>
50+
<version>11.0.5-SNAPSHOT</version>
5151
</dependency>
5252

5353
<dependency>
5454
<groupId>org.jlab.clas</groupId>
5555
<artifactId>clas-detector</artifactId>
56-
<version>11.0.3-SNAPSHOT</version>
56+
<version>11.0.5-SNAPSHOT</version>
5757
</dependency>
5858

5959
<dependency>
6060
<groupId>org.jlab.clas</groupId>
6161
<artifactId>clas-reco</artifactId>
62-
<version>11.0.3-SNAPSHOT</version>
62+
<version>11.0.5-SNAPSHOT</version>
6363
</dependency>
6464
</dependencies>
6565

common-tools/clas-detector/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.jlab.clas</groupId>
55
<artifactId>clas-detector</artifactId>
6-
<version>11.0.3-SNAPSHOT</version>
6+
<version>11.0.5-SNAPSHOT</version>
77
<packaging>jar</packaging>
88

99
<parent>
1010
<groupId>org.jlab.clas</groupId>
1111
<artifactId>clas12rec</artifactId>
1212
<relativePath>../../parent/pom.xml</relativePath>
13-
<version>11.0.3-SNAPSHOT</version>
13+
<version>11.0.5-SNAPSHOT</version>
1414
</parent>
1515

1616
<dependencies>
1717
<dependency>
1818
<groupId>org.jlab.clas</groupId>
1919
<artifactId>clas-utils</artifactId>
20-
<version>11.0.3-SNAPSHOT</version>
20+
<version>11.0.5-SNAPSHOT</version>
2121
</dependency>
2222

2323
<dependency>
@@ -29,13 +29,13 @@
2929
<dependency>
3030
<groupId>org.jlab.clas</groupId>
3131
<artifactId>clas-io</artifactId>
32-
<version>11.0.3-SNAPSHOT</version>
32+
<version>11.0.5-SNAPSHOT</version>
3333
</dependency>
3434

3535
<dependency>
3636
<groupId>org.jlab.clas</groupId>
3737
<artifactId>clas-geometry</artifactId>
38-
<version>11.0.3-SNAPSHOT</version>
38+
<version>11.0.5-SNAPSHOT</version>
3939
</dependency>
4040
</dependencies>
4141

common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public enum DetectorType {
2929
BAND (21, "BAND"),
3030
RASTER (22, "RASTER"),
3131
URWELL (23, "URWELL"),
32+
AHDC (24, "AHDC"),
33+
ATOF (25, "ATOF"),
3234
TARGET (100, "TARGET"),
3335
MAGNETS (101, "MAGNETS"),
3436
ECIN (110, "ECIN"),

0 commit comments

Comments
 (0)