From b1003e8ccea4ed50d417d64391ea1d5f563637a4 Mon Sep 17 00:00:00 2001 From: Hua Xu <97185370+hxu65@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:22:40 -0600 Subject: [PATCH] Clean cout and remove CMake flag (#51) * remove the flag definition in src/CMakeList * clean cout and flag in CMake --------- Co-authored-by: unknown --- include/common/SQlite.h | 16 ---------------- src/CMakeLists.txt | 1 - tasks/coeus_mdm/include/coeus_mdm/coeus_mdm.h | 1 - tasks/coeus_mdm/src/coeus_mdm.cc | 1 - .../include/rankConsensus/rankConsensus.h | 2 -- 5 files changed, 21 deletions(-) diff --git a/include/common/SQlite.h b/include/common/SQlite.h index 7092815c..6698aa4c 100644 --- a/include/common/SQlite.h +++ b/include/common/SQlite.h @@ -28,7 +28,6 @@ class SQLiteWrapper { char* errMsg = 0; int rc = sqlite3_exec(db, sql.c_str(), callbackFunc, data, &errMsg); if (rc != SQLITE_OK) { - std::cerr << "MDM: SQL error: " << errMsg << std::endl; sqlite3_free(errMsg); return false; } @@ -55,13 +54,9 @@ class SQLiteWrapper { } void createTables(){ - std::cout << "MDM: table creation: " << getpid() << " "<< dbName << std::endl; createAppsTable(); - std::cout << "MDM: table APPS: " << getpid() << " " << dbName << std::endl; createBlobLocationsTable(); - std::cout << "MDM: table LOCATION: " << getpid() << " "<< dbName << std::endl; createVariableMetadataTable(); - std::cout << "MDM: table METADATA: " << getpid() << " "<< dbName << std::endl; } ~SQLiteWrapper() { @@ -87,7 +82,6 @@ class SQLiteWrapper { } void UpdateTotalSteps(const std::string& appName, int step) { - std::cout << "MDM: UpdateTotalSteps" << std::endl; sqlite3_stmt* stmt; const std::string insertOrUpdateSQL = "INSERT OR REPLACE INTO Apps (appName, TotalSteps) VALUES (?, ?);"; sqlite3_prepare_v2(db, insertOrUpdateSQL.c_str(), -1, &stmt, 0); @@ -138,7 +132,6 @@ class SQLiteWrapper { } void InsertBlobLocation(int step, int mpi_rank, const std::string& varName, const BlobInfo& blobInfo) { - std::cout << "MDM: InsertBlobLocation" << std::endl; sqlite3_stmt* stmt; const std::string insertOrUpdateSQL = "INSERT OR REPLACE INTO BlobLocations (step, mpi_rank, name, bucket_name, blob_name) VALUES (?, ?, ?, ?, ?);"; sqlite3_prepare_v2(db, insertOrUpdateSQL.c_str(), -1, &stmt, 0); @@ -194,14 +187,6 @@ class SQLiteWrapper { auto start = VariableMetadata::serializeVector(metadata.start); auto count = VariableMetadata::serializeVector(metadata.count); -// if(mpi_rank == 0) { -// std::cout << "Inserting metadata for " << metadata.name -// << " with shape " << shape -// << " with start " << start -// << " with count " << count -// << std::endl; -// } - sqlite3_prepare_v2(db, insertOrUpdateSQL.c_str(), -1, &stmt, 0); sqlite3_bind_int(stmt, 1, step); sqlite3_bind_int(stmt, 2, mpi_rank); @@ -213,7 +198,6 @@ class SQLiteWrapper { sqlite3_bind_text(stmt, 8, metadata.dataType.c_str(), -1, SQLITE_STATIC); sqlite3_step(stmt); sqlite3_finalize(stmt); - std::cout << "MDM: InsertVariableMetadata done" << std::endl; } VariableMetadata GetVariableMetadata(int step, int mpi_rank, const std::string& name) { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0554134c..64dba206 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,7 +9,6 @@ set(HERMES_ENGINE_SRCS #------------------------------------------------------------------------------ # Libraries #------------------------------------------------------------------------------ -add_definitions(-DMeta_enabled) add_library(hermes_engine ${HERMES_ENGINE_SRCS} ../include/coeus/MetadataSerializer.h) add_dependencies(hermes_engine spdlog) add_dependencies(hermes_engine coeus_mdm) diff --git a/tasks/coeus_mdm/include/coeus_mdm/coeus_mdm.h b/tasks/coeus_mdm/include/coeus_mdm/coeus_mdm.h index 793df20b..088c5227 100644 --- a/tasks/coeus_mdm/include/coeus_mdm/coeus_mdm.h +++ b/tasks/coeus_mdm/include/coeus_mdm/coeus_mdm.h @@ -90,7 +90,6 @@ class Client : public TaskLibClient { const TaskNode &task_node, const DomainId &domain_id, DbOperation db_op) { - std::cout << "MDM: insert fire" << std::endl; HRUN_CLIENT->ConstructTask( task, task_node, domain_id, id_, db_op); diff --git a/tasks/coeus_mdm/src/coeus_mdm.cc b/tasks/coeus_mdm/src/coeus_mdm.cc index b5e7957b..cb9ff359 100644 --- a/tasks/coeus_mdm/src/coeus_mdm.cc +++ b/tasks/coeus_mdm/src/coeus_mdm.cc @@ -43,7 +43,6 @@ class Server : public TaskLib { db->InsertBlobLocation(db_op.step, db_op.rank, db_op.name, db_op.blobInfo); } else if (db_op.type == OperationType::UpdateSteps) { - std::cout << "MDM: Hermes update MDM: " << db->getName() << ", step:" << db_op.currentStep <UpdateTotalSteps(db_op.uid, db_op.currentStep); } diff --git a/tasks/rankConsensus/include/rankConsensus/rankConsensus.h b/tasks/rankConsensus/include/rankConsensus/rankConsensus.h index 2d182f78..7009aa34 100644 --- a/tasks/rankConsensus/include/rankConsensus/rankConsensus.h +++ b/tasks/rankConsensus/include/rankConsensus/rankConsensus.h @@ -47,7 +47,6 @@ class Client : public TaskLibClient { AsyncCreateRoot(std::forward(args)...); task->Wait(); - //std::cout << "root wait: " << task->id_ << std::endl; Init(task->id_, HRUN_ADMIN->queue_id_); HRUN_CLIENT->DelTask(task); } @@ -74,7 +73,6 @@ class Client : public TaskLibClient { GetRankTask *task = get_task->get(); uint choosen_rank = task->rank_; - //std::cout << "root rank " << choosen_rank << std::endl; HRUN_CLIENT->DelTask(get_task); return choosen_rank; }