Skip to content

Commit

Permalink
Add adios variant to hermes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemartinlogan committed Jan 8, 2024
1 parent e9c0e8a commit 7105ab3
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 48 deletions.
1 change: 1 addition & 0 deletions ci/hermes/packages/hermes/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Hermes(CMakePackage):
variant('only_verbs', default=False, description='Only verbs')
variant('debug', default=False, description='Build shared libraries')
variant('zmq', default=False, description='Build ZeroMQ tests')
variant('adios', default=False, description='Build Adios tests')

depends_on('[email protected]')
depends_on('[email protected]')
Expand Down
96 changes: 48 additions & 48 deletions hrun/include/hrun/work_orchestrator/worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ class Worker {
}
}

/** Allocate a stack for a task */
void* AllocateStack() {
void *stack;
if (!stacks_.pop(stack).IsNull()) {
return stack;
}
return malloc(stack_size_);
}

/** Free a stack */
void FreeStack(void *stack) {
if(!stacks_.emplace(stack).IsNull()) {
return;
}
stacks_.Resize(stacks_.size() + num_stacks_);
}

/**===============================================================
* Run tasks
* =============================================================== */
Expand Down Expand Up @@ -357,54 +374,6 @@ class Worker {
}
}

/** Print all queues */
void PrintQueues(bool no_long_run = false) {
for (std::unique_ptr<Worker> &worker : HRUN_WORK_ORCHESTRATOR->workers_) {
for (WorkEntry &work_entry : worker->work_queue_) {
Lane *&lane = work_entry.lane_;
LaneData *entry;
int off = 0;
while (!lane->peek(entry, off).IsNull()) {
Task *task = HRUN_CLIENT->GetMainPointer<Task>(entry->p_);
TaskState *exec = HRUN_TASK_REGISTRY->GetTaskState(task->task_state_);
bool is_remote = task->domain_id_.IsRemote(HRUN_RPC->GetNumHosts(),
HRUN_CLIENT->node_id_);
if (no_long_run && task->IsLongRunning()) {
off += 1;
continue;
}
HILOG(kInfo,
"(node {}, worker {}) Task {} state {}, method {}, is remote: {}, long_running: {}",
HRUN_CLIENT->node_id_,
worker->id_,
task->task_node_,
exec->name_,
task->method_,
is_remote,
task->IsLongRunning());
off += 1;
}
}
}
}

/** Allocate a stack for a task */
void* AllocateStack() {
void *stack;
if (!stacks_.pop(stack).IsNull()) {
return stack;
}
return malloc(stack_size_);
}

/** Free a stack */
void FreeStack(void *stack) {
if(!stacks_.emplace(stack).IsNull()) {
return;
}
stacks_.Resize(stacks_.size() + num_stacks_);
}

/** Run an iteration over a particular queue */
HSHM_ALWAYS_INLINE
void PollGrouped(WorkEntry &work_entry, bool flushing) {
Expand Down Expand Up @@ -609,6 +578,37 @@ class Worker {
off += 1;
}
}

/** Print all queues */
void PrintQueues(bool no_long_run = false) {
for (std::unique_ptr<Worker> &worker : HRUN_WORK_ORCHESTRATOR->workers_) {
for (WorkEntry &work_entry : worker->work_queue_) {
Lane *&lane = work_entry.lane_;
LaneData *entry;
int off = 0;
while (!lane->peek(entry, off).IsNull()) {
Task *task = HRUN_CLIENT->GetMainPointer<Task>(entry->p_);
TaskState *exec = HRUN_TASK_REGISTRY->GetTaskState(task->task_state_);
bool is_remote = task->domain_id_.IsRemote(HRUN_RPC->GetNumHosts(),
HRUN_CLIENT->node_id_);
if (no_long_run && task->IsLongRunning()) {
off += 1;
continue;
}
HILOG(kInfo,
"(node {}, worker {}) Task {} state {}, method {}, is remote: {}, long_running: {}",
HRUN_CLIENT->node_id_,
worker->id_,
task->task_node_,
exec->name_,
task->method_,
is_remote,
task->IsLongRunning());
off += 1;
}
}
}
}
};

} // namespace hrun
Expand Down

0 comments on commit 7105ab3

Please sign in to comment.