Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ profile:
extends: .clon
allow_failure: true
script:
- ./clara/plugins/clas12/libexec/profile -e cpu run-clara -c ./clara -y ./etc/services/rgd-clarode.yml -o tmp1 -t 16 -l $EVIOFILE
- ./clara/plugins/clas12/libexec/profile -e alloc run-clara -c ./clara -y ./etc/services/rgd-clarode.yml -o tmp2 -t 16 -l $EVIOFILE
- ./clara/plugins/clas12/libexec/profile -e lock run-clara -c ./clara -y ./etc/services/rgd-clarode.yml -o tmp3 -t 16 -l $EVIOFILE
- ./clara/plugins/clas12/libexec/profile -e cpu -o _clara -- run-clara -c ./clara -y ./etc/services/rgd-clarode.yml -o tmp1 -t 16 -l $EVIOFILE
- ./clara/plugins/clas12/libexec/profile -e alloc -o _clara -- run-clara -c ./clara -y ./etc/services/rgd-clarode.yml -o tmp2 -t 16 -l $EVIOFILE
- ./clara/plugins/clas12/libexec/profile -e lock -o _clara -- run-clara -c ./clara -y ./etc/services/rgd-clarode.yml -o tmp3 -t 16 -l $EVIOFILE
artifacts:
when: always
expire_in: 1 week
Expand All @@ -197,7 +197,7 @@ scaling:
when: always
expire_in: 1 week
paths:
- scaling.svg
- scaling*.svg

pages:
stage: deploy
Expand All @@ -207,7 +207,7 @@ pages:
- cp -r pages public
- mkdir public/perf
- cp asprof*.html public/perf
- cp scaling.svg public/perf
- cp scaling*.svg public/perf
pages: true
artifacts:
expire_in: 1 week
Expand Down
12 changes: 8 additions & 4 deletions libexec/profile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ done
shift $((OPTIND-1))
executable=$1
arguments=${@:2}
logfile=asprof$stub.log
logfile=asprof_$event$stub.log

which asprof >& /dev/null
[ "$?" -ne 0 ] && echo 'ERROR: asprof is not in $PATH.' && echo -e $usage2 && exit 3
Expand All @@ -42,13 +42,17 @@ set -e
$executable $arguments >> $logfile 2>&1 &
set +e

# figure out the process id to profile:
pid_bash=$!
echo info: pid bash=$pid_bash, getting java ...
sleep 1
pid_java=$(pgrep -P $pid_bash)
sleep 1
# go 2 deep for run-clara:
pid_java=$(pgrep -P $pid_java | head -n 1)
if [[ "$executable" == *clara* ]]
then
# go 2 deep for run-clara:
sleep 1
pid_java=$(pgrep -P $pid_java | head -n 1)
fi
echo info: pid java=$pid_java
tail -f $logfile &
pid_tail=$!
Expand Down
18 changes: 9 additions & 9 deletions libexec/scaling
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ def cli():
cli.add_argument('-c','--clara', metavar='DIR',help='CLARA_HOME path (default=$CLARA_HOME)',default=os.getenv('CLARA_HOME',None))
cli.add_argument('-t','--threads',metavar='#',help='threads (default=8,16,24,34,44)',default='8,16,24,34,44')
cli.add_argument('-e','--events', metavar='#',help='events per thread (default=555)',default=555,type=int)
cli.add_argument('-N','--numa', metavar='#',help='restrict to a NUMA socket (choices=[0,1])',choices=[0,1])
cli.add_argument('-N','--numa', metavar='#',help='restrict to a NUMA socket (choices=[0,1])',choices=[0,1], type=int)
cli.add_argument('-C','--cpus', metavar='#',help='restrict to a CPU list (e.g. 0,1,2,3)')
cli.add_argument('-T','--cputhr', metavar='#',help='restrict to same number of CPUs as threads')
cli.add_argument('-T','--cputhr', help='restrict to same number of CPUs as threads',action='store_true')
cli.add_argument('datafile', help='input EVIO/HIPO data file')
cfg = cli.parse_args()
cfg.threads = cfg.threads.split(',')
if not cfg.clara:
cli.error('cannot find CLARA installation via -c or $CLARA_HOME')
elif shutil.which('run-clara'):
cfg.run_clara = shutil.which('run-clara')
elif os.path.exists(clara_home + '/plugins/clas12/bin/run-clara'):
cfg.run_clara = clara_home + '/plugins/clas12/bin/run-clara'
elif os.path.exists(cfg.clara + '/plugins/clas12/bin/run-clara'):
cfg.run_clara = cfg.clara + '/plugins/clas12/bin/run-clara'
else:
cli.error('cannot find run-clara in $PATH or $CLARA_HOME')
if cfg.cpus:
Expand Down Expand Up @@ -55,7 +55,7 @@ def benchmark(cfg, threads, log):
# use taskset for thread affinity:
if cfg.cpus:
if cfg.cputhr:
cmd.extend(['taskset','-c',','.join(cfg.cpus.split(',')[:threads])])
cmd.extend(['taskset','-c',','.join(cfg.cpus.split(',')[:int(threads)])])
else:
cmd.extend(['taskset','-c',cfg.cpus])
# add the run-clara command:
Expand Down Expand Up @@ -122,19 +122,19 @@ def show(benchmarks):
print(' '.join([str(x) for x in row]))

def save(benchmarks):
with open('scaling.txt','w') as f:
with open('scaling-clara.txt','w') as f:
for row in table(benchmarks):
f.write(' '.join([str(x) for x in row])+'\n')

def plot():
import os,shutil,subprocess
if shutil.which('gnuplot'):
g = os.path.dirname(os.path.abspath(__file__))+'/scaling.gpl'
r = subprocess.run(['gnuplot',g], capture_output=True, text=True)
r = subprocess.run(['gnuplot',g,'scaling-clara.txt'], capture_output=True, text=True)
if r.returncode == 0:
with open('scaling.svg','w') as f:
with open('scaling-clara.svg','w') as f:
f.write(r.stdout)
print('Info: created scaling.svg from scaling.txt and scaling.gpl!')
print('Info: created scaling-clara.svg from scaling-clara.txt and coatjava/libexec/scaling.gpl!')
else:
print(r.stdout)
print(r.stderr)
Expand Down
2 changes: 1 addition & 1 deletion libexec/scaling.gpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ set style line 37 pt 6 lt 1 lc rgb '#FDBF6F' # light orange
set style line 38 pt 6 lt 1 lc rgb '#FF7F00' # dark orange

# parse command line arguments:
datafile = 'scaling.txt'
datafile = 'scaling-clara.txt'
if (ARGC > 0) {
if (ARGV[1] eq "-u") {
uberMode = 1
Expand Down
Loading