Skip to content

Commit 96e4492

Browse files
committed
To main Chimbuko class, added the ability to pass a filename containing functions that are ignored by the AD
Added command line options to specify the above to driver and driver_multirank
1 parent 792bc94 commit 96e4492

4 files changed

Lines changed: 27 additions & 2 deletions

File tree

app/driver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ optionalArgsParser & getOptionalArgsParser(){
7676
addOptionalCommandLineArg(p, hbos_max_bins, "Set the maximum number of bins for histograms in the HBOS algorithm. Default 200.");
7777
addOptionalCommandLineArg(p, program_idx, "Set the index associated with the instrumented program. Use to label components of a workflow. (default 0)");
7878
addOptionalCommandLineArg(p, outlier_sigma, "Set the number of standard deviations that defines an anomalous event (default 6)");
79-
addOptionalCommandLineArg(p, func_threshold_file, "A filename containing HBOS/COPOD algorithm threshold overrides for specified functions. Format is JSON: \"[ { \"fname\": <FUNC>, \"threshold\": <THRES> },... ]\". Empty string (default) uses default threshold for all funcs");
79+
addOptionalCommandLineArg(p, func_threshold_file, "Provide the path to a file containing HBOS/COPOD algorithm threshold overrides for specified functions. Format is JSON: \"[ { \"fname\": <FUNC>, \"threshold\": <THRES> },... ]\". Empty string (default) uses default threshold for all funcs");
80+
addOptionalCommandLineArg(p, ignored_func_file, "Provide the path to a file containing function names (one per line) which the AD algorithm will ignore. All such events are labeled as normal. Empty string (default) performs AD on all events.");
8081
addOptionalCommandLineArg(p, net_recv_timeout, "Timeout (in ms) for blocking receives on client from parameter server (default 30000)");
8182
addOptionalCommandLineArg(p, pserver_addr, "Set the address of the parameter server. If empty (default) the pserver will not be used.");
8283
addOptionalCommandLineArg(p, hpserver_nthr, "Set the number of threads used by the hierarchical PS. This parameter is used to compute a port offset for the particular endpoint that this AD rank connects to (default 1)");

app/driver_multirank.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ optionalArgsParser & getOptionalArgsParser(){
5858
addOptionalCommandLineArg(p, program_idx, "Set the index associated with the instrumented program. Use to label components of a workflow. (default 0)");
5959
addOptionalCommandLineArg(p, outlier_sigma, "Set the number of standard deviations that defines an anomalous event (default 6)");
6060
addOptionalCommandLineArg(p, func_threshold_file, "A filename containing HBOS/COPOD algorithm threshold overrides for specified functions. Format is JSON: \"[ { \"fname\": <FUNC>, \"threshold\": <THRES> },... ]\". Empty string (default) uses default threshold for all funcs");
61+
addOptionalCommandLineArg(p, ignored_func_file, "Provide the path to a file containing function names (one per line) which the AD algorithm will ignore. All such events are labeled as normal. Empty string (default) performs AD on all events.");
6162
addOptionalCommandLineArg(p, net_recv_timeout, "Timeout (in ms) for blocking receives on client from parameter server (default 30000)");
6263
addOptionalCommandLineArg(p, pserver_addr, "Set the address of the parameter server. If empty (default) the pserver will not be used.");
6364
addOptionalCommandLineArg(p, hpserver_nthr, "Set the number of threads used by the hierarchical PS. This parameter is used to compute a port offset for the particular endpoint that this AD rank connects to (default 1)");

include/chimbuko/chimbuko.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ namespace chimbuko {
2626

2727
std::string func_threshold_file; /**< A filename containing HBOS/COPOD algorithm threshold overrides for specified functions. Format is JSON: "[ { "fname": <FUNC>, "threshold": <THRES> },... ]". Empty string (default) uses default threshold for all funcs*/
2828

29+
std::string ignored_func_file; /**< A filename containing function names (one per line) which the AD algorithm will ignore. All such events are labeled as normal. Empty string (default) performs AD on all events*/
30+
2931
//Parameters associated with communicating with the parameter server*/
3032
std::string pserver_addr; /**< The address of the parameter server.
3133
< If no parameter server is in use, this string should be empty (length zero)

src/chimbuko.cpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ ChimbukoParams::ChimbukoParams(): rank(-1234), //not set!
3434
analysis_step_freq(1),
3535
read_ignored_corrid_funcs(""),
3636
max_frames(-1),
37-
func_threshold_file("")
37+
func_threshold_file(""),
38+
ignored_func_file("")
3839
{}
3940

4041
void ChimbukoParams::print() const{
@@ -193,7 +194,10 @@ void Chimbuko::init_event(){
193194
m_event->ignoreCorrelationIDsForFunction(func);
194195
}
195196
in.close();
197+
}else{
198+
fatal_error("Failed to open ignored-corried-func file " + m_params.read_ignored_corrid_funcs);
196199
}
200+
197201
}
198202
}
199203

@@ -239,6 +243,23 @@ void Chimbuko::init_outlier(){
239243
m_outlier->linkExecDataMap(m_event->getExecDataMap()); //link the map of function index to completed calls such that they can be tagged as outliers if appropriate
240244
if(m_net_client) m_outlier->linkNetworkClient(m_net_client);
241245
m_outlier->linkPerf(&m_perf);
246+
247+
//Read ignored functions
248+
if(m_params.ignored_func_file.size()){
249+
std::ifstream in(m_params.ignored_func_file);
250+
if(in.is_open()) {
251+
std::string func;
252+
while (std::getline(in, func)){
253+
headProgressStream(m_params.rank) << "Skipping anomaly detection for function \"" << func << "\"" << std::endl;
254+
m_outlier->setIgnoreFunction(func);
255+
}
256+
in.close();
257+
}else{
258+
fatal_error("Failed to open ignored-func file " + m_params.ignored_func_file);
259+
}
260+
}
261+
262+
242263
}
243264

244265
void Chimbuko::init_counter(){

0 commit comments

Comments
 (0)