Skip to content

Commit 36ec29d

Browse files
committed
Merge branch 'ckelly_develop' of https://github.com/CODARcode/PerformanceAnalysis into ckelly_develop
2 parents b5172a0 + 3066d73 commit 36ec29d

15 files changed

Lines changed: 187 additions & 24 deletions

File tree

app/provdb_admin.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ void client_stop_rpc(const tl::request& req) {
108108

109109
margo_instance_id margo_id;
110110

111+
#ifdef ENABLE_MARGO_STATE_DUMP
111112
void margo_dump(const std::string &stub){
112113
std::string fn = stub + "." + getDateTimeFileExt();
113114
progressStream << "ProvDB Admin: margo dump to " << fn << std::endl;
@@ -118,8 +119,7 @@ void margo_dump_rpc(const tl::request& req) {
118119
const static std::string stub("margo_dump");
119120
margo_dump(stub);
120121
}
121-
122-
122+
#endif
123123

124124

125125
struct ProvdbArgs{
@@ -229,9 +229,10 @@ int main(int argc, char** argv) {
229229
engine.define("committer_hello",committer_hello).disable_response();
230230
engine.define("committer_goodbye",committer_goodbye).disable_response();
231231
engine.define("stop_server",client_stop_rpc).disable_response();
232-
engine.define("margo_dump", margo_dump_rpc).disable_response();
233232
engine.define("connection_status", connection_status);
234-
233+
#ifdef ENABLE_MARGO_STATE_DUMP
234+
engine.define("margo_dump", margo_dump_rpc).disable_response();
235+
#endif
235236

236237
std::string addr = (std::string)engine.self(); //ip and port of admin
237238

@@ -325,7 +326,9 @@ int main(int argc, char** argv) {
325326
( !committer_has_connected || (committer_has_connected && !committer_connected) )
326327
){
327328
progressStream << "ProvDB Admin: detected all clients disconnected, shutting down" << std::endl;
329+
#ifdef ENABLE_MARGO_STATE_DUMP
328330
margo_dump("margo_dump_all_client_disconnected");
331+
#endif
329332
break;
330333
}
331334
}
@@ -338,11 +341,15 @@ int main(int argc, char** argv) {
338341
}
339342

340343
progressStream << "ProvDB Admin: ending admin scope" << std::endl;
344+
#ifdef ENABLE_MARGO_STATE_DUMP
341345
margo_dump("margo_dump_end_admin_scope");
346+
#endif
342347
}//admin scope
343348

344349
progressStream << "ProvDB Admin: ending provider scope" << std::endl;
350+
#ifdef ENABLE_MARGO_STATE_DUMP
345351
margo_dump("margo_dump_end_provide_scope");
352+
#endif
346353
}//provider scope
347354

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

app/provdb_dump_state.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using namespace chimbuko;
44

55
int main(int argc, char** argv){
66
#ifdef ENABLE_PROVDB
7+
# ifdef ENABLE_MARGO_STATE_DUMP
78
if(argc != 2){
89
std::cout << "Usage: provdb_dump_state <server address e.g. ofi+tcp;ofi_rxm://172.17.0.4:5000>" << std::endl;
910
return 1;
@@ -14,6 +15,10 @@ int main(int argc, char** argv){
1415
ad.disconnect();
1516

1617
return 0;
18+
# else
19+
std::cout << "Margo dump configuration option is disabled" << std::endl;
20+
return 1;
21+
# endif
1722
#else
1823
std::cout << "ProvDB not in use" << std::endl;
1924
return 1;

configure.ac

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ fi
142142
#AC_ARG_WITH([perf-metric], AS_HELP_STRING([--with-perf-metric], [Specify use of performance metrics]),[AC_DEFINE([_PERF_METRIC],[1],[Use performance metrics])],[])
143143
AC_ARG_WITH([perf-metric], AS_HELP_STRING([--with-perf-metric], [Specify use of performance metrics]),[PS_FLAGS+=" -D_PERF_METRIC"],[])
144144

145+
#Enable ProvdDB margo state dump (currently requires master branch of margo)
146+
AC_ARG_ENABLE([margo-state-dump],
147+
[AS_HELP_STRING([--enable-margo-state-dump], [Enable ProvdDB margo state dump (currently requires master branch of margo)] )],
148+
[AC_DEFINE([ENABLE_MARGO_STATE_DUMP],[1],[Use margo state dump])],
149+
[:]
150+
)
145151

146152
#Check for boost
147153
AC_ARG_WITH([boost], AS_HELP_STRING([--with-boost], [Specify Boost install directory]),[],[])
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM ubuntu:18.04
2+
3+
RUN mkdir -p /Downloads
4+
5+
#Setup a basic set of tools
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
RUN apt-get update && \
8+
apt-get install -y tzdata && \
9+
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
10+
dpkg-reconfigure --frontend noninteractive tzdata && \
11+
apt-get install -y build-essential wget git-core libtool libtool-bin \
12+
autoconf gfortran pkg-config \
13+
python3 python3-dev python3-pip python3-tk \
14+
psmisc iproute2 unzip vim gdb emacs-nox && \
15+
apt autoremove -y && \
16+
rm -rf /var/lib/apt/lists/*
17+
18+
#Install spack
19+
WORKDIR /spack
20+
RUN git clone https://github.com/spack/spack.git
21+
22+
SHELL ["/bin/bash", "-c"]
23+
24+
#Download Chimbuko source and Mochi source to get the repos
25+
RUN git clone https://github.com/mochi-hpc/mochi-spack-packages.git && \
26+
git clone https://github.com/CODARcode/PerformanceAnalysis.git -b ckelly_develop
27+
28+
RUN source /spack/spack/share/spack/setup-env.sh && \
29+
spack repo add PerformanceAnalysis/spack/repo/chimbuko && \
30+
spack repo add mochi-spack-packages
31+
32+
RUN source /spack/spack/share/spack/setup-env.sh && spack install chimbuko^py-setuptools-scm+toml

include/chimbuko/ad/ADProvenanceDBclient.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ namespace chimbuko{
9191
thallium::remote_procedure *m_client_hello; /**< RPC to register client with provDB */
9292
thallium::remote_procedure *m_client_goodbye; /**< RPC to deregister client with provDB */
9393
thallium::remote_procedure *m_stop_server; /** RPC to shutdown server*/
94+
#ifdef ENABLE_MARGO_STATE_DUMP
9495
thallium::remote_procedure *m_margo_dump; /** RPC to request the server dump its state*/
95-
96+
#endif
9697
bool m_perform_handshake; /**< Optionally disable the client->server registration */
9798

9899
PerfStats *m_stats; /**< Performance data gathering*/
@@ -106,7 +107,11 @@ namespace chimbuko{
106107
void sendMultipleDataAsync(const std::vector<std::string> &entries, const ProvenanceDataType type, OutstandingRequest *req = nullptr) const;
107108

108109
public:
109-
ADProvenanceDBclient(int rank): m_is_connected(false), m_rank(rank), m_client_hello(nullptr), m_client_goodbye(nullptr), m_stats(nullptr), m_stop_server(nullptr), m_margo_dump(nullptr), m_perform_handshake(true){}
110+
/**
111+
* @brief Constructor
112+
* @param The rank of the current process
113+
*/
114+
ADProvenanceDBclient(int rank);
110115

111116
~ADProvenanceDBclient();
112117

@@ -242,10 +247,12 @@ namespace chimbuko{
242247
*/
243248
void stopServer() const;
244249

250+
#ifdef ENABLE_MARGO_STATE_DUMP
245251
/**
246252
* @brief Issue an RPC request telling the server to dump its state
247253
*/
248254
void serverDumpState() const;
255+
#endif
249256

250257
};
251258

spack/environments/summit.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
spack:
22
specs:
3+
- py-setuptools-scm+toml
34
- adios2@2.7.1 build_type=Debug
45
- chimbuko-visualization2
56
- chimbuko-performance-analysis@ckelly_develop ^libzmq@4.3.3
@@ -23,9 +24,9 @@ spack:
2324
flags: {}
2425
spec: gcc@9.1.0
2526
repos:
26-
#=================== THIS PATH SHOULD BE SET TO POINT TO THE sds-repo DOWNLOADED FROM https://xgitlab.cels.anl.gov/sds/sds-repo
27-
- /autofs/nccs-svm1_home1/ckelly/install/sds/sds-repo
28-
#=================== THIS PATH SHOULD BE SET TO POINT TO THE repo/chimbuko SUBDIRECTORY OF THE CHIMBUKO AD SOURCE https://github.com/CODARcode/PerformanceAnalysis/
27+
#=================== THIS PATH SHOULD BE SET TO POINT TO THE mochi-spack-packages DOWNLOADED FROM https://github.com/mochi-hpc/mochi-spack-packages.git
28+
- /autofs/nccs-svm1_home1/ckelly/install/mochi-spack-packages
29+
#=================== THIS PATH SHOULD BE SET TO POINT TO THE repo/chimbuko SUBDIRECTORY OF THE CHIMBUKO AD SOURCE https://github.com/CODARcode/PerformanceAnalysis/ (git clone https://github.com/CODARcode/PerformanceAnalysis.git)
2930
- /autofs/nccs-svm1_home1/ckelly/src/AD/PerformanceAnalysis/spack/repo/chimbuko
3031
packages:
3132
all:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
2+
# Spack Project Developers. See the top-level COPYRIGHT file for details.
3+
#
4+
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
5+
6+
# ----------------------------------------------------------------------------
7+
# If you submit this package back to Spack as a pull request,
8+
# please first remove this boilerplate and all FIXME comments.
9+
#
10+
# This is a template package file for Spack. We've put "FIXME"
11+
# next to all the things you'll want to change. Once you've handled
12+
# them, you can save this file and test your package like this:
13+
#
14+
# spack install chimbuko
15+
#
16+
# You can edit this file again by typing:
17+
#
18+
# spack edit chimbuko
19+
#
20+
# See the Spack documentation for more information on packaging.
21+
# ----------------------------------------------------------------------------
22+
23+
from spack import *
24+
25+
26+
class Chimbuko(BundlePackage):
27+
"""A bundle package for the Chimbuko Performance Analysis software."""
28+
29+
homepage = "https://github.com/CODARcode/Chimbuko"
30+
31+
maintainers = ['giltirn', 'sandeepmittal']
32+
33+
version('main')
34+
35+
depends_on('chimbuko-performance-analysis')
36+
depends_on('chimbuko-visualization2')
37+

spack/repo/chimbuko/packages/py-flask-sqlalchemy/package.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class PyFlaskSqlalchemy(PythonPackage):
1212
homepage = "https://github.com/pallets/flask-sqlalchemy"
1313
git = "https://github.com/pallets/flask-sqlalchemy"
1414

15-
version('master', branch='master')
15+
#version('master', branch='master')
16+
version('main', branch='main')
1617

1718
depends_on('py-setuptools', type='build')
1819
depends_on('py-flask@1.0.4:', type=('build', 'run'))

src/ad/ADProvenanceDBclient.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ static void delete_rpc(thallium::remote_procedure* &rpc){
7272
delete rpc; rpc = nullptr;
7373
}
7474

75+
ADProvenanceDBclient::ADProvenanceDBclient(int rank): m_is_connected(false), m_rank(rank), m_client_hello(nullptr), m_client_goodbye(nullptr), m_stats(nullptr), m_stop_server(nullptr), m_perform_handshake(true)
76+
#ifdef ENABLE_MARGO_STATE_DUMP
77+
, m_margo_dump(nullptr)
78+
#endif
79+
{}
80+
7581

7682
void ADProvenanceDBclient::disconnect(){
7783
if(m_is_connected){
@@ -90,8 +96,9 @@ void ADProvenanceDBclient::disconnect(){
9096
delete_rpc(m_client_goodbye);
9197
}
9298
delete_rpc(m_stop_server);
99+
#ifdef ENABLE_MARGO_STATE_DUMP
93100
delete_rpc(m_margo_dump);
94-
101+
#endif
95102
m_is_connected = false;
96103
verboseStream << "ADProvenanceDBclient disconnected" << std::endl;
97104
}
@@ -153,7 +160,9 @@ void ADProvenanceDBclient::connect(const std::string &addr, const int nshards){
153160
}
154161

155162
m_stop_server = new thallium::remote_procedure(eng.define("stop_server").disable_response());
163+
#ifdef ENABLE_MARGO_STATE_DUMP
156164
m_margo_dump = new thallium::remote_procedure(eng.define("margo_dump").disable_response());
165+
#endif
157166

158167
m_is_connected = true;
159168
verboseStream << "DB client rank " << m_rank << " connected successfully to database" << std::endl;
@@ -355,11 +364,12 @@ void ADProvenanceDBclient::stopServer() const{
355364
m_stop_server->on(m_server)();
356365
}
357366

367+
#ifdef ENABLE_MARGO_STATE_DUMP
358368
void ADProvenanceDBclient::serverDumpState() const{
359369
verboseStream << "ADProvenanceDBclient requesting server dump its state" << std::endl;
360370
m_margo_dump->on(m_server)();
361371
}
362-
372+
#endif
363373

364374
#endif
365375

test/mainProvDBclient.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ bool fileExistsMatchingRegex(const std::string &dir, const std::regex &regex){
332332
return false;
333333
}
334334

335+
#ifdef ENABLE_MARGO_STATE_DUMP
335336
TEST(ADProvenanceDBclientTest, TestStateDump){
336337
if(rank == 0){
337338
std::regex fn(R"(margo_dump\.)");
@@ -360,7 +361,7 @@ TEST(ADProvenanceDBclientTest, TestStateDump){
360361
EXPECT_EQ(fail, false);
361362
}
362363
}
363-
364+
#endif
364365

365366

366367
int main(int argc, char** argv)

0 commit comments

Comments
 (0)