Skip to content

Commit d79cb3f

Browse files
committed
Updated benchmark_suite/zmq_worker_client client code to fix compile errors and updated chimbuko_config
Makefile of benchmark_suite/zmq_worker_client now automatically determines chimbuko install path
1 parent bfc3de0 commit d79cb3f

4 files changed

Lines changed: 21 additions & 16 deletions

File tree

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
SHELL := /bin/bash
2+
INSTALL := $(shell which provdb_admin | sed 's/provdb_admin//')
3+
INSTALL := ${INSTALL}../
4+
15
all: server client
26

37
server: server.cpp
4-
tau_cxx.sh -std=c++17 -O3 -g -D_USE_ZMQNET -D_PERF_METRIC -I/opt/chimbuko/ad/include -I/opt/chimbuko/ad/include/chimbuko/3rdparty -L/opt/chimbuko/ad/lib server.cpp -o server -lchimbuko -lstdc++fs
8+
tau_cxx.sh -std=c++17 -O3 -g -D_USE_ZMQNET -D_PERF_METRIC -I${INSTALL}/include -I${INSTALL}/include/chimbuko/3rdparty -L${INSTALL}/lib server.cpp -o server -lchimbuko -lstdc++fs
59
client: client.cpp
6-
tau_cxx.sh -std=c++17 -O3 -g -D_USE_ZMQNET -D_PERF_METRIC -I/opt/chimbuko/ad/include -I/opt/chimbuko/ad/include/chimbuko/3rdparty -L/opt/chimbuko/ad/lib client.cpp -o client -lchimbuko -lstdc++fs
10+
tau_cxx.sh -std=c++17 -O3 -g -D_USE_ZMQNET -D_PERF_METRIC -I${INSTALL}/include -I${INSTALL}/include/chimbuko/3rdparty -L${INSTALL}/lib client.cpp -o client -lchimbuko -lstdc++fs
711

812
clean:
913
rm -f client server

benchmark_suite/zmq_worker_client/chimbuko_config.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export C_FORCE_ROOT=1 #required only for docker runs, allows celery to execute p
1818
#General options for Chimbuko backend (pserver, ad, provdb)
1919
############################################################
2020
backend_root="infer" #The root install directory of the PerformanceAnalysis libraries. If set to "infer" it will be inferred from the path of the executables
21+
chimbuko_services="infer" #The location of the Chimbuko service script. If set to "infer" it will be inferred from backend_root
2122

2223
####################################
2324
#Options for the provenance database
@@ -29,6 +30,7 @@ provdb_engine="ofi+tcp;ofi_rxm" #the OFI libfabric provider used for the Mochi
2930
provdb_port=5000 #the port of the provenance database
3031
provdb_nthreads=4 #number of worker threads; should be >= the number of shards
3132
provdb_writedir=chimbuko/provdb #the directory in which the provenance database is written. Chimbuko creates chimbuko/provdb which can be used as a default
33+
provdb_commit_freq=10000 #frequency ms at which the provenance database is committed to disk. If set to 0 it will commit only at the end
3234

3335
#With "verbs" provider (used for infiniband, iWarp, etc) we need to also specify the domain, which can be found by running fi_info (on a compute node)
3436
provdb_domain=mlx5_0 #only needed for verbs provider <------------ ***SET ME (if using verbs)***
@@ -86,9 +88,6 @@ TAU_ADIOS2_FILE_PREFIX=tau-metrics #the prefix of tau adios2 files; full filena
8688

8789

8890

89-
90-
91-
9291
###########################################################################
9392
# NON-USER VARIABLES BELOW = DON'T MODIFY THESE!!
9493
###########################################################################
@@ -97,10 +96,13 @@ export TAU_ADIOS2_FILENAME="${TAU_ADIOS2_PATH}/${TAU_ADIOS2_FILE_PREFIX}"
9796

9897
if [[ ${backend_root} == "infer" ]]; then
9998
backend_root=$( readlink -f $(which provdb_admin | sed 's/provdb_admin//')/../ )
99+
fi
100100

101-
#Check run script exists
102-
if [ ! -f "${backend_root}/scripts/launch/run_services.sh" ]; then
103-
echo "Could not infer backend root directory: service script does not exist!"
101+
if [[ ${chimbuko_services} == "infer" ]]; then
102+
chimbuko_services="${backend_root}/scripts/launch/run_services.sh"
103+
if [ ! -f "${chimbuko_services}" ]; then
104+
echo "Could not infer service script location: service script does not exist at ${chimbuko_services}!"
104105
exit 1
105106
fi
106107
fi
108+

benchmark_suite/zmq_worker_client/client.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ void clientWait(int wait_ms){
1616
std::this_thread::sleep_for(std::chrono::milliseconds(wait_ms));
1717
}
1818

19-
void rpcWaitAndRespond(ADNetClient &client, int wait_ms){
20-
Message msg;
21-
msg.set_info(0,0, REQ_CMD, DEFAULT);
22-
msg.set_msg(std::to_string(wait_ms));
23-
client.send_and_receive(msg); //ignore return
19+
void rpcWaitAndRespond(ADThreadNetClient &client, int wait_ms){
20+
Message send, recv;
21+
send.set_info(0,0, REQ_CMD, DEFAULT);
22+
send.set_msg(std::to_string(wait_ms));
23+
client.send_and_receive(recv,send); //ignore return
2424
}
2525

2626
int main(int argc, char** argv){
@@ -34,7 +34,7 @@ int main(int argc, char** argv){
3434
Log << "Client executing with parameters: cycles=" << cycles << " cycle_time=" << cycle_time << "ms anom_freq=" << anom_freq << " anom_mult=" << anom_mult << std::endl;
3535

3636
Log << "connecting to server with address " << server_addr << std::endl;
37-
ADNetClient client;
37+
ADThreadNetClient client;
3838
client.connect_ps(0,0,server_addr);
3939

4040
for(int i=0;i<cycles;i++){

benchmark_suite/zmq_worker_client/run.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
set -e
33

44
rm -rf chimbuko
5-
rm -f provider.address
65

76
export CHIMBUKO_CONFIG=chimbuko_config.sh
87
source ${CHIMBUKO_CONFIG}
98

109
if (( 1 )); then
1110
echo "Running services"
12-
${backend_root}/scripts/launch/run_services.sh 2>&1 | tee services.log &
11+
${chimbuko_services} 2>&1 | tee services.log &
1312
echo "Waiting"
1413
while [ ! -f chimbuko/vars/chimbuko_ad_cmdline.var ]; do sleep 1; done
1514
ad_opts=$(cat chimbuko/vars/chimbuko_ad_opts.var)

0 commit comments

Comments
 (0)