Skip to content

Commit f28aa1f

Browse files
committed
provDB commit freq is now an argument in chimbuko_config.sh
If commit freq is 0 the committer is now disabled sonata_profile_parse.pl can now parse profile data from margo state dumps provDB benchmark changes: Updated schema Can now request server does a margo state dump periodically Now outputs periodic perf data alongside full run perf stats Can now change perf write freq and directory from cmdline Perf info is now written by all ranks
1 parent 084a44d commit f28aa1f

5 files changed

Lines changed: 230 additions & 170 deletions

File tree

app/provdb_commit.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ int main(int argc, char** argv){
4545
int nshards = std::stoi(argv[2]);
4646
int freq_ms = std::stoi(argv[3]);
4747

48+
if(freq_ms == 0){
49+
progressStream << "ProvDB Commit freq==0, I am not needed. Done" << std::endl;
50+
return 0;
51+
}
52+
4853
std::string protocol = ADProvenanceDBengine::getProtocolFromAddress(addr);
4954
if(ADProvenanceDBengine::getProtocol().first != protocol){
5055
int mode = ADProvenanceDBengine::getProtocol().second;

app/sonata_profile_parse.pl

Lines changed: 74 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
#!/usr/bin/perl
22

33
$ARGC=scalar @ARGV;
4-
if($ARGC != 1){
5-
print "Usage: <script.pl> <filename.csv>\n";
4+
if($ARGC < 1){
5+
print "Usage: <script.pl> <filename.csv> <options>\n";
6+
print "Options:\n";
7+
print " -is_state_dump The file is a margo state dump\n";
68
exit -1;
79
}
810

911
$file = $ARGV[0];
12+
13+
$is_state_dump=0;
14+
for($i=1;$i<$ARGC;$i++){
15+
if($ARGV[$i] == "-is_state_dump"){ #file is generated by a margo state dump
16+
$is_state_dump = 1;
17+
}
18+
}
19+
1020
open(IN, $file);
1121

1222
#cf https://xgitlab.cels.anl.gov/sds/margo/blob/master/doc/instrumentation.md#generating-a-profile-and-topology-graph
@@ -15,54 +25,71 @@
1525
$i=0;
1626
$nrpc;
1727
%rpcnames = ();
28+
$active = 1;
29+
if($is_state_dump == 1){ #not active from the start
30+
$active = 0;
31+
}
1832

1933
while(<IN>){
2034
$line=$_;
21-
if($i==0){
22-
if(!($line=~m/(\d+)/)){
23-
print "Could not parse number of RPC names from line $line\n";
24-
exit -1;
25-
}else{
26-
$nrpc = $1;
27-
print "$nrpc RPCs\n";
28-
}
29-
}elsif($i==1){
30-
if(!($line=~m/\d+\,(.*)/)){
31-
print "Could not parse server IP from line $line\n";
32-
exit -1;
33-
}else{
34-
$ip = $1;
35-
print "IP $ip\n";
36-
}
37-
}elsif($i>=2 && $i<2+$nrpc){
38-
if(!($line=~m/(\w+)\,(.*)/)){
39-
print "Could not parse RPC hash/name from line $line\n";
40-
exit -1;
41-
}else{
42-
$hash = $1;
43-
$name = $2;
44-
print "$name -> $hash\n";
45-
$rpcnames{"$hash"} = $name;
46-
}
47-
}elsif( ($i -2 - $nrpc) % 2 == 0){
48-
#Even lines format is hash, avg, rpc_breadcrumb, addr_hash, origin_or_target, cumulative, _min, _max, count, abt_pool_size_hwm, abt_pool_size_lwm, abt_pool_size_cumulative, abt_pool_total_size_hwm, abt_pool_total_size_lwm, abt_pool_total
4935

50-
@vals = split('\s*,\s*', $line);
51-
if(scalar @vals != 15){
52-
print "Could not parse data line $line\n";
53-
exit -1;
54-
}
55-
$hash = $vals[0];
56-
if(!(exists $rpcnames{$hash})){
57-
print "Could not find hash '$hash' in map\n";
58-
exit -1;
59-
}
60-
$name = $rpcnames{$hash};
61-
$avg = $vals[1];
62-
$count = $vals[8];
63-
$total = $vals[5];
64-
$loc = $vals[4];
65-
print "Func $name Origin/Target $loc Avg $avg Count $count Total $total\n";
36+
if($active == 1){
37+
if($is_state_dump == 1 && $line=~m/^$/){
38+
$active = 0;
39+
}elsif($i==0){
40+
if(!($line=~m/(\d+)/)){
41+
print "Could not parse number of RPC names from line $line\n";
42+
exit -1;
43+
}else{
44+
$nrpc = $1;
45+
print "$nrpc RPCs\n";
46+
}
47+
}elsif($i==1){
48+
if(!($line=~m/\d+\,(.*)/)){
49+
print "Could not parse server IP from line $line\n";
50+
exit -1;
51+
}else{
52+
$ip = $1;
53+
print "IP $ip\n";
54+
}
55+
}elsif($i>=2 && $i<2+$nrpc){
56+
if(!($line=~m/(\w+)\,(.*)/)){
57+
print "Could not parse RPC hash/name from line $line\n";
58+
exit -1;
59+
}else{
60+
$hash = $1;
61+
$name = $2;
62+
print "$name -> $hash\n";
63+
$rpcnames{"$hash"} = $name;
64+
}
65+
}elsif( ($i -2 - $nrpc) % 2 == 0){
66+
#Even lines format is hash, avg, rpc_breadcrumb, addr_hash, origin_or_target, cumulative, _min, _max, count, abt_pool_size_hwm, abt_pool_size_lwm, abt_pool_size_cumulative, abt_pool_total_size_hwm, abt_pool_total_size_lwm, abt_pool_total
67+
68+
@vals = split('\s*,\s*', $line);
69+
if(scalar @vals != 15){
70+
print "Could not parse data line $line\n";
71+
exit -1;
72+
}
73+
$hash = $vals[0];
74+
if(!(exists $rpcnames{$hash})){
75+
print "Could not find hash '$hash' in map\n";
76+
exit -1;
77+
}
78+
$name = $rpcnames{$hash};
79+
$avg = $vals[1];
80+
$count = $vals[8];
81+
$total = $vals[5];
82+
$loc = $vals[4];
83+
print "Func $name Origin/Target $loc Avg $avg Count $count Total $total\n";
84+
}
85+
$i++;
86+
}elsif($line=~m/Margo RPC profiling/){
87+
#read 6 lines
88+
for($ii=0;$ii<6;$ii++){
89+
<IN>;
90+
}
91+
$active = 1;
6692
}
67-
$i++;
6893
}
94+
95+
close(IN);

0 commit comments

Comments
 (0)