Files
mlpack/fastlib/branches/fastlib-old/thor/sched.cc
T
Ryan Curtin f6864dd435 Move fastlib-old (originally 'fastlib') to fastlib/branches/fastlib-old where it
will sit until the end of time and nobody will touch it because it's old
2010-01-31 22:31:55 +00:00

39 lines
1021 B
C++

/**
* @file sched.cc
*
* Non-templated implementations for GNP scheduling.
*/
#include "sched.h"
void SchedulerInterface::Report(struct datanode *module) {
}
//--------------------------------------------------------------
void RemoteSchedulerBackend::Init(SchedulerInterface *inner_work_queue) {
inner_ = inner_work_queue;
}
void RemoteSchedulerBackend::HandleRequest(
const WorkRequest& request, WorkResponse *response) {
DEBUG_ASSERT(request.operation == WorkRequest::GIVE_ME_WORK);
inner_->GetWork(request.rank, &response->work_items);
}
//--------------------------------------------------------------
void RemoteScheduler::Init(int channel, int destination) {
channel_ = channel;
destination_ = destination;
}
void RemoteScheduler::GetWork(
int rank, ArrayList<Grain> *work_items) {
WorkRequest request;
request.operation = WorkRequest::GIVE_ME_WORK;
request.rank = rank;
Rpc<WorkResponse> response(channel_, destination_, request);
work_items->Copy(response->work_items);
}