Skip to content

Commit

Permalink
Merge pull request #660 from lukemartinlogan/dev
Browse files Browse the repository at this point in the history
Change spack for hermes
  • Loading branch information
lukemartinlogan authored Jan 8, 2024
2 parents 1fed505 + 7105ab3 commit 6dd9bd5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 50 deletions.
3 changes: 2 additions & 1 deletion 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 All @@ -47,7 +48,7 @@ class Hermes(CMakePackage):
depends_on('libaio')
depends_on('doxygen') # @1.9.3
depends_on('[email protected]: +context +fiber +filesystem +system +atomic +chrono +serialization +signals +pic +regex')
depends_on('libfabric fabrics=sockets,tcp,udp,verbs',
depends_on('libfabric fabrics=sockets,tcp,udp,verbs,mlx,rxm,rxd,shm',
when='+ares')
depends_on('libfabric fabrics=verbs',
when='+only_verbs')
Expand Down
2 changes: 1 addition & 1 deletion ci/hermes/packages/hermes_shm/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HermesShm(CMakePackage):
depends_on('libaio')
depends_on('doxygen') # @1.9.3
depends_on('[email protected]: +context +fiber +filesystem +system +atomic +chrono +serialization +signals +pic +regex')
depends_on('libfabric fabrics=sockets,tcp,udp,verbs',
depends_on('libfabric fabrics=sockets,tcp,udp,verbs,mlx,rxm,rxd,shm',
when='+ares')
depends_on('libfabric fabrics=verbs',
when='+only_verbs')
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 6dd9bd5

Please sign in to comment.