Skip to content

Commit 0f909d3

Browse files
committed
Merge branch 'develop' into ckelly_develop
2 parents 2827317 + ccc9226 commit 0f909d3

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

src/ad/ADOutlier.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,17 @@ unsigned long ADOutlierCOPOD::compute_outliers(Anomalies &outliers,
592592
std::vector<double> recon_p_runtimes = std::vector<double>(tot_runtimes, 0.0);
593593
std::vector<double> recon_n_runtimes = std::vector<double>(tot_runtimes, 0.0);
594594
int recon_idx = 0;
595+
//verboseStream << "Unwrapping Merged Histogram. Size: " << param[func_id].counts().size() << std::endl;
595596
for(int i=0; i < param[func_id].counts().size(); i++){
596597
int count = param[func_id].counts().at(i);
598+
//verboseStream << "Count: " << count << ", Value: " << param[func_id].bin_edges().at(i) << std::endl;
597599
for(int j=0; j<count; j++){
598-
recon_p_runtimes.at(recon_idx++) = param[func_id].bin_edges().at(i);
599-
recon_n_runtimes.at(recon_idx++) = -1 * param[func_id].bin_edges().at(i);
600+
601+
recon_p_runtimes.at(recon_idx) = param[func_id].bin_edges().at(i);
602+
recon_n_runtimes.at(recon_idx) = -1 * param[func_id].bin_edges().at(i);
603+
//verboseStream << "recon_p_runtimes.at(recon_idx): " << recon_p_runtimes.at(recon_idx) << ", recon_n_runtimes.at(recon_idx): " << recon_n_runtimes.at(recon_idx) << std::endl;
604+
//verboseStream << "recon_idx: " << recon_idx << std::endl;
605+
recon_idx++;
600606
}
601607
}
602608

@@ -664,8 +670,9 @@ unsigned long ADOutlierCOPOD::compute_outliers(Anomalies &outliers,
664670

665671
const double runtime_i = this->getStatisticValue(*itt); //runtimes.push_back(this->getStatisticValue(*itt));
666672
double ad_score;
667-
668-
if (mean_pn_ecdf.at(running_idx++) > 0)
673+
674+
//verboseStream << "mean_pn_ecdf.at(running_idx++): " << mean_pn_ecdf.at(running_idx) << std::endl;
675+
if (mean_pn_ecdf.at(running_idx++) < 0.99)
669676
ad_score = l_threshold + 1;
670677
else
671678
ad_score = l_threshold - 1;
@@ -686,8 +693,8 @@ unsigned long ADOutlierCOPOD::compute_outliers(Anomalies &outliers,
686693
//Capture maximum of one normal execution per io step
687694
itt->set_label(1);
688695
if(outliers.nFuncEvents(func_id, Anomalies::EventType::Normal) == 0) {
689-
verboseStream << "Detected normal event on func id " << func_id << " (" << itt->get_funcname() << ") on thread " << itt->get_tid() << " runtime " << runtime_i << std::endl;
690-
outliers.insert(itt, Anomalies::EventType::Normal);
696+
verboseStream << "Detected normal event on func id " << func_id << " (" << itt->get_funcname() << ") on thread " << itt->get_tid() << " runtime " << runtime_i << std::endl;
697+
outliers.insert(itt, Anomalies::EventType::Normal);
691698
}
692699

693700
}
@@ -720,9 +727,9 @@ int ADOutlierCOPOD::np_digitize_get_bin_inds(const double& X, const std::vector<
720727
}
721728

722729
std::vector<double> ADOutlierCOPOD::empiricalCDF(const std::vector<double>& runtimes, const bool sorted) {
723-
724-
std::vector<double> tmp_runtimes = runtimes;
725-
auto ecdf = boost::math::empirical_cumulative_distribution_function(std::move(tmp_runtimes));
730+
731+
std::vector<double> tmp_runtimes = runtimes;
732+
auto ecdf = boost::math::empirical_cumulative_distribution_function(std::move(tmp_runtimes));
726733
std::vector<double> result_ecdf = std::vector<double>(runtimes.size(), 0.0);
727734
for(int i=0; i < runtimes.size(); i++) {
728735
result_ecdf.at(i) = ecdf(runtimes.at(i));

src/param.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "chimbuko/param.hpp"
22
#include "chimbuko/param/sstd_param.hpp"
33
#include "chimbuko/param/hbos_param.hpp"
4+
#include "chimbuko/param/copod_param.hpp"
45
#include <chrono>
56

67
using namespace chimbuko;
@@ -17,6 +18,9 @@ ParamInterface *ParamInterface::set_AdParam(const std::string & ad_algorithm) {
1718
else if (ad_algorithm == "sstd" || ad_algorithm == "SSTD") {
1819
return new SstdParam();
1920
}
21+
else if (ad_algorithm == "copod" || ad_algorithm == "COPOD") {
22+
return new CopodParam();
23+
}
2024
else {
2125
return nullptr;
2226
}

0 commit comments

Comments
 (0)