Skip to content
Snippets Groups Projects
Commit e1953d11 authored by KyleKlenk's avatar KyleKlenk
Browse files

client can use batch object to get info to start computing batch

client now needs to send the server the message that it is done
parent f44a0987
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,10 @@ class Batch {
int getBatchID();
int getStartHRU();
int getNumHRU();
bool getBatchStatus();
void printBatchInfo();
......
......@@ -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;
}
......
......@@ -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,
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment