Skip to content

Commit 35d8a42

Browse files
committed
ProvDB benchmark now formally disconnects from the provdb before destructor is called to ensure stats are written
ProvDB admin now dumps margo state when all clients have disconnected
1 parent 6aaa476 commit 35d8a42

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

app/provdb_admin.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,17 @@ void client_stop_rpc(const tl::request& req) {
107107

108108
margo_instance_id margo_id;
109109

110-
void margo_dump_rpc(const tl::request& req) {
111-
std::string fn = std::string("margo_dump.") + getDateTimeFileExt();
110+
void margo_dump(const std::string &stub){
111+
std::string fn = stub + "." + getDateTimeFileExt();
112112
progressStream << "ProvDB Admin: margo dump to " << fn << std::endl;
113113
margo_state_dump(margo_id, fn.c_str(), 0, nullptr);
114114
}
115115

116+
void margo_dump_rpc(const tl::request& req) {
117+
const static std::string stub("margo_dump");
118+
margo_dump(stub);
119+
}
120+
116121

117122

118123

@@ -291,6 +296,7 @@ int main(int argc, char** argv) {
291296
( !committer_has_connected || (committer_has_connected && !committer_connected) )
292297
){
293298
progressStream << "ProvDB Admin: detected all clients disconnected, shutting down" << std::endl;
299+
margo_dump("margo_dump_all_client_disconnected");
294300
break;
295301
}
296302
}
@@ -303,9 +309,11 @@ int main(int argc, char** argv) {
303309
}
304310

305311
progressStream << "ProvDB Admin: ending admin scope" << std::endl;
312+
margo_dump("margo_dump_end_admin_scope");
306313
}//admin scope
307314

308315
progressStream << "ProvDB Admin: ending provider scope" << std::endl;
316+
margo_dump("margo_dump_end_provide_scope");
309317
}//provider scope
310318

311319
progressStream << "ProvDB Admin: shutting down server engine" << std::endl;

app/sonata_profile_parse.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#cf https://xgitlab.cels.anl.gov/sds/margo/blob/master/doc/instrumentation.md#generating-a-profile-and-topology-graph
2323
#Generate profiles by setting env variable MARGO_ENABLE_PROFILING=1
24-
24+
#NB : Origin are clients and Target is the server
2525
$i=0;
2626
$nrpc;
2727
%rpcnames = ();

benchmark_suite/benchmark_provdb/benchmark_client.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,12 @@ int main(int argc, char **argv){
196196
}
197197
}//cycle loop
198198

199+
std::cout << "Rank " << rank << " disconnecting from server" << std::endl;
200+
provdb_client.disconnect(); //ensure data is written to stats
199201
stats.write();
200202

201203
MPI_Finalize();
202204

205+
std::cout << "Rank " << rank << " done" << std::endl;
203206
return 0;
204207
}

0 commit comments

Comments
 (0)