From 27a6f8963ce45059a44168090404d4aabf600cd7 Mon Sep 17 00:00:00 2001 From: YuhangQ Date: Wed, 19 Apr 2023 08:58:59 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=BA=90=E7=A0=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.sh | 3 + src/{workers => }/clause.hpp | 2 +- src/{distributed => }/comm_tag.h | 1 - src/distributed/clause_pack.hpp | 9 -- src/distributed/heartbeat.cpp | 98 ---------------------- src/distributed/heartbeat.h | 18 ---- src/distributed/mympi.h | 5 -- src/{distributed => }/leader.hpp | 7 +- src/main.cpp | 6 +- src/sharer.cpp | 6 +- src/sharer.hpp | 2 +- src/solve.cpp | 2 +- src/{workers => solver_api}/basekissat.cpp | 0 src/{workers => solver_api}/basekissat.hpp | 0 src/{workers => solver_api}/basesolver.cpp | 0 src/{workers => solver_api}/basesolver.hpp | 2 +- src/{distributed => }/worker.hpp | 6 +- 17 files changed, 19 insertions(+), 148 deletions(-) rename src/{workers => }/clause.hpp (98%) rename src/{distributed => }/comm_tag.h (99%) delete mode 100644 src/distributed/clause_pack.hpp delete mode 100644 src/distributed/heartbeat.cpp delete mode 100644 src/distributed/heartbeat.h delete mode 100644 src/distributed/mympi.h rename src/{distributed => }/leader.hpp (97%) rename src/{workers => solver_api}/basekissat.cpp (100%) rename src/{workers => solver_api}/basekissat.hpp (100%) rename src/{workers => solver_api}/basesolver.cpp (100%) rename src/{workers => solver_api}/basesolver.hpp (98%) rename src/{distributed => }/worker.hpp (97%) diff --git a/run.sh b/run.sh index adaed5b..ff36f2c 100755 --- a/run.sh +++ b/run.sh @@ -17,6 +17,9 @@ # 04157f716c1e9606c6a530657bf8f957-Kakuro-easy-125-ext.xml.hg_4.cnf +#每次都有BUG +# 3d2a6e5c2f8f58dee79fd50444009625-cfi-rigid-z2-0088-03-or_2_shuffle_all.cnf + # 这个存在问题 DIR=/pub/data/chenzh/data/sat2022 diff --git a/src/workers/clause.hpp b/src/clause.hpp similarity index 98% rename from src/workers/clause.hpp rename to src/clause.hpp index 03788eb..382bda5 100644 --- a/src/workers/clause.hpp +++ b/src/clause.hpp @@ -2,7 +2,7 @@ #define _clause_hpp_INCLUDED #include #include -#include "../utils/vec.hpp" +#include "utils/vec.hpp" using std::shared_ptr; diff --git a/src/distributed/comm_tag.h b/src/comm_tag.h similarity index 99% rename from src/distributed/comm_tag.h rename to src/comm_tag.h index dfd40d1..e0689c7 100644 --- a/src/distributed/comm_tag.h +++ b/src/comm_tag.h @@ -1,6 +1,5 @@ #pragma once - const int TERMINATE_TAG = 0; const int SOLVED_REPORT_TAG = 1; const int MODEL_REPORT_TAG = 2; diff --git a/src/distributed/clause_pack.hpp b/src/distributed/clause_pack.hpp deleted file mode 100644 index e19edb5..0000000 --- a/src/distributed/clause_pack.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "../utils/vec.hpp" -#include "../workers/clause.hpp" - - -class ClausePack { - - - -}; \ No newline at end of file diff --git a/src/distributed/heartbeat.cpp b/src/distributed/heartbeat.cpp deleted file mode 100644 index 5b00144..0000000 --- a/src/distributed/heartbeat.cpp +++ /dev/null @@ -1,98 +0,0 @@ - - -#include "heartbeat.h" - -HeartBeat::HeartBeat(int num_procs) { - this->num_procs = num_procs; - this->online = new int[num_procs]; - for(int i=0; ionline[i] = 1; - } - this->last_send_time = new time_t[num_procs]; - for(int i=0; ilast_send_time[i] = 0; - } - this->requests = new MPI_Request[num_procs]; - this->send_requests = new MPI_Request[num_procs]; - for(int i=1; ionline; - delete []this->last_send_time; - delete []this->requests; -} - -void HeartBeat::update() { - for(int i=1; i 5) { - if(online[i]) printf("[leader] ERROR: worker %d offline\n", i); - online[i] = 0; - } else { - if(!online[i]) printf("[leader] RECONNECT: worker %d online\n", i); - online[i] = 1; - } - } - - for(int i=1; i - -class HeartBeat { -public: - HeartBeat(int num_procs); - ~HeartBeat(); - int is_online(int p); - int next_online(int p); - int last_online(int p); - void update(); - void waiting_all(); -private: - int num_procs; - int *online; - time_t *last_send_time; - MPI_Request* requests; - MPI_Request* send_requests; -}; \ No newline at end of file diff --git a/src/distributed/mympi.h b/src/distributed/mympi.h deleted file mode 100644 index f34b830..0000000 --- a/src/distributed/mympi.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include - -#include "comm_tag.h" diff --git a/src/distributed/leader.hpp b/src/leader.hpp similarity index 97% rename from src/distributed/leader.hpp rename to src/leader.hpp index 18305e2..8d4f70c 100644 --- a/src/distributed/leader.hpp +++ b/src/leader.hpp @@ -6,10 +6,9 @@ #include #include "comm_tag.h" -#include "../light.hpp" -#include "../utils/cmdline.h" -#include "../paras.hpp" -#include "heartbeat.h" +#include "light.hpp" +#include "utils/cmdline.h" +#include "paras.hpp" void leader_main(light* S, int num_procs, int rank) { diff --git a/src/main.cpp b/src/main.cpp index 922ba8c..4abab28 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,10 +8,10 @@ #include "utils/cmdline.h" #include "paras.hpp" -#include "distributed/leader.hpp" -#include "distributed/worker.hpp" +#include "leader.hpp" +#include "worker.hpp" -#include "workers/clause.hpp" +#include "clause.hpp" int main(int argc, char **argv) { diff --git a/src/sharer.cpp b/src/sharer.cpp index 0ebb3c1..f6943d9 100644 --- a/src/sharer.cpp +++ b/src/sharer.cpp @@ -1,10 +1,10 @@ #include "light.hpp" -#include "workers/basesolver.hpp" +#include "solver_api/basesolver.hpp" #include "sharer.hpp" #include "unordered_map" -#include "workers/clause.hpp" +#include "clause.hpp" #include -#include "distributed/comm_tag.h" +#include "comm_tag.h" #include int nums = 0; diff --git a/src/sharer.hpp b/src/sharer.hpp index 40ca8e9..47bc850 100644 --- a/src/sharer.hpp +++ b/src/sharer.hpp @@ -3,7 +3,7 @@ #include "paras.hpp" #include #include "utils/vec.hpp" -#include "./workers/clause.hpp" +#include "clause.hpp" class basesolver; class sharer { diff --git a/src/solve.cpp b/src/solve.cpp index 44c44f5..d4be677 100644 --- a/src/solve.cpp +++ b/src/solve.cpp @@ -1,5 +1,5 @@ #include "light.hpp" -#include "workers/basekissat.hpp" +#include "solver_api/basekissat.hpp" #include "sharer.hpp" #include "paras.hpp" #include diff --git a/src/workers/basekissat.cpp b/src/solver_api/basekissat.cpp similarity index 100% rename from src/workers/basekissat.cpp rename to src/solver_api/basekissat.cpp diff --git a/src/workers/basekissat.hpp b/src/solver_api/basekissat.hpp similarity index 100% rename from src/workers/basekissat.hpp rename to src/solver_api/basekissat.hpp diff --git a/src/workers/basesolver.cpp b/src/solver_api/basesolver.cpp similarity index 100% rename from src/workers/basesolver.cpp rename to src/solver_api/basesolver.cpp diff --git a/src/workers/basesolver.hpp b/src/solver_api/basesolver.hpp similarity index 98% rename from src/workers/basesolver.hpp rename to src/solver_api/basesolver.hpp index e412776..573bc18 100644 --- a/src/workers/basesolver.hpp +++ b/src/solver_api/basesolver.hpp @@ -3,7 +3,7 @@ #include "../light.hpp" #include "../utils/vec.hpp" -#include "clause.hpp" +#include "../clause.hpp" #include #include #include diff --git a/src/distributed/worker.hpp b/src/worker.hpp similarity index 97% rename from src/distributed/worker.hpp rename to src/worker.hpp index 404b242..d842c69 100644 --- a/src/distributed/worker.hpp +++ b/src/worker.hpp @@ -4,9 +4,9 @@ #include #include -#include "../light.hpp" -#include "../utils/cmdline.h" -#include "../paras.hpp" +#include "light.hpp" +#include "utils/cmdline.h" +#include "paras.hpp" #include "comm_tag.h" void worker_main(light* S, int num_procs, int rank) {