diff --git a/build/includes/summa_actor/batch_manager.hpp b/build/includes/summa_actor/batch_manager.hpp index a104cb9b20a888d03700de0ca0682b830961f36d..d0a003f40c07a04a82ca2b5238216d89f0b98aba 100644 --- a/build/includes/summa_actor/batch_manager.hpp +++ b/build/includes/summa_actor/batch_manager.hpp @@ -21,6 +21,10 @@ class Batch { int getBatchID(); + int getStartHRU(); + + int getNumHRU(); + bool getBatchStatus(); void printBatchInfo(); diff --git a/build/source/actors/summa_actor/batch_manager.cpp b/build/source/actors/summa_actor/batch_manager.cpp index 75b5769e848a53fadd87c1e0e2020869d2884341..d1e674b4ed78301bba6264a23a342f3a144df905 100644 --- a/build/source/actors/summa_actor/batch_manager.cpp +++ b/build/source/actors/summa_actor/batch_manager.cpp @@ -48,9 +48,9 @@ std::optional<Batch> Batch_Container::assignBatch(std::string hostname, caf::act } - - - +// ************************** +// Batch Class +// ************************** Batch::Batch(int batch_id, int start_hru, int num_hru){ this->batch_id = batch_id; @@ -59,11 +59,19 @@ Batch::Batch(int batch_id, int start_hru, int num_hru){ this->assigned_to_actor = false; } -// Setters +// Getters int Batch::getBatchID() { return this->batch_id; } +int Batch::getStartHRU() { + return this->start_hru; +} + +int Batch::getNumHRU() { + return this->num_hru; +} + bool Batch::getBatchStatus() { return this->assigned_to_actor; } diff --git a/build/source/actors/summa_actor/summa_client.cpp b/build/source/actors/summa_actor/summa_client.cpp index 4fde772f40260243a8260abcd4f5e41972b694f0..f0faa70e5e2962cf4968f241932ca5c34f871cc3 100644 --- a/build/source/actors/summa_actor/summa_client.cpp +++ b/build/source/actors/summa_actor/summa_client.cpp @@ -87,25 +87,16 @@ behavior running(stateful_actor<summa_client_state>* self, const actor& server_a }, + // Received batch from server to compute [=](Batch& batch) { - aout(self) << "Recieved Batch" << std::endl; - aout(self) << batch.getBatchID() << std::endl; - }, - + aout(self) << "\nReceived batch to compute\n"; + aout(self) << "BatchID = " << batch.getBatchID() << "\n"; + aout(self) << "StartHRU = " << batch.getStartHRU() << "\n"; + aout(self) << "NumHRU = " << batch.getNumHRU() << "\n"; - [=](compute_batch, int client_id, int batch_id, int start_hru, int num_hru, std::string config_path) { - aout(self) << "\nReceived batch to compute" << "\n"; - aout(self) << "BatchID = " << batch_id << "\n"; - aout(self) << "Start HRU = " << start_hru << "\n"; - aout(self) << "Num HRU = " << num_hru << "\n"; - aout(self) << "Config Path = " << config_path << "\n"; - self->state.client_id = client_id; - self->state.batch_id = batch_id; - - self->state.summa_actor_ref = self->spawn(summa_actor, - start_hru, - num_hru, + batch.getStartHRU(), + batch.getNumHRU(), self->state.summa_actor_settings, self->state.file_access_actor_settings, self->state.job_actor_settings, diff --git a/build/source/actors/summa_actor/summa_server.cpp b/build/source/actors/summa_actor/summa_server.cpp index cf0fe865a4fc5e01a9b05ab6413e3f9a9cb6bf91..f9e89941f0ce828e87320f0aa6fa22138593ec11 100644 --- a/build/source/actors/summa_actor/summa_server.cpp +++ b/build/source/actors/summa_actor/summa_server.cpp @@ -37,7 +37,7 @@ behavior summa_server(stateful_actor<summa_server_state>* self, Distributed_Sett * @param hostname human readable hostname of the machine that the actor is running on */ [=](connect_to_server, actor client_actor, std::string hostname) { - // self->send(client, Batch{3,4,5}); + aout(self) << "Actor trying to connect with hostname " << hostname << "\n"; self->state.client_container->addClient(client_actor, hostname);