Skip to content

Commit c5ae8fc

Browse files
baltzelltongtongcao
authored andcommitted
Add asprof script and CI job (#939)
* rename * profiling * add decoder+recon-util job * fix
1 parent 0ce17d7 commit c5ae8fc

File tree

3 files changed

+67
-27
lines changed

3 files changed

+67
-27
lines changed

.gitlab-ci.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ eb:
104104
needs: [build]
105105
dependencies: [build]
106106
script:
107-
- >
108-
tar -xzf coatjava.tar.gz &&
109-
cd validation/advanced-tests &&
110-
./run-eb-tests.sh -100 ${ARG}
107+
- tar -xzf coatjava.tar.gz
108+
- cd validation/advanced-tests
109+
- ./run-eb-tests.sh -100 ${ARG}
111110
parallel:
112111
matrix:
113112
- ARG: electronproton
@@ -116,23 +115,34 @@ eb:
116115
- ARG: electronneutronC
117116
- ARG: electronFTpion
118117

118+
decoder:
119+
stage: test
120+
needs: [build,download]
121+
dependencies: [build,download]
122+
script:
123+
- tar -xzf clara.tar.gz
124+
- decoder -n 1000 -o clas_018779_00001.hipo clas_018779.evio.00001
125+
artifacts:
126+
when: always
127+
expire_in: 1 day
128+
paths:
129+
- clas_018779_00001.hipo
130+
119131
clara:
120-
allow_failure: true
121132
stage: test
122133
needs: [build,download]
123134
dependencies: [build,download]
124135
script:
125-
- tar -xzf clara.tar.gz && ls -l
136+
- tar -xzf clara.tar.gz
126137
- run-clara -v -c $CLARA_HOME -t $JL_RUNNER_AVAIL_CPU -y ./etc/services/rgd-clarode.yml -n 100 -o out clas_018779.evio.00001
127138

128139
profile:
129140
stage: test
130-
needs: [build]
131-
dependencies: [build]
141+
needs: [build,decoder]
142+
dependencies: [build,decoder]
132143
script:
133-
- >
134-
tar -xzf coatjava.tar.gz &&
135-
libexec/profile.sh
144+
- tar -xzf coatjava.tar.gz
145+
- libexec/profile -e cpu clas_018779_00001.hipo
136146

137147
deploy:
138148
stage: deploy

libexec/profile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# configure:
4+
event=cpu #nativemem
5+
format=flat
6+
nevents=1000
7+
seconds=12
8+
yaml=etc/services/data-ai-uber.yml
9+
while getopts y:n:f:e:s:h opt
10+
do
11+
case $opt in
12+
s) seconds=$OPTARG ;;
13+
y) yaml=$OPTARG ;;
14+
n) nevents=$OPTARG ;;
15+
f) format=$OPTARG ;;
16+
e) event=$OPTARG ;;
17+
h) echo "\nUsage: profile [-y YAML] [-n #] [-e EVENT] datafile" && exit 0 ;;
18+
esac
19+
done
20+
shift $((OPTIND-1))
21+
data=$1
22+
stub=$(basename $data)
23+
24+
which asprof >& /dev/null
25+
[ "$?" -ne 0 ] && echo 'ERROR: asprof is not in $PATH.' && exit 9
26+
27+
recon-util -y $yaml -n $nevents -o pro_$stub.hipo -i $data >& pro_$stub.log &
28+
pid_bash=$!
29+
30+
echo PID1=$pid_bash
31+
sleep 5
32+
pid_java=$(pgrep -P "$pid_bash")
33+
34+
echo PID2=$pid_java
35+
36+
ps waux && ps -p $pid
37+
38+
echo "Waiting for 60 seconds of CoatJava warmup ..."
39+
for x in $(seq 60); do let y=60-$x && echo -e -n "\r$y ..." && sleep 1; done
40+
41+
cat pro_$stub.log
42+
43+
asprof -e $event -d $seconds -o $format -f pro_${format}_${event}_$stub.html $pid_java
44+
45+
kill -9 $pid_java
46+

libexec/profile.sh

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

0 commit comments

Comments
 (0)