@@ -28,15 +28,16 @@ limitations under the License.
2828#include < string>
2929#include < vector>
3030
31- #include < boost/property_tree/json_parser.hpp>
32- #include < boost/property_tree/ptree.hpp>
3331#include " ConfigParser.hpp"
3432#include " StatsModules/IStatsModule.hpp"
35- #include " osp/bsp/model/BspInstance.hpp"
3633#include " osp/auxiliary/io/arch_file_reader.hpp"
3734#include " osp/auxiliary/io/general_file_reader.hpp"
35+ #include " osp/auxiliary/return_status.hpp"
36+ #include " osp/bsp/model/BspInstance.hpp"
37+ #include < boost/property_tree/json_parser.hpp>
38+ #include < boost/property_tree/ptree.hpp>
3839
39- // #define EIGEN_FOUND 1
40+ // #define EIGEN_FOUND 1
4041
4142#ifdef EIGEN_FOUND
4243#include < Eigen/Sparse>
@@ -83,7 +84,7 @@ class AbstractTestSuiteRunner {
8384
8485 if (write_target_object_to_file) {
8586 output_target_object_dir_path = parser.global_params .get_child (" scheduleDirectory" )
86- .get_value <std::string>();
87+ .get_value <std::string>();
8788 if (output_target_object_dir_path.substr (0 , 1 ) != " /" )
8889 output_target_object_dir_path = executable_dir + output_target_object_dir_path;
8990 if (!output_target_object_dir_path.empty () && !std::filesystem::exists (output_target_object_dir_path)) {
@@ -167,13 +168,13 @@ class AbstractTestSuiteRunner {
167168 }
168169 }
169170
170- virtual RETURN_STATUS compute_target_object_impl (const BspInstance<GraphType> &instance, std::unique_ptr<TargetObjectType>& target_object,
171- const pt::ptree &algo_config,
172- long long &computation_time_ms) = 0;
171+ virtual RETURN_STATUS compute_target_object_impl (const BspInstance<GraphType> &instance, std::unique_ptr<TargetObjectType> & target_object,
172+ const pt::ptree &algo_config,
173+ long long &computation_time_ms) = 0;
173174
174175 virtual void create_and_register_statistic_modules (const std::string &module_name) = 0;
175176
176- virtual void write_target_object_hook (const TargetObjectType&, const std::string &, const std::string &,
177+ virtual void write_target_object_hook (const TargetObjectType &, const std::string &, const std::string &,
177178 const std::string &) {
178179 } // default in case TargetObjectType cannot be written to file
179180
@@ -268,12 +269,12 @@ class AbstractTestSuiteRunner {
268269 SM_csc_int64 L_csc_int64{};
269270
270271 if constexpr (std::is_same_v<GraphType, sparse_matrix_graph_int32_t > || std::is_same_v<GraphType, sparse_matrix_graph_int64_t >) {
271- if (ext != " mtx" ){
272+ if (ext != " mtx" ) {
272273 log_stream << " Error: Only .mtx file is accepted for SpTRSV" << std::endl;
273274 return 0 ;
274275 }
275-
276- if constexpr (std::is_same_v<GraphType, sparse_matrix_graph_int32_t >){
276+
277+ if constexpr (std::is_same_v<GraphType, sparse_matrix_graph_int32_t >) {
277278 graph_status = Eigen::loadMarket (L_csr_int32, filename_graph);
278279 if (!graph_status) {
279280 std::cerr << " Failed to read matrix from " << filename_graph << std::endl;
@@ -297,7 +298,7 @@ class AbstractTestSuiteRunner {
297298 }
298299 } else {
299300#endif
300- graph_status = file_reader::readGraph (filename_graph, bsp_instance.getComputationalDag ());
301+ graph_status = file_reader::readGraph (filename_graph, bsp_instance.getComputationalDag ());
301302
302303#ifdef EIGEN_FOUND
303304 }
@@ -309,22 +310,20 @@ class AbstractTestSuiteRunner {
309310
310311 for (auto &algorithm_config_pair : parser.scheduler ) {
311312 const pt::ptree &algo_config = algorithm_config_pair.second ;
312-
313-
314313
315314 std::string current_algo_name = algo_config.get_child (" name" ).get_value <std::string>();
316315 log_stream << " Start Algorithm " + current_algo_name + " \n " ;
317316
318317 long long computation_time_ms;
319- std::unique_ptr<TargetObjectType> target_object;
320-
318+ std::unique_ptr<TargetObjectType> target_object;
319+
321320 RETURN_STATUS exec_status = compute_target_object_impl (bsp_instance, target_object, algo_config, computation_time_ms);
322321
323322 if (exec_status != RETURN_STATUS::OSP_SUCCESS && exec_status != RETURN_STATUS::BEST_FOUND) {
324323 if (exec_status == RETURN_STATUS::ERROR)
325324 log_stream << " Error computing with " << current_algo_name << " ." << std::endl;
326325 else if (exec_status == RETURN_STATUS::TIMEOUT)
327- log_stream << " Scheduler " << current_algo_name << " timed out." << std::endl;
326+ log_stream << " Scheduler " << current_algo_name << " timed out." << std::endl;
328327 continue ;
329328 }
330329
0 commit comments