Skip to content

Commit c9a437a

Browse files
committed
Added debug option to driver to allow user to constrain writing of provDB output to a particular range of IO steps
1 parent 83d082e commit c9a437a

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

app/driver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ optionalArgsParser & getOptionalArgsParser(){
108108

109109
addOptionalCommandLineArg(p, outlier_statistic, "Set the statistic used for outlier detection. Options: exclusive_runtime (default), inclusive_runtime");
110110
addOptionalCommandLineArg(p, step_report_freq, "Set the steps between Chimbuko reporting IO step progress. Use 0 to deactivate this logging entirely (default 1)");
111+
addOptionalCommandLineArg(p, prov_record_startstep, "If != -1, the IO step on which to start recording provenance information for anomalies (for testing, default -1)");
112+
addOptionalCommandLineArg(p, prov_record_stopstep, "If != -1, the IO step on which to stop recording provenance information for anomalies (for testing, default -1)");
111113

112114
initialized = true;
113115
}

include/chimbuko/chimbuko.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ namespace chimbuko {
3636
int nprovdb_shards; /**< Number of database shards*/
3737
int nprovdb_instances; /**< Number of instances of the provenance database server*/
3838
#endif
39+
int prov_record_startstep; /**< If != -1, the IO step on which to start recording provenance information for anomalies */
40+
int prov_record_stopstep; /**< If != -1, the IO step on which to stop recording provenance information for anomalies */
3941

4042
unsigned int anom_win_size; /**< When anomaly data are recorded, a window of this size (in units of events) around the anomalous event are also recorded (used both for viz and provDB)*/
4143

src/chimbuko.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ ChimbukoParams::ChimbukoParams(): rank(-1234), //not set!
2323
provdb_addr_dir(""), nprovdb_shards(1), nprovdb_instances(1),
2424
#endif
2525
prov_outputpath(""),
26+
prov_record_startstep(-1),
27+
prov_record_stopstep(-1),
2628
perf_outputpath(""), perf_step(10),
2729
only_one_frame(false), interval_msec(0),
2830
err_outputpath(""), parser_beginstep_timeout(30), override_rank(false),
@@ -389,6 +391,10 @@ void Chimbuko::extractAndSendProvenance(const Anomalies &anomalies,
389391
const int step,
390392
const unsigned long first_event_ts,
391393
const unsigned long last_event_ts) const{
394+
//Optionally skip provenance data recording on certain steps
395+
if(m_params.prov_record_startstep != -1 && step < m_params.prov_record_startstep) return;
396+
if(m_params.prov_record_stopstep != -1 && step > m_params.prov_record_stopstep) return;
397+
392398
//Gather provenance data on anomalies and send to provenance database
393399
if(m_params.prov_outputpath.length() > 0
394400
#ifdef ENABLE_PROVDB

0 commit comments

Comments
 (0)