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 6f015ab..fbf87e8 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) {