From 528f82651cb27e151f8cb7c66d9b46735142bea2 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Mon, 25 Sep 2023 12:18:15 -0500 Subject: [PATCH 01/49] Add TimespecLatency --- benchmark/test_init.cc | 1 - benchmark/test_latency.cc | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/benchmark/test_init.cc b/benchmark/test_init.cc index 63132b16a..e101758d3 100644 --- a/benchmark/test_init.cc +++ b/benchmark/test_init.cc @@ -16,7 +16,6 @@ #include "test_init.h" void MainPretest() { - TRANSPARENT_LABSTOR(); } void MainPosttest() { diff --git a/benchmark/test_latency.cc b/benchmark/test_latency.cc index ea8f14c34..c6b8410bc 100644 --- a/benchmark/test_latency.cc +++ b/benchmark/test_latency.cc @@ -243,6 +243,7 @@ void TestWorkerIterationLatency(u32 num_queues, u32 num_lanes) { /** Time for worker to process a request */ TEST_CASE("TestWorkerLatency") { + TRANSPARENT_LABSTOR(); TestWorkerIterationLatency(1, 16); TestWorkerIterationLatency(5, 16); TestWorkerIterationLatency(10, 16); @@ -251,6 +252,7 @@ TEST_CASE("TestWorkerLatency") { /** Time to process a request */ TEST_CASE("TestRoundTripLatency") { + TRANSPARENT_LABSTOR(); HERMES->ClientInit(); labstor::small_message::Client client; LABSTOR_ADMIN->RegisterTaskLibRoot(labstor::DomainId::GetLocal(), "small_message"); @@ -276,6 +278,20 @@ TEST_CASE("TestRoundTripLatency") { HILOG(kInfo, "Latency: {} MOps", ops / t.GetUsec()); } +TEST_CASE("TestTimespecLatency") { + size_t ops = (1 << 20); + hshm::Timer t; + + t.Resume(); + for (size_t i = 0; i < ops; ++i) { + struct timespec ts; + timespec_get(&ts, TIME_UTC); + } + t.Pause(); + + HILOG(kInfo, "Latency: {} MOps", ops / t.GetUsec()); +} + /** Time to process a request */ //TEST_CASE("TestHermesGetBlobIdLatency") { // HERMES->ClientInit(); From 7c1f3f1fc568e309ee7e9fe3d88f8a08bf90483d Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:00:23 -0500 Subject: [PATCH 02/49] re-enable task frees --- include/labstor/api/labstor_client.h | 4 ++-- src/worker.cc | 2 +- tasks/hermes/include/hermes/bucket.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index 54e9d9f99..f23f0ca66 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -140,7 +140,7 @@ class Client : public ConfigurationManager { HSHM_ALWAYS_INLINE void DelTask(TaskT *task) { // TODO(llogan): verify leak - // main_alloc_->DelObj(task); + main_alloc_->DelObj(task); } /** Destroy a task */ @@ -189,7 +189,7 @@ class Client : public ConfigurationManager { HSHM_ALWAYS_INLINE void FreeBuffer(hipc::Pointer &p) { // TODO(llogan): verify leak - // main_alloc_->Free(p); + main_alloc_->Free(p); } /** Free a buffer */ diff --git a/src/worker.cc b/src/worker.cc index 7a943839a..491fdd29f 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -105,7 +105,7 @@ void Worker::PollGrouped(WorkEntry &work_entry) { entry->complete_ = true; if (task->IsCoroutine()) { // TODO(llogan): verify leak - // free(ctx.stack_ptr_); + free(ctx.stack_ptr_); } else if (task->IsPreemptive()) { ABT_thread_join(entry->thread_); } diff --git a/tasks/hermes/include/hermes/bucket.h b/tasks/hermes/include/hermes/bucket.h index 67ade3690..66da72dc1 100644 --- a/tasks/hermes/include/hermes/bucket.h +++ b/tasks/hermes/include/hermes/bucket.h @@ -435,7 +435,7 @@ class Bucket { char *data = LABSTOR_CLIENT->GetPrivatePointer(task->data_); memcpy(blob.data(), data, data_size); LABSTOR_CLIENT->FreeBuffer(task->data_); - LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(push_task); return blob_id; } From 534fde9143ad8b23218b53530587ff77eb7bf111 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:09:20 -0500 Subject: [PATCH 03/49] Comment out a few deltasks --- .../include/hermes_blob_mdm/hermes_blob_mdm_tasks.h | 10 +++++----- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 10 +++++----- tasks_required/remote_queue/src/remote_queue.cc | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h index e487d23c3..037abaa9c 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h @@ -284,11 +284,11 @@ struct PutBlobTask : public Task, TaskFlags /** Destructor */ ~PutBlobTask() { - HSHM_DESTROY_AR(blob_name_); - HSHM_DESTROY_AR(filename_); - if (IsDataOwner()) { - LABSTOR_CLIENT->FreeBuffer(data_); - } +// HSHM_DESTROY_AR(blob_name_); +// HSHM_DESTROY_AR(filename_); +// if (IsDataOwner()) { +// LABSTOR_CLIENT->FreeBuffer(data_); +// } } /** (De)serialize message call */ diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index df2077126..d77f3516b 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -340,11 +340,11 @@ class Server : public TaskLib { LABSTOR_CLIENT->DelTask(write_task); } HILOG(kDebug, "PutBlobTask complete"); - HSHM_DESTROY_AR(task->schema_); - HSHM_DESTROY_AR(task->bdev_writes_); - if (task->flags_.Any(HERMES_DID_STAGE_IN)) { - LABSTOR_CLIENT->FreeBuffer(task->data_ptr_); - } +// HSHM_DESTROY_AR(task->schema_); +// HSHM_DESTROY_AR(task->bdev_writes_); +// if (task->flags_.Any(HERMES_DID_STAGE_IN)) { +// LABSTOR_CLIENT->FreeBuffer(task->data_ptr_); +// } // Update the bucket statistics int update_mode = bucket_mdm::UpdateSizeMode::kAdd; if (task->flags_.Any(HERMES_IS_FILE)) { diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index b0718a7c7..f8ecbbadc 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -278,7 +278,7 @@ class Server : public TaskLib { orig_task->task_state_, state_id, method); - LABSTOR_CLIENT->DelTask(orig_task); +// LABSTOR_CLIENT->DelTask(orig_task); req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); } From da4bcef0dadecb3304b57eccf1b0639a726db039 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:18:39 -0500 Subject: [PATCH 04/49] Remove all DelTasks from cc files --- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 10 +++++----- tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index d77f3516b..08cba96e8 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -282,7 +282,7 @@ class Server : public TaskLib { sub_plcmnt.size_ += diff; HILOG(kDebug, "Passing {} bytes to target {}", diff, sub_plcmnt.tid_); } - LABSTOR_CLIENT->DelTask(task->cur_bdev_alloc_); +// LABSTOR_CLIENT->DelTask(task->cur_bdev_alloc_); if (task->plcmnt_idx_ < (*task->schema_).size()) { task->phase_ = PutBlobPhase::kAllocate; return; @@ -337,7 +337,7 @@ class Server : public TaskLib { } } for (bdev::WriteTask *&write_task : write_tasks) { - LABSTOR_CLIENT->DelTask(write_task); +// LABSTOR_CLIENT->DelTask(write_task); } HILOG(kDebug, "PutBlobTask complete"); // HSHM_DESTROY_AR(task->schema_); @@ -421,7 +421,7 @@ class Server : public TaskLib { } } for (bdev::ReadTask *&read_task : read_tasks) { - LABSTOR_CLIENT->DelTask(read_task); +// LABSTOR_CLIENT->DelTask(read_task); } HSHM_DESTROY_AR(task->bdev_reads_); HILOG(kDebug, "GetBlobTask complete"); @@ -642,7 +642,7 @@ class Server : public TaskLib { } } for (bdev::FreeTask *&free_task : free_tasks) { - LABSTOR_CLIENT->DelTask(free_task); +// LABSTOR_CLIENT->DelTask(free_task); } BLOB_MAP_T &blob_map = blob_map_[ctx.lane_id_]; BlobInfo &blob_info = blob_map[task->blob_id_]; @@ -686,7 +686,7 @@ class Server : public TaskLib { if (!task->get_task_->IsComplete()) { return; } - LABSTOR_CLIENT->DelTask(task->get_task_); +// LABSTOR_CLIENT->DelTask(task->get_task_); task->phase_ = ReorganizeBlobPhase::kPut; } case ReorganizeBlobPhase::kPut: { diff --git a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc index 5d1a96fc0..5b2768925 100644 --- a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc +++ b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc @@ -115,7 +115,7 @@ class Server : public TaskLib { LABSTOR_CLIENT->node_id_, task->tag_id_, task->task_node_) for (AppendInfo &append : append_info) { append.blob_id_ = append.blob_id_task_->blob_id_; - LABSTOR_CLIENT->DelTask(append.blob_id_task_); +// LABSTOR_CLIENT->DelTask(append.blob_id_task_); } task->SetModuleComplete(); } @@ -178,10 +178,10 @@ class Server : public TaskLib { HILOG(kDebug, "(node {}) PUT blobs for tag {} (task_node={})", LABSTOR_CLIENT->node_id_, task->tag_id_, task->task_node_) for (AppendInfo &append : append_info) { - LABSTOR_CLIENT->DelTask(append.put_task_); +// LABSTOR_CLIENT->DelTask(append.put_task_); } HSHM_DESTROY_AR(task->schema_->append_info_); - LABSTOR_CLIENT->DelTask(task->schema_); +// LABSTOR_CLIENT->DelTask(task->schema_); task->SetModuleComplete(); } } @@ -294,7 +294,7 @@ class Server : public TaskLib { } } for (blob_mdm::DestroyBlobTask *&blob_task : blob_tasks) { - LABSTOR_CLIENT->DelTask(blob_task); +// LABSTOR_CLIENT->DelTask(blob_task); } HSHM_DESTROY_AR(task->destroy_blob_tasks_); TAG_MAP_T &tag_map = tag_map_[ctx.lane_id_]; From f1727e83acfa620e88cf39a3fec19632dcf6c42b Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:20:56 -0500 Subject: [PATCH 05/49] Only DelTask --- include/labstor/api/labstor_client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index f23f0ca66..5d2984799 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -140,14 +140,14 @@ class Client : public ConfigurationManager { HSHM_ALWAYS_INLINE void DelTask(TaskT *task) { // TODO(llogan): verify leak - main_alloc_->DelObj(task); + // main_alloc_->DelObj(task); } /** Destroy a task */ template HSHM_ALWAYS_INLINE void DelTask(LPointer &task) { - main_alloc_->DelObjLocal(task); + // main_alloc_->DelObjLocal(task); } /** Get a queue by its ID */ From 87cc20ee12733159b11ce5170d4e51f99e3a6965 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:26:56 -0500 Subject: [PATCH 06/49] Remove FreeBuffer and DelTask --- include/labstor/api/labstor_client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index 5d2984799..43500b752 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -189,14 +189,14 @@ class Client : public ConfigurationManager { HSHM_ALWAYS_INLINE void FreeBuffer(hipc::Pointer &p) { // TODO(llogan): verify leak - main_alloc_->Free(p); + // main_alloc_->Free(p); } /** Free a buffer */ HSHM_ALWAYS_INLINE void FreeBuffer(LPointer &p) { // TODO(llogan): verify leak - main_alloc_->FreeLocalPtr(p); + // main_alloc_->FreeLocalPtr(p); } }; From 1398fdb7e44ed7c3cccae01c7836113e8cb32e13 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:36:05 -0500 Subject: [PATCH 07/49] Bring FreeBuffer back --- include/labstor/api/labstor_client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index 43500b752..a1daf9546 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -189,14 +189,14 @@ class Client : public ConfigurationManager { HSHM_ALWAYS_INLINE void FreeBuffer(hipc::Pointer &p) { // TODO(llogan): verify leak - // main_alloc_->Free(p); + main_alloc_->Free(p); } /** Free a buffer */ HSHM_ALWAYS_INLINE void FreeBuffer(LPointer &p) { // TODO(llogan): verify leak - // main_alloc_->FreeLocalPtr(p); + main_alloc_->FreeLocalPtr(p); } }; From 77e33dc9ee13c768a4ed84c57816dc3b110a9bfd Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:42:04 -0500 Subject: [PATCH 08/49] Comment out all DelTasks in tasks --- include/labstor/api/labstor_client.h | 4 +-- tasks/bdev/include/bdev/bdev.h | 2 +- tasks/hermes/include/hermes/bucket.h | 4 +-- .../include/hermes_adapters/hermes_adapters.h | 2 +- .../include/hermes_blob_mdm/hermes_blob_mdm.h | 28 +++++++++---------- .../hermes_bucket_mdm/hermes_bucket_mdm.h | 20 ++++++------- .../remote_queue/src/remote_queue.cc | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index a1daf9546..a7d98f267 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -140,14 +140,14 @@ class Client : public ConfigurationManager { HSHM_ALWAYS_INLINE void DelTask(TaskT *task) { // TODO(llogan): verify leak - // main_alloc_->DelObj(task); + main_alloc_->DelObj(task); } /** Destroy a task */ template HSHM_ALWAYS_INLINE void DelTask(LPointer &task) { - // main_alloc_->DelObjLocal(task); + main_alloc_->DelObjLocal(task); } /** Get a queue by its ID */ diff --git a/tasks/bdev/include/bdev/bdev.h b/tasks/bdev/include/bdev/bdev.h index 17b130b87..b69f56c07 100644 --- a/tasks/bdev/include/bdev/bdev.h +++ b/tasks/bdev/include/bdev/bdev.h @@ -55,7 +55,7 @@ class Client : public TaskLibClient { id_ = task->id_; queue_id_ = QueueId(id_); monitor_task_ = AsyncMonitor(task->task_node_, 100).ptr_; - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreateTaskState); diff --git a/tasks/hermes/include/hermes/bucket.h b/tasks/hermes/include/hermes/bucket.h index 66da72dc1..317d1d82d 100644 --- a/tasks/hermes/include/hermes/bucket.h +++ b/tasks/hermes/include/hermes/bucket.h @@ -240,7 +240,7 @@ class Bucket { push_task->Wait(); PutBlobTask *task = push_task->get(); blob_id = task->blob_id_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } } return blob_id; @@ -435,7 +435,7 @@ class Bucket { char *data = LABSTOR_CLIENT->GetPrivatePointer(task->data_); memcpy(blob.data(), data, data_size); LABSTOR_CLIENT->FreeBuffer(task->data_); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return blob_id; } diff --git a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h index 1817cdf75..25a8e4f9e 100644 --- a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h +++ b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h @@ -42,7 +42,7 @@ class Client : public TaskLibClient { task->Wait(); id_ = task->id_; queue_id_ = QueueId(id_); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } /** Destroy task state + queue */ diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h index 9b82d620f..d3cce712b 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h @@ -44,7 +44,7 @@ class Client : public TaskLibClient { if (task->IsComplete()) { id_ = task->id_; queue_id_ = QueueId(id_); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreate); @@ -79,7 +79,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncSetBucketMdmRoot(domain_id, blob_mdm_id); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(SetBucketMdm); @@ -101,7 +101,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetOrCreateBlobIdTask *task = push_task->get(); BlobId blob_id = task->blob_id_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return blob_id; } LABSTOR_TASK_NODE_PUSH_ROOT(GetOrCreateBlobId); @@ -165,7 +165,7 @@ class Client : public TaskLibClient { GetBlobTask *task = push_task->get(); data = task->data_; size_t true_size = task->data_size_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return true_size; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlob); @@ -211,7 +211,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTagBlobRoot(tag_id, blob_id, tag); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TagBlob); @@ -235,7 +235,7 @@ class Client : public TaskLibClient { push_task->Wait(); BlobHasTagTask *task = push_task->get(); bool has_tag = task->has_tag_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return has_tag; } LABSTOR_TASK_NODE_PUSH_ROOT(BlobHasTag); @@ -259,7 +259,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetBlobIdTask *task = push_task->get(); BlobId blob_id = task->blob_id_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return blob_id; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobId); @@ -282,7 +282,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetBlobNameTask *task = push_task->get(); std::string blob_name = task->blob_name_->str(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return blob_name; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobName); @@ -308,7 +308,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetBlobSizeTask *task = push_task->get(); size_t size = task->size_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return size; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobSize); @@ -331,7 +331,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetBlobScoreTask *task = push_task->get(); float score = task->score_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return score; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobScore); @@ -354,7 +354,7 @@ class Client : public TaskLibClient { GetBlobBuffersTask *task = push_task->get(); std::vector buffers = hshm::to_stl_vector(*task->buffers_); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return buffers; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobBuffers) @@ -378,7 +378,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncRenameBlobRoot(tag_id, blob_id, new_blob_name); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(RenameBlob); @@ -400,7 +400,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTruncateBlobRoot(tag_id, blob_id, new_size); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TruncateBlob); @@ -420,7 +420,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncDestroyBlobRoot(tag_id, blob_id); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(DestroyBlob); }; diff --git a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm.h b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm.h index 479085856..8c7d980a8 100644 --- a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm.h +++ b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm.h @@ -57,7 +57,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncSetBlobMdmRoot(domain_id, blob_mdm_id); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(SetBlobMdm); @@ -141,7 +141,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetOrCreateTagTask *task = push_task->get(); TagId tag_id = task->tag_id_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return tag_id; } LABSTOR_TASK_NODE_PUSH_ROOT(GetOrCreateTag); @@ -161,7 +161,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetTagIdTask *task = push_task->get(); TagId tag_id = task->tag_id_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return tag_id; } LABSTOR_TASK_NODE_PUSH_ROOT(GetTagId); @@ -181,7 +181,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetTagNameTask *task = push_task->get(); hshm::string tag_name = hshm::to_charbuf(*task->tag_name_.get()); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return tag_name; } LABSTOR_TASK_NODE_PUSH_ROOT(GetTagName); @@ -200,7 +200,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncRenameTagRoot(tag_id, new_tag_name); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(RenameTag); @@ -217,7 +217,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncDestroyTagRoot(tag_id); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(DestroyTag); @@ -235,7 +235,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTagAddBlobRoot(tag_id, blob_id); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TagAddBlob); @@ -252,7 +252,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTagRemoveBlobRoot(tag_id, blob_id); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TagRemoveBlob); @@ -269,7 +269,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTagClearBlobsRoot(tag_id); push_task->Wait(); - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TagClearBlobs); @@ -288,7 +288,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetSizeTask *task = push_task->get(); size_t size = task->size_; - LABSTOR_CLIENT->DelTask(push_task); + // LABSTOR_CLIENT->DelTask(push_task); return size; } LABSTOR_TASK_NODE_PUSH_ROOT(GetSize); diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index f8ecbbadc..b0718a7c7 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -278,7 +278,7 @@ class Server : public TaskLib { orig_task->task_state_, state_id, method); -// LABSTOR_CLIENT->DelTask(orig_task); + LABSTOR_CLIENT->DelTask(orig_task); req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); } From a2c75b19627ee38c57f9a386b637de929c2bfaca Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:46:10 -0500 Subject: [PATCH 09/49] Don't free proc_queue --- .../proc_queue/include/proc_queue/proc_queue_tasks.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h index 9372d1307..dd50a3d5b 100644 --- a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h +++ b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h @@ -109,11 +109,11 @@ struct TypedPushTask : public Task, TaskFlags { /** Destructor */ ~TypedPushTask() { - if (!IsFireAndForget()) { - LABSTOR_CLIENT->DelTask(sub_cli_); - } else { - LABSTOR_CLIENT->DelTask(sub_run_); - } +// if (!IsFireAndForget()) { +// LABSTOR_CLIENT->DelTask(sub_cli_); +// } else { +// LABSTOR_CLIENT->DelTask(sub_run_); +// } } /** Create group */ From 1ec1f3926847e9f561acb5eae1e741a328b5c75f Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:50:02 -0500 Subject: [PATCH 10/49] Comment out free buffer --- tasks/hermes/include/hermes/bucket.h | 2 +- .../include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/hermes/include/hermes/bucket.h b/tasks/hermes/include/hermes/bucket.h index 317d1d82d..2869a2816 100644 --- a/tasks/hermes/include/hermes/bucket.h +++ b/tasks/hermes/include/hermes/bucket.h @@ -434,7 +434,7 @@ class Bucket { blob_id = task->blob_id_; char *data = LABSTOR_CLIENT->GetPrivatePointer(task->data_); memcpy(blob.data(), data, data_size); - LABSTOR_CLIENT->FreeBuffer(task->data_); + // LABSTOR_CLIENT->FreeBuffer(task->data_); // LABSTOR_CLIENT->DelTask(push_task); return blob_id; } diff --git a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h index 2dca04d1b..bfb9c7060 100644 --- a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h +++ b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h @@ -317,9 +317,9 @@ struct AppendBlobTask : public Task, TaskFlags { /** Destructor */ ~AppendBlobTask() { - if (IsDataOwner()) { - LABSTOR_CLIENT->FreeBuffer(data_); - } +// if (IsDataOwner()) { +// LABSTOR_CLIENT->FreeBuffer(data_); +// } } /** Create group */ From 00278ef7332c875a1c23d923e13e3eb408f8de68 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 11:58:46 -0500 Subject: [PATCH 11/49] Comment out admin frees --- .../include/labstor_admin/labstor_admin.h | 16 ++++++++-------- .../labstor_admin/src/labstor_admin.cc | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin.h b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin.h index 8fc0ab097..2ded473d5 100644 --- a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin.h +++ b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin.h @@ -35,7 +35,7 @@ class Client : public TaskLibClient { const std::string &lib_name) { LPointer task = AsyncRegisterTaskLibRoot(domain_id, lib_name); task->Wait(); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(RegisterTaskLib) @@ -55,7 +55,7 @@ class Client : public TaskLibClient { LPointer task = AsyncDestroyTaskLibRoot(domain_id, lib_name); task->Wait(); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(DestroyTaskLib) @@ -77,7 +77,7 @@ class Client : public TaskLibClient { domain_id, std::forward(args)...); task->Wait(); TaskStateId new_id = task->id_; - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); if (new_id.IsNull()) { HELOG(kWarning, "Failed to create task state"); } @@ -130,7 +130,7 @@ class Client : public TaskLibClient { AsyncGetOrCreateTaskStateIdRoot(domain_id, state_name); task->Wait(); TaskStateId new_id = task->id_; - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); return new_id; } LABSTOR_TASK_NODE_ADMIN_ROOT(GetOrCreateTaskStateId) @@ -149,7 +149,7 @@ class Client : public TaskLibClient { AsyncGetTaskStateIdRoot(domain_id, state_name); task->Wait(); TaskStateId new_id = task->id_; - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); return new_id; } LABSTOR_TASK_NODE_ADMIN_ROOT(GetTaskStateId) @@ -169,7 +169,7 @@ class Client : public TaskLibClient { LPointer task = AsyncDestroyTaskStateRoot(domain_id, id); task->Wait(); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(DestroyTaskState) @@ -195,7 +195,7 @@ class Client : public TaskLibClient { LPointer task = AsyncSetWorkOrchQueuePolicyRoot(domain_id, policy); task->Wait(); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(SetWorkOrchQueuePolicy); @@ -212,7 +212,7 @@ class Client : public TaskLibClient { LPointer task = AsyncSetWorkOrchProcPolicyRoot(domain_id, policy); task->Wait(); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(SetWorkOrchProcPolicy); }; diff --git a/tasks_required/labstor_admin/src/labstor_admin.cc b/tasks_required/labstor_admin/src/labstor_admin.cc index d80e4998a..d400d06e4 100644 --- a/tasks_required/labstor_admin/src/labstor_admin.cc +++ b/tasks_required/labstor_admin/src/labstor_admin.cc @@ -51,7 +51,7 @@ class Server : public TaskLib { LABSTOR_ADMIN->AsyncGetOrCreateTaskStateId(task->task_node_ + 1, domain, state_name); get_id->Wait(task); task->id_ = get_id->id_; - LABSTOR_CLIENT->DelTask(get_id); + // LABSTOR_CLIENT->DelTask(get_id); } // Create the task state HILOG(kInfo, "(node {}) Creating task state {} with id {} (task_node={})", From 5c7cdd969472c4fcbd26c84047858d62e511bd1b Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 12:02:40 -0500 Subject: [PATCH 12/49] Comment out remote queue deltasks --- tasks_required/remote_queue/include/remote_queue/remote_queue.h | 2 +- tasks_required/remote_queue/src/remote_queue.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks_required/remote_queue/include/remote_queue/remote_queue.h b/tasks_required/remote_queue/include/remote_queue/remote_queue.h index f0cf88119..b736b71c1 100644 --- a/tasks_required/remote_queue/include/remote_queue/remote_queue.h +++ b/tasks_required/remote_queue/include/remote_queue/remote_queue.h @@ -50,7 +50,7 @@ class Client : public TaskLibClient { task->Wait(); id_ = task->id_; queue_id_ = QueueId(id_); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } /** Destroy task state + queue */ diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index b0718a7c7..02cca5b92 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -278,7 +278,7 @@ class Server : public TaskLib { orig_task->task_state_, state_id, method); - LABSTOR_CLIENT->DelTask(orig_task); + // LABSTOR_CLIENT->DelTask(orig_task); req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); } From 403d7cc4813ccb4352f758031badf32573072afa Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 12:05:18 -0500 Subject: [PATCH 13/49] Enable proc_queue fress --- .../include/labstor_admin/labstor_admin.h | 16 ++++++++-------- .../include/proc_queue/proc_queue_tasks.h | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin.h b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin.h index 2ded473d5..8fc0ab097 100644 --- a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin.h +++ b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin.h @@ -35,7 +35,7 @@ class Client : public TaskLibClient { const std::string &lib_name) { LPointer task = AsyncRegisterTaskLibRoot(domain_id, lib_name); task->Wait(); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(RegisterTaskLib) @@ -55,7 +55,7 @@ class Client : public TaskLibClient { LPointer task = AsyncDestroyTaskLibRoot(domain_id, lib_name); task->Wait(); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(DestroyTaskLib) @@ -77,7 +77,7 @@ class Client : public TaskLibClient { domain_id, std::forward(args)...); task->Wait(); TaskStateId new_id = task->id_; - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); if (new_id.IsNull()) { HELOG(kWarning, "Failed to create task state"); } @@ -130,7 +130,7 @@ class Client : public TaskLibClient { AsyncGetOrCreateTaskStateIdRoot(domain_id, state_name); task->Wait(); TaskStateId new_id = task->id_; - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); return new_id; } LABSTOR_TASK_NODE_ADMIN_ROOT(GetOrCreateTaskStateId) @@ -149,7 +149,7 @@ class Client : public TaskLibClient { AsyncGetTaskStateIdRoot(domain_id, state_name); task->Wait(); TaskStateId new_id = task->id_; - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); return new_id; } LABSTOR_TASK_NODE_ADMIN_ROOT(GetTaskStateId) @@ -169,7 +169,7 @@ class Client : public TaskLibClient { LPointer task = AsyncDestroyTaskStateRoot(domain_id, id); task->Wait(); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(DestroyTaskState) @@ -195,7 +195,7 @@ class Client : public TaskLibClient { LPointer task = AsyncSetWorkOrchQueuePolicyRoot(domain_id, policy); task->Wait(); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(SetWorkOrchQueuePolicy); @@ -212,7 +212,7 @@ class Client : public TaskLibClient { LPointer task = AsyncSetWorkOrchProcPolicyRoot(domain_id, policy); task->Wait(); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } LABSTOR_TASK_NODE_ADMIN_ROOT(SetWorkOrchProcPolicy); }; diff --git a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h index dd50a3d5b..9372d1307 100644 --- a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h +++ b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h @@ -109,11 +109,11 @@ struct TypedPushTask : public Task, TaskFlags { /** Destructor */ ~TypedPushTask() { -// if (!IsFireAndForget()) { -// LABSTOR_CLIENT->DelTask(sub_cli_); -// } else { -// LABSTOR_CLIENT->DelTask(sub_run_); -// } + if (!IsFireAndForget()) { + LABSTOR_CLIENT->DelTask(sub_cli_); + } else { + LABSTOR_CLIENT->DelTask(sub_run_); + } } /** Create group */ From 1fe00243d6a28473e82fc6cc53283f4b1cdb06d1 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 12:08:55 -0500 Subject: [PATCH 14/49] Disable proc queue free --- .../proc_queue/include/proc_queue/proc_queue_tasks.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h index 9372d1307..dd50a3d5b 100644 --- a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h +++ b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h @@ -109,11 +109,11 @@ struct TypedPushTask : public Task, TaskFlags { /** Destructor */ ~TypedPushTask() { - if (!IsFireAndForget()) { - LABSTOR_CLIENT->DelTask(sub_cli_); - } else { - LABSTOR_CLIENT->DelTask(sub_run_); - } +// if (!IsFireAndForget()) { +// LABSTOR_CLIENT->DelTask(sub_cli_); +// } else { +// LABSTOR_CLIENT->DelTask(sub_run_); +// } } /** Create group */ From 7c2178b84e242723132f78ab21db4210e69c5751 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 12:27:13 -0500 Subject: [PATCH 15/49] Add back all other deltasks --- tasks/bdev/include/bdev/bdev.h | 2 +- tasks/hermes/include/hermes/bucket.h | 4 +-- .../include/hermes_adapters/hermes_adapters.h | 2 +- .../include/hermes_blob_mdm/hermes_blob_mdm.h | 28 +++++++++---------- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 20 ++++++------- .../hermes_bucket_mdm/hermes_bucket_mdm.h | 20 ++++++------- .../src/hermes_bucket_mdm.cc | 8 +++--- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/tasks/bdev/include/bdev/bdev.h b/tasks/bdev/include/bdev/bdev.h index b69f56c07..17b130b87 100644 --- a/tasks/bdev/include/bdev/bdev.h +++ b/tasks/bdev/include/bdev/bdev.h @@ -55,7 +55,7 @@ class Client : public TaskLibClient { id_ = task->id_; queue_id_ = QueueId(id_); monitor_task_ = AsyncMonitor(task->task_node_, 100).ptr_; - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreateTaskState); diff --git a/tasks/hermes/include/hermes/bucket.h b/tasks/hermes/include/hermes/bucket.h index 2869a2816..3c13ffe30 100644 --- a/tasks/hermes/include/hermes/bucket.h +++ b/tasks/hermes/include/hermes/bucket.h @@ -240,7 +240,7 @@ class Bucket { push_task->Wait(); PutBlobTask *task = push_task->get(); blob_id = task->blob_id_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } } return blob_id; @@ -435,7 +435,7 @@ class Bucket { char *data = LABSTOR_CLIENT->GetPrivatePointer(task->data_); memcpy(blob.data(), data, data_size); // LABSTOR_CLIENT->FreeBuffer(task->data_); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return blob_id; } diff --git a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h index 25a8e4f9e..1817cdf75 100644 --- a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h +++ b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h @@ -42,7 +42,7 @@ class Client : public TaskLibClient { task->Wait(); id_ = task->id_; queue_id_ = QueueId(id_); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } /** Destroy task state + queue */ diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h index d3cce712b..9b82d620f 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h @@ -44,7 +44,7 @@ class Client : public TaskLibClient { if (task->IsComplete()) { id_ = task->id_; queue_id_ = QueueId(id_); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreate); @@ -79,7 +79,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncSetBucketMdmRoot(domain_id, blob_mdm_id); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(SetBucketMdm); @@ -101,7 +101,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetOrCreateBlobIdTask *task = push_task->get(); BlobId blob_id = task->blob_id_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return blob_id; } LABSTOR_TASK_NODE_PUSH_ROOT(GetOrCreateBlobId); @@ -165,7 +165,7 @@ class Client : public TaskLibClient { GetBlobTask *task = push_task->get(); data = task->data_; size_t true_size = task->data_size_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return true_size; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlob); @@ -211,7 +211,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTagBlobRoot(tag_id, blob_id, tag); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TagBlob); @@ -235,7 +235,7 @@ class Client : public TaskLibClient { push_task->Wait(); BlobHasTagTask *task = push_task->get(); bool has_tag = task->has_tag_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return has_tag; } LABSTOR_TASK_NODE_PUSH_ROOT(BlobHasTag); @@ -259,7 +259,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetBlobIdTask *task = push_task->get(); BlobId blob_id = task->blob_id_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return blob_id; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobId); @@ -282,7 +282,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetBlobNameTask *task = push_task->get(); std::string blob_name = task->blob_name_->str(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return blob_name; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobName); @@ -308,7 +308,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetBlobSizeTask *task = push_task->get(); size_t size = task->size_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return size; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobSize); @@ -331,7 +331,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetBlobScoreTask *task = push_task->get(); float score = task->score_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return score; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobScore); @@ -354,7 +354,7 @@ class Client : public TaskLibClient { GetBlobBuffersTask *task = push_task->get(); std::vector buffers = hshm::to_stl_vector(*task->buffers_); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return buffers; } LABSTOR_TASK_NODE_PUSH_ROOT(GetBlobBuffers) @@ -378,7 +378,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncRenameBlobRoot(tag_id, blob_id, new_blob_name); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(RenameBlob); @@ -400,7 +400,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTruncateBlobRoot(tag_id, blob_id, new_size); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TruncateBlob); @@ -420,7 +420,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncDestroyBlobRoot(tag_id, blob_id); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(DestroyBlob); }; diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index 08cba96e8..df2077126 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -282,7 +282,7 @@ class Server : public TaskLib { sub_plcmnt.size_ += diff; HILOG(kDebug, "Passing {} bytes to target {}", diff, sub_plcmnt.tid_); } -// LABSTOR_CLIENT->DelTask(task->cur_bdev_alloc_); + LABSTOR_CLIENT->DelTask(task->cur_bdev_alloc_); if (task->plcmnt_idx_ < (*task->schema_).size()) { task->phase_ = PutBlobPhase::kAllocate; return; @@ -337,14 +337,14 @@ class Server : public TaskLib { } } for (bdev::WriteTask *&write_task : write_tasks) { -// LABSTOR_CLIENT->DelTask(write_task); + LABSTOR_CLIENT->DelTask(write_task); } HILOG(kDebug, "PutBlobTask complete"); -// HSHM_DESTROY_AR(task->schema_); -// HSHM_DESTROY_AR(task->bdev_writes_); -// if (task->flags_.Any(HERMES_DID_STAGE_IN)) { -// LABSTOR_CLIENT->FreeBuffer(task->data_ptr_); -// } + HSHM_DESTROY_AR(task->schema_); + HSHM_DESTROY_AR(task->bdev_writes_); + if (task->flags_.Any(HERMES_DID_STAGE_IN)) { + LABSTOR_CLIENT->FreeBuffer(task->data_ptr_); + } // Update the bucket statistics int update_mode = bucket_mdm::UpdateSizeMode::kAdd; if (task->flags_.Any(HERMES_IS_FILE)) { @@ -421,7 +421,7 @@ class Server : public TaskLib { } } for (bdev::ReadTask *&read_task : read_tasks) { -// LABSTOR_CLIENT->DelTask(read_task); + LABSTOR_CLIENT->DelTask(read_task); } HSHM_DESTROY_AR(task->bdev_reads_); HILOG(kDebug, "GetBlobTask complete"); @@ -642,7 +642,7 @@ class Server : public TaskLib { } } for (bdev::FreeTask *&free_task : free_tasks) { -// LABSTOR_CLIENT->DelTask(free_task); + LABSTOR_CLIENT->DelTask(free_task); } BLOB_MAP_T &blob_map = blob_map_[ctx.lane_id_]; BlobInfo &blob_info = blob_map[task->blob_id_]; @@ -686,7 +686,7 @@ class Server : public TaskLib { if (!task->get_task_->IsComplete()) { return; } -// LABSTOR_CLIENT->DelTask(task->get_task_); + LABSTOR_CLIENT->DelTask(task->get_task_); task->phase_ = ReorganizeBlobPhase::kPut; } case ReorganizeBlobPhase::kPut: { diff --git a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm.h b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm.h index 8c7d980a8..479085856 100644 --- a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm.h +++ b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm.h @@ -57,7 +57,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncSetBlobMdmRoot(domain_id, blob_mdm_id); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(SetBlobMdm); @@ -141,7 +141,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetOrCreateTagTask *task = push_task->get(); TagId tag_id = task->tag_id_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return tag_id; } LABSTOR_TASK_NODE_PUSH_ROOT(GetOrCreateTag); @@ -161,7 +161,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetTagIdTask *task = push_task->get(); TagId tag_id = task->tag_id_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return tag_id; } LABSTOR_TASK_NODE_PUSH_ROOT(GetTagId); @@ -181,7 +181,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetTagNameTask *task = push_task->get(); hshm::string tag_name = hshm::to_charbuf(*task->tag_name_.get()); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return tag_name; } LABSTOR_TASK_NODE_PUSH_ROOT(GetTagName); @@ -200,7 +200,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncRenameTagRoot(tag_id, new_tag_name); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(RenameTag); @@ -217,7 +217,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncDestroyTagRoot(tag_id); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(DestroyTag); @@ -235,7 +235,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTagAddBlobRoot(tag_id, blob_id); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TagAddBlob); @@ -252,7 +252,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTagRemoveBlobRoot(tag_id, blob_id); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TagRemoveBlob); @@ -269,7 +269,7 @@ class Client : public TaskLibClient { LPointer> push_task = AsyncTagClearBlobsRoot(tag_id); push_task->Wait(); - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } LABSTOR_TASK_NODE_PUSH_ROOT(TagClearBlobs); @@ -288,7 +288,7 @@ class Client : public TaskLibClient { push_task->Wait(); GetSizeTask *task = push_task->get(); size_t size = task->size_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); return size; } LABSTOR_TASK_NODE_PUSH_ROOT(GetSize); diff --git a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc index 5b2768925..5d1a96fc0 100644 --- a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc +++ b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc @@ -115,7 +115,7 @@ class Server : public TaskLib { LABSTOR_CLIENT->node_id_, task->tag_id_, task->task_node_) for (AppendInfo &append : append_info) { append.blob_id_ = append.blob_id_task_->blob_id_; -// LABSTOR_CLIENT->DelTask(append.blob_id_task_); + LABSTOR_CLIENT->DelTask(append.blob_id_task_); } task->SetModuleComplete(); } @@ -178,10 +178,10 @@ class Server : public TaskLib { HILOG(kDebug, "(node {}) PUT blobs for tag {} (task_node={})", LABSTOR_CLIENT->node_id_, task->tag_id_, task->task_node_) for (AppendInfo &append : append_info) { -// LABSTOR_CLIENT->DelTask(append.put_task_); + LABSTOR_CLIENT->DelTask(append.put_task_); } HSHM_DESTROY_AR(task->schema_->append_info_); -// LABSTOR_CLIENT->DelTask(task->schema_); + LABSTOR_CLIENT->DelTask(task->schema_); task->SetModuleComplete(); } } @@ -294,7 +294,7 @@ class Server : public TaskLib { } } for (blob_mdm::DestroyBlobTask *&blob_task : blob_tasks) { -// LABSTOR_CLIENT->DelTask(blob_task); + LABSTOR_CLIENT->DelTask(blob_task); } HSHM_DESTROY_AR(task->destroy_blob_tasks_); TAG_MAP_T &tag_map = tag_map_[ctx.lane_id_]; From 0ec596487bcf112df4fa4b3124ffcc9d42195b75 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 18:06:11 -0500 Subject: [PATCH 16/49] Remove all deltasks from cc files --- tasks/bdev/include/bdev/bdev.h | 2 +- .../hermes_adapters/include/hermes_adapters/hermes_adapters.h | 2 +- .../hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h | 2 +- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 4 ++-- tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/bdev/include/bdev/bdev.h b/tasks/bdev/include/bdev/bdev.h index 17b130b87..b69f56c07 100644 --- a/tasks/bdev/include/bdev/bdev.h +++ b/tasks/bdev/include/bdev/bdev.h @@ -55,7 +55,7 @@ class Client : public TaskLibClient { id_ = task->id_; queue_id_ = QueueId(id_); monitor_task_ = AsyncMonitor(task->task_node_, 100).ptr_; - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreateTaskState); diff --git a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h index 1817cdf75..25a8e4f9e 100644 --- a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h +++ b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h @@ -42,7 +42,7 @@ class Client : public TaskLibClient { task->Wait(); id_ = task->id_; queue_id_ = QueueId(id_); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } /** Destroy task state + queue */ diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h index 9b82d620f..80b5e1ec6 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h @@ -44,7 +44,7 @@ class Client : public TaskLibClient { if (task->IsComplete()) { id_ = task->id_; queue_id_ = QueueId(id_); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreate); diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index df2077126..17f78a331 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -282,7 +282,7 @@ class Server : public TaskLib { sub_plcmnt.size_ += diff; HILOG(kDebug, "Passing {} bytes to target {}", diff, sub_plcmnt.tid_); } - LABSTOR_CLIENT->DelTask(task->cur_bdev_alloc_); + // LABSTOR_CLIENT->DelTask(task->cur_bdev_alloc_); if (task->plcmnt_idx_ < (*task->schema_).size()) { task->phase_ = PutBlobPhase::kAllocate; return; @@ -686,7 +686,7 @@ class Server : public TaskLib { if (!task->get_task_->IsComplete()) { return; } - LABSTOR_CLIENT->DelTask(task->get_task_); + // LABSTOR_CLIENT->DelTask(task->get_task_); task->phase_ = ReorganizeBlobPhase::kPut; } case ReorganizeBlobPhase::kPut: { diff --git a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc index 5d1a96fc0..14d9b32e9 100644 --- a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc +++ b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc @@ -181,7 +181,7 @@ class Server : public TaskLib { LABSTOR_CLIENT->DelTask(append.put_task_); } HSHM_DESTROY_AR(task->schema_->append_info_); - LABSTOR_CLIENT->DelTask(task->schema_); + // LABSTOR_CLIENT->DelTask(task->schema_); task->SetModuleComplete(); } } From 61833578b50a1abbfb23de4a68ccebeb48ea47f2 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 19:02:15 -0500 Subject: [PATCH 17/49] Uncomment asynccreatecomplete --- tasks/bdev/include/bdev/bdev.h | 2 +- tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h | 2 +- tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/bdev/include/bdev/bdev.h b/tasks/bdev/include/bdev/bdev.h index b69f56c07..17b130b87 100644 --- a/tasks/bdev/include/bdev/bdev.h +++ b/tasks/bdev/include/bdev/bdev.h @@ -55,7 +55,7 @@ class Client : public TaskLibClient { id_ = task->id_; queue_id_ = QueueId(id_); monitor_task_ = AsyncMonitor(task->task_node_, 100).ptr_; - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreateTaskState); diff --git a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h index 25a8e4f9e..1817cdf75 100644 --- a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h +++ b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters.h @@ -42,7 +42,7 @@ class Client : public TaskLibClient { task->Wait(); id_ = task->id_; queue_id_ = QueueId(id_); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } /** Destroy task state + queue */ diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h index 80b5e1ec6..9b82d620f 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h @@ -44,7 +44,7 @@ class Client : public TaskLibClient { if (task->IsComplete()) { id_ = task->id_; queue_id_ = QueueId(id_); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreate); From 92da3106673183f27d7ffe08ed4f1512c1991124 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 19:06:21 -0500 Subject: [PATCH 18/49] Comment out asynccreaetcomplete --- tasks/bdev/include/bdev/bdev.h | 2 +- tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/bdev/include/bdev/bdev.h b/tasks/bdev/include/bdev/bdev.h index 17b130b87..b69f56c07 100644 --- a/tasks/bdev/include/bdev/bdev.h +++ b/tasks/bdev/include/bdev/bdev.h @@ -55,7 +55,7 @@ class Client : public TaskLibClient { id_ = task->id_; queue_id_ = QueueId(id_); monitor_task_ = AsyncMonitor(task->task_node_, 100).ptr_; - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreateTaskState); diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h index 9b82d620f..80b5e1ec6 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h @@ -44,7 +44,7 @@ class Client : public TaskLibClient { if (task->IsComplete()) { id_ = task->id_; queue_id_ = QueueId(id_); - LABSTOR_CLIENT->DelTask(task); + // LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreate); From e3d8c040ec4b49a30838c0344a5b5c5ebb6ae170 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 20:21:17 -0500 Subject: [PATCH 19/49] Use stack allocator instead of page allocator --- include/labstor/api/labstor_runtime.h | 3 ++- tasks/bdev/include/bdev/bdev.h | 2 +- .../include/hermes_blob_mdm/hermes_blob_mdm.h | 2 +- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 4 ++-- tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc | 2 +- tasks_required/labstor_admin/src/labstor_admin.cc | 2 +- .../proc_queue/include/proc_queue/proc_queue_tasks.h | 10 +++++----- .../remote_queue/include/remote_queue/remote_queue.h | 2 +- tasks_required/remote_queue/src/remote_queue.cc | 2 +- 9 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/labstor/api/labstor_runtime.h b/include/labstor/api/labstor_runtime.h index 76f4525e6..2465b9d4c 100644 --- a/include/labstor/api/labstor_runtime.h +++ b/include/labstor/api/labstor_runtime.h @@ -135,8 +135,9 @@ class Runtime : public ConfigurationManager { mem_mngr->CreateBackend( server_config_.queue_manager_.shm_size_, server_config_.queue_manager_.shm_name_); + // hipc::ScalablePageAllocator main_alloc_ = - mem_mngr->CreateAllocator( + mem_mngr->CreateAllocator( server_config_.queue_manager_.shm_name_, main_alloc_id_, sizeof(LabstorShm)); diff --git a/tasks/bdev/include/bdev/bdev.h b/tasks/bdev/include/bdev/bdev.h index b69f56c07..17b130b87 100644 --- a/tasks/bdev/include/bdev/bdev.h +++ b/tasks/bdev/include/bdev/bdev.h @@ -55,7 +55,7 @@ class Client : public TaskLibClient { id_ = task->id_; queue_id_ = QueueId(id_); monitor_task_ = AsyncMonitor(task->task_node_, 100).ptr_; - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreateTaskState); diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h index 80b5e1ec6..9b82d620f 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm.h @@ -44,7 +44,7 @@ class Client : public TaskLibClient { if (task->IsComplete()) { id_ = task->id_; queue_id_ = QueueId(id_); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } } LABSTOR_TASK_NODE_ROOT(AsyncCreate); diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index 17f78a331..df2077126 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -282,7 +282,7 @@ class Server : public TaskLib { sub_plcmnt.size_ += diff; HILOG(kDebug, "Passing {} bytes to target {}", diff, sub_plcmnt.tid_); } - // LABSTOR_CLIENT->DelTask(task->cur_bdev_alloc_); + LABSTOR_CLIENT->DelTask(task->cur_bdev_alloc_); if (task->plcmnt_idx_ < (*task->schema_).size()) { task->phase_ = PutBlobPhase::kAllocate; return; @@ -686,7 +686,7 @@ class Server : public TaskLib { if (!task->get_task_->IsComplete()) { return; } - // LABSTOR_CLIENT->DelTask(task->get_task_); + LABSTOR_CLIENT->DelTask(task->get_task_); task->phase_ = ReorganizeBlobPhase::kPut; } case ReorganizeBlobPhase::kPut: { diff --git a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc index 14d9b32e9..5d1a96fc0 100644 --- a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc +++ b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc @@ -181,7 +181,7 @@ class Server : public TaskLib { LABSTOR_CLIENT->DelTask(append.put_task_); } HSHM_DESTROY_AR(task->schema_->append_info_); - // LABSTOR_CLIENT->DelTask(task->schema_); + LABSTOR_CLIENT->DelTask(task->schema_); task->SetModuleComplete(); } } diff --git a/tasks_required/labstor_admin/src/labstor_admin.cc b/tasks_required/labstor_admin/src/labstor_admin.cc index d400d06e4..d80e4998a 100644 --- a/tasks_required/labstor_admin/src/labstor_admin.cc +++ b/tasks_required/labstor_admin/src/labstor_admin.cc @@ -51,7 +51,7 @@ class Server : public TaskLib { LABSTOR_ADMIN->AsyncGetOrCreateTaskStateId(task->task_node_ + 1, domain, state_name); get_id->Wait(task); task->id_ = get_id->id_; - // LABSTOR_CLIENT->DelTask(get_id); + LABSTOR_CLIENT->DelTask(get_id); } // Create the task state HILOG(kInfo, "(node {}) Creating task state {} with id {} (task_node={})", diff --git a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h index dd50a3d5b..9372d1307 100644 --- a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h +++ b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h @@ -109,11 +109,11 @@ struct TypedPushTask : public Task, TaskFlags { /** Destructor */ ~TypedPushTask() { -// if (!IsFireAndForget()) { -// LABSTOR_CLIENT->DelTask(sub_cli_); -// } else { -// LABSTOR_CLIENT->DelTask(sub_run_); -// } + if (!IsFireAndForget()) { + LABSTOR_CLIENT->DelTask(sub_cli_); + } else { + LABSTOR_CLIENT->DelTask(sub_run_); + } } /** Create group */ diff --git a/tasks_required/remote_queue/include/remote_queue/remote_queue.h b/tasks_required/remote_queue/include/remote_queue/remote_queue.h index b736b71c1..f0cf88119 100644 --- a/tasks_required/remote_queue/include/remote_queue/remote_queue.h +++ b/tasks_required/remote_queue/include/remote_queue/remote_queue.h @@ -50,7 +50,7 @@ class Client : public TaskLibClient { task->Wait(); id_ = task->id_; queue_id_ = QueueId(id_); - // LABSTOR_CLIENT->DelTask(task); + LABSTOR_CLIENT->DelTask(task); } /** Destroy task state + queue */ diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index 02cca5b92..b0718a7c7 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -278,7 +278,7 @@ class Server : public TaskLib { orig_task->task_state_, state_id, method); - // LABSTOR_CLIENT->DelTask(orig_task); + LABSTOR_CLIENT->DelTask(orig_task); req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); } From cecea758c717fdd56b5573e66b1df9c8b2dc1cf7 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 20:43:03 -0500 Subject: [PATCH 20/49] Deltask increments --- include/labstor/api/labstor_client.h | 14 ++++++++++++-- include/labstor/api/labstor_runtime.h | 3 +-- include/labstor/task_registry/task.h | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index a7d98f267..e2adff3fb 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -140,14 +140,24 @@ class Client : public ConfigurationManager { HSHM_ALWAYS_INLINE void DelTask(TaskT *task) { // TODO(llogan): verify leak - main_alloc_->DelObj(task); + task->delcnt_++; + if (task->delcnt_ > 0) { + HELOG(kFatal, "Freed task twice: node={}, state={}. method={}", + task->task_node_, task->task_state_, task->method_) + } + // main_alloc_->DelObj(task); } /** Destroy a task */ template HSHM_ALWAYS_INLINE void DelTask(LPointer &task) { - main_alloc_->DelObjLocal(task); + task->delcnt_++; + if (task->delcnt_ > 0) { + HELOG(kFatal, "Freed task twice: node={}, state={}. method={}", + task->task_node_, task->task_state_, task->method_) + } + // main_alloc_->DelObjLocal(task); } /** Get a queue by its ID */ diff --git a/include/labstor/api/labstor_runtime.h b/include/labstor/api/labstor_runtime.h index 2465b9d4c..76f4525e6 100644 --- a/include/labstor/api/labstor_runtime.h +++ b/include/labstor/api/labstor_runtime.h @@ -135,9 +135,8 @@ class Runtime : public ConfigurationManager { mem_mngr->CreateBackend( server_config_.queue_manager_.shm_size_, server_config_.queue_manager_.shm_name_); - // hipc::ScalablePageAllocator main_alloc_ = - mem_mngr->CreateAllocator( + mem_mngr->CreateAllocator( server_config_.queue_manager_.shm_name_, main_alloc_id_, sizeof(LabstorShm)); diff --git a/include/labstor/task_registry/task.h b/include/labstor/task_registry/task.h index 19a834109..d9871b876 100644 --- a/include/labstor/task_registry/task.h +++ b/include/labstor/task_registry/task.h @@ -256,6 +256,7 @@ struct Task : public hipc::ShmContainer { u32 lane_hash_; /**< Determine the lane a task is keyed to */ u32 method_; /**< The method to call in the state */ bitfield32_t task_flags_; /**< Properties of the task */ + std::atomic delcnt_ = 0; /**< # of times deltask called */ RunContext ctx_; /**==================================== From 6639d7eca0fdd82ffc69318f21c73e19f804ce0b Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 21:21:45 -0500 Subject: [PATCH 21/49] Make delete counter more accurate --- include/labstor/api/labstor_client.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index e2adff3fb..518bcae26 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -141,9 +141,9 @@ class Client : public ConfigurationManager { void DelTask(TaskT *task) { // TODO(llogan): verify leak task->delcnt_++; - if (task->delcnt_ > 0) { - HELOG(kFatal, "Freed task twice: node={}, state={}. method={}", - task->task_node_, task->task_state_, task->method_) + if (task->delcnt_ > 1) { + HELOG(kFatal, "Freed task {} times: node={}, state={}. method={}", + task->delcnt_.load(), task->task_node_, task->task_state_, task->method_) } // main_alloc_->DelObj(task); } @@ -153,9 +153,9 @@ class Client : public ConfigurationManager { HSHM_ALWAYS_INLINE void DelTask(LPointer &task) { task->delcnt_++; - if (task->delcnt_ > 0) { - HELOG(kFatal, "Freed task twice: node={}, state={}. method={}", - task->task_node_, task->task_state_, task->method_) + if (task->delcnt_ > 1) { + HELOG(kFatal, "Freed task {} times: node={}, state={}. method={}", + task->delcnt_.load(), task->task_node_, task->task_state_, task->method_) } // main_alloc_->DelObjLocal(task); } From e77c8a45313af61403510b531e18f7dc3a149309 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Wed, 27 Sep 2023 23:51:51 -0500 Subject: [PATCH 22/49] Add Del method to TaskState --- codegen/refresh_methods | 14 ++++ include/labstor/api/labstor_client.h | 14 ++++ include/labstor/task_registry/task_lib.h | 3 + include/labstor/work_orchestrator/worker.h | 6 +- src/worker.cc | 4 +- tasks/bdev/include/bdev/bdev_lib_exec.h | 37 ++++++++++ .../hermes_adapters_lib_exec.h | 17 +++++ .../hermes_blob_mdm_lib_exec.h | 73 +++++++++++++++++++ .../hermes_bucket_mdm_lib_exec.h | 65 +++++++++++++++++ .../include/hermes_mdm/hermes_mdm_lib_exec.h | 13 ++++ .../include/TASK_NAME/TASK_NAME_lib_exec.h | 17 +++++ .../labstor_admin/labstor_admin_lib_exec.h | 41 +++++++++++ .../include/proc_queue/proc_queue_lib_exec.h | 17 +++++ .../remote_queue/remote_queue_lib_exec.h | 17 +++++ .../remote_queue/src/remote_queue.cc | 2 +- .../small_message/small_message_lib_exec.h | 25 +++++++ .../worch_proc_round_robin_lib_exec.h | 17 +++++ .../worch_queue_round_robin_lib_exec.h | 17 +++++ 18 files changed, 393 insertions(+), 6 deletions(-) diff --git a/codegen/refresh_methods b/codegen/refresh_methods index 404f6a705..5082431da 100755 --- a/codegen/refresh_methods +++ b/codegen/refresh_methods @@ -67,6 +67,20 @@ def refresh_methods(TASK_ROOT): lines += [' }'] lines += ['}'] + ## Create the Del method + lines += ['/** Delete a task */', + 'void Del(u32 method, Task *task) override {', + ' switch (method) {'] + for method_enum_name, method_off in methods: + method_name = method_enum_name.replace('k', '', 1) + task_name = method_name + "Task" + lines += [f' case Method::{method_enum_name}: {{', + f' LABSTOR_CLIENT->DelTask(reinterpret_cast<{task_name} *>(task));', + f' break;', + f' }}'] + lines += [' }'] + lines += ['}'] + ## Create the ReplicateStart method lines += ['/** Ensure there is space to store replicated outputs */', 'void ReplicateStart(u32 method, u32 count, Task *task) override {', diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index 518bcae26..1ecec78ac 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -160,6 +160,20 @@ class Client : public ConfigurationManager { // main_alloc_->DelObjLocal(task); } + /** Destroy a task */ + template + HSHM_ALWAYS_INLINE + void DelTask(TaskStateT *exec, TaskT *task) { + exec->Del(task->method_, task); + } + + /** Destroy a task */ + template + HSHM_ALWAYS_INLINE + void DelTask(TaskStateT *exec, LPointer &task) { + exec->Del(task->method_, task); + } + /** Get a queue by its ID */ HSHM_ALWAYS_INLINE MultiQueue* GetQueue(const QueueId &queue_id) { diff --git a/include/labstor/task_registry/task_lib.h b/include/labstor/task_registry/task_lib.h index acf82efad..38166c1bf 100644 --- a/include/labstor/task_registry/task_lib.h +++ b/include/labstor/task_registry/task_lib.h @@ -79,6 +79,9 @@ class TaskLib { /** Run a method of the task */ virtual void Run(u32 method, Task *task, RunContext &ctx) = 0; + /** Delete a task */ + virtual void Del(u32 method, Task *task) = 0; + /** Allow task to store replicas of completion */ virtual void ReplicateStart(u32 method, u32 count, Task *task) = 0; diff --git a/include/labstor/work_orchestrator/worker.h b/include/labstor/work_orchestrator/worker.h index 23555bd31..4f60cfd24 100644 --- a/include/labstor/work_orchestrator/worker.h +++ b/include/labstor/work_orchestrator/worker.h @@ -345,10 +345,10 @@ class Worker { } HSHM_ALWAYS_INLINE - void EndTask(Lane *lane, Task *task, int &off) { + void EndTask(Lane *lane, TaskState *exec, Task *task, int &off) { PopTask(lane, off); - if (task->IsFireAndForget()) { - LABSTOR_CLIENT->DelTask(task); + if (exec && task->IsFireAndForget()) { + LABSTOR_CLIENT->DelTask(exec, task); } else { task->SetComplete(); } diff --git a/src/worker.cc b/src/worker.cc index 491fdd29f..83eba8c7a 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -64,7 +64,7 @@ void Worker::PollGrouped(WorkEntry &work_entry) { HELOG(kFatal, "(node {}) Could not find the task state: {}", LABSTOR_CLIENT->node_id_, task->task_state_); entry->complete_ = true; - EndTask(lane, task, off); + EndTask(lane, exec, task, off); continue; } // Attempt to run the task if it's ready and runnable @@ -110,7 +110,7 @@ void Worker::PollGrouped(WorkEntry &work_entry) { ABT_thread_join(entry->thread_); } RemoveTaskGroup(task, exec, work_entry.lane_id_, is_remote); - EndTask(lane, task, off); + EndTask(lane, exec, task, off); } else { off += 1; } diff --git a/tasks/bdev/include/bdev/bdev_lib_exec.h b/tasks/bdev/include/bdev/bdev_lib_exec.h index 943c61ed2..09d254b63 100644 --- a/tasks/bdev/include/bdev/bdev_lib_exec.h +++ b/tasks/bdev/include/bdev/bdev_lib_exec.h @@ -38,6 +38,43 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kWrite: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kRead: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kAllocate: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kFree: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kMonitor: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kUpdateCapacity: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters_lib_exec.h b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters_lib_exec.h index 3ca8e4e03..14487c641 100644 --- a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters_lib_exec.h +++ b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters_lib_exec.h @@ -18,6 +18,23 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kCustom: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_lib_exec.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_lib_exec.h index 55f37fe6d..82d11fb4a 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_lib_exec.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_lib_exec.h @@ -74,6 +74,79 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kPutBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kTruncateBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestroyBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kTagBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kBlobHasTag: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetBlobId: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetOrCreateBlobId: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetBlobName: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetBlobSize: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetBlobScore: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetBlobBuffers: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kRenameBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kReorganizeBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kSetBucketMdm: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_lib_exec.h b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_lib_exec.h index def2f8430..e6049800e 100644 --- a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_lib_exec.h +++ b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_lib_exec.h @@ -66,6 +66,71 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetOrCreateTag: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetTagId: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetTagName: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kRenameTag: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestroyTag: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kTagAddBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kTagRemoveBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kTagClearBlobs: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kUpdateSize: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kAppendBlobSchema: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kAppendBlob: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetSize: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kSetBlobMdm: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_lib_exec.h b/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_lib_exec.h index 2d5c8cd7b..3e63ce550 100644 --- a/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_lib_exec.h +++ b/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_lib_exec.h @@ -14,6 +14,19 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks_required/TASK_NAME/include/TASK_NAME/TASK_NAME_lib_exec.h b/tasks_required/TASK_NAME/include/TASK_NAME/TASK_NAME_lib_exec.h index 95ba64a49..3d5dec399 100644 --- a/tasks_required/TASK_NAME/include/TASK_NAME/TASK_NAME_lib_exec.h +++ b/tasks_required/TASK_NAME/include/TASK_NAME/TASK_NAME_lib_exec.h @@ -18,6 +18,23 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kCustom: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_lib_exec.h b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_lib_exec.h index 0bcdc2d02..67ef8580a 100644 --- a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_lib_exec.h +++ b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_lib_exec.h @@ -42,6 +42,47 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kCreateTaskState: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestroyTaskState: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kRegisterTaskLib: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestroyTaskLib: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetOrCreateTaskStateId: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kGetTaskStateId: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kStopRuntime: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kSetWorkOrchQueuePolicy: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kSetWorkOrchProcPolicy: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks_required/proc_queue/include/proc_queue/proc_queue_lib_exec.h b/tasks_required/proc_queue/include/proc_queue/proc_queue_lib_exec.h index f7f4ef23f..d1e9d9f76 100644 --- a/tasks_required/proc_queue/include/proc_queue/proc_queue_lib_exec.h +++ b/tasks_required/proc_queue/include/proc_queue/proc_queue_lib_exec.h @@ -18,6 +18,23 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kPush: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks_required/remote_queue/include/remote_queue/remote_queue_lib_exec.h b/tasks_required/remote_queue/include/remote_queue/remote_queue_lib_exec.h index 1bb6e92a9..d7cf4da16 100644 --- a/tasks_required/remote_queue/include/remote_queue/remote_queue_lib_exec.h +++ b/tasks_required/remote_queue/include/remote_queue/remote_queue_lib_exec.h @@ -18,6 +18,23 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kPush: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index b0718a7c7..1b7b03f3c 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -278,7 +278,7 @@ class Server : public TaskLib { orig_task->task_state_, state_id, method); - LABSTOR_CLIENT->DelTask(orig_task); + LABSTOR_CLIENT->DelTask(exec, orig_task); req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); } diff --git a/tasks_required/small_message/include/small_message/small_message_lib_exec.h b/tasks_required/small_message/include/small_message/small_message_lib_exec.h index 68aab730b..d8506c79c 100644 --- a/tasks_required/small_message/include/small_message/small_message_lib_exec.h +++ b/tasks_required/small_message/include/small_message/small_message_lib_exec.h @@ -26,6 +26,31 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kMd: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kIo: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kMdPush: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks_required/worch_proc_round_robin/include/worch_proc_round_robin/worch_proc_round_robin_lib_exec.h b/tasks_required/worch_proc_round_robin/include/worch_proc_round_robin/worch_proc_round_robin_lib_exec.h index 21d3493ee..da2bbf2ad 100644 --- a/tasks_required/worch_proc_round_robin/include/worch_proc_round_robin/worch_proc_round_robin_lib_exec.h +++ b/tasks_required/worch_proc_round_robin/include/worch_proc_round_robin/worch_proc_round_robin_lib_exec.h @@ -18,6 +18,23 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kSchedule: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { diff --git a/tasks_required/worch_queue_round_robin/include/worch_queue_round_robin/worch_queue_round_robin_lib_exec.h b/tasks_required/worch_queue_round_robin/include/worch_queue_round_robin/worch_queue_round_robin_lib_exec.h index 9223e7f1e..badbb309e 100644 --- a/tasks_required/worch_queue_round_robin/include/worch_queue_round_robin/worch_queue_round_robin_lib_exec.h +++ b/tasks_required/worch_queue_round_robin/include/worch_queue_round_robin/worch_queue_round_robin_lib_exec.h @@ -18,6 +18,23 @@ void Run(u32 method, Task *task, RunContext &ctx) override { } } } +/** Delete a task */ +void Del(u32 method, Task *task) override { + switch (method) { + case Method::kConstruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kDestruct: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + case Method::kSchedule: { + LABSTOR_CLIENT->DelTask(reinterpret_cast(task)); + break; + } + } +} /** Ensure there is space to store replicated outputs */ void ReplicateStart(u32 method, u32 count, Task *task) override { switch (method) { From 69763139f3311bc73bbbd7fceab2044bec9cbdc5 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 00:04:06 -0500 Subject: [PATCH 23/49] Inequal one? --- include/labstor/api/labstor_client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index 1ecec78ac..d70845639 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -141,7 +141,7 @@ class Client : public ConfigurationManager { void DelTask(TaskT *task) { // TODO(llogan): verify leak task->delcnt_++; - if (task->delcnt_ > 1) { + if (task->delcnt_ != 1) { HELOG(kFatal, "Freed task {} times: node={}, state={}. method={}", task->delcnt_.load(), task->task_node_, task->task_state_, task->method_) } @@ -153,7 +153,7 @@ class Client : public ConfigurationManager { HSHM_ALWAYS_INLINE void DelTask(LPointer &task) { task->delcnt_++; - if (task->delcnt_ > 1) { + if (task->delcnt_ != 1) { HELOG(kFatal, "Freed task {} times: node={}, state={}. method={}", task->delcnt_.load(), task->task_node_, task->task_state_, task->method_) } From 073266e8a00fe90639760d015c4319fe0a344188 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 00:06:21 -0500 Subject: [PATCH 24/49] Uncomment DelObj for task ptr --- include/labstor/api/labstor_client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index d70845639..b24e5fdf2 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -145,7 +145,7 @@ class Client : public ConfigurationManager { HELOG(kFatal, "Freed task {} times: node={}, state={}. method={}", task->delcnt_.load(), task->task_node_, task->task_state_, task->method_) } - // main_alloc_->DelObj(task); + main_alloc_->DelObj(task); } /** Destroy a task */ From 029b79b89319aac6f631a03913784f0a9f2b55ac Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 00:14:29 -0500 Subject: [PATCH 25/49] Change TaskPointer to LPointer --- codegen/refresh_methods | 4 +- include/labstor/task_registry/task_lib.h | 40 +---------- tasks/bdev/include/bdev/bdev_lib_exec.h | 32 ++++----- .../hermes_adapters_lib_exec.h | 12 ++-- .../hermes_blob_mdm_lib_exec.h | 68 +++++++++---------- .../hermes_bucket_mdm_lib_exec.h | 60 ++++++++-------- .../include/hermes_mdm/hermes_mdm_lib_exec.h | 8 +-- .../include/TASK_NAME/TASK_NAME_lib_exec.h | 12 ++-- .../labstor_admin/labstor_admin_lib_exec.h | 36 +++++----- .../include/proc_queue/proc_queue_lib_exec.h | 12 ++-- .../remote_queue/remote_queue_lib_exec.h | 12 ++-- .../remote_queue/src/remote_queue.cc | 4 +- .../small_message/small_message_lib_exec.h | 20 +++--- .../worch_proc_round_robin_lib_exec.h | 12 ++-- .../worch_queue_round_robin_lib_exec.h | 12 ++-- 15 files changed, 153 insertions(+), 191 deletions(-) diff --git a/codegen/refresh_methods b/codegen/refresh_methods index 5082431da..b10e94ed5 100755 --- a/codegen/refresh_methods +++ b/codegen/refresh_methods @@ -133,8 +133,8 @@ def refresh_methods(TASK_ROOT): method_name = method_enum_name.replace('k', '', 1) task_name = method_name + "Task" lines += [f' case Method::{method_enum_name}: {{', - f' task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask<{task_name}>(task_ptr.p_);', - f' ar >> *reinterpret_cast<{task_name}*>(task_ptr.task_);', + f' task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask<{task_name}>(task_ptr.shm_);', + f' ar >> *reinterpret_cast<{task_name}*>(task_ptr.ptr_);', f' break;', f' }}'] lines += [' }'] diff --git a/include/labstor/task_registry/task_lib.h b/include/labstor/task_registry/task_lib.h index 38166c1bf..53caedaf6 100644 --- a/include/labstor/task_registry/task_lib.h +++ b/include/labstor/task_registry/task_lib.h @@ -13,45 +13,7 @@ namespace labstor { -struct TaskPointer { - Task *task_; - hipc::Pointer p_; - - /** Default constructor */ - TaskPointer() : task_(nullptr) {} - - /** Task-only constructor */ - TaskPointer(Task *task) : task_(task) {} - - /** Emplace constructor */ - TaskPointer(Task *task, hipc::Pointer p) : task_(task), p_(p) {} - - /** Copy constructor */ - TaskPointer(const TaskPointer &other) : task_(other.task_), p_(other.p_) {} - - /** Copy operator */ - TaskPointer &operator=(const TaskPointer &other) { - task_ = other.task_; - p_ = other.p_; - return *this; - } - - /** Move constructor */ - TaskPointer(TaskPointer &&other) noexcept - : task_(other.task_), p_(other.p_) { - other.task_ = nullptr; - other.p_ = hipc::Pointer(); - } - - /** Move operator */ - TaskPointer &operator=(TaskPointer &&other) noexcept { - task_ = other.task_; - p_ = other.p_; - other.task_ = nullptr; - other.p_ = hipc::Pointer(); - return *this; - } -}; +typedef LPointer TaskPointer; /** * Represents a custom operation to perform. diff --git a/tasks/bdev/include/bdev/bdev_lib_exec.h b/tasks/bdev/include/bdev/bdev_lib_exec.h index 09d254b63..d130e634e 100644 --- a/tasks/bdev/include/bdev/bdev_lib_exec.h +++ b/tasks/bdev/include/bdev/bdev_lib_exec.h @@ -192,43 +192,43 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kWrite: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kRead: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kAllocate: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kFree: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kMonitor: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kUpdateCapacity: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters_lib_exec.h b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters_lib_exec.h index 14487c641..49e23ba6b 100644 --- a/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters_lib_exec.h +++ b/tasks/hermes_adapters/include/hermes_adapters/hermes_adapters_lib_exec.h @@ -92,18 +92,18 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kCustom: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_lib_exec.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_lib_exec.h index 82d11fb4a..49b80c9ac 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_lib_exec.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_lib_exec.h @@ -372,88 +372,88 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kPutBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kTruncateBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestroyBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kTagBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kBlobHasTag: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetBlobId: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetOrCreateBlobId: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetBlobName: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetBlobSize: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetBlobScore: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetBlobBuffers: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kRenameBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kReorganizeBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kSetBucketMdm: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_lib_exec.h b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_lib_exec.h index e6049800e..8e2a1d03e 100644 --- a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_lib_exec.h +++ b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_lib_exec.h @@ -332,78 +332,78 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetOrCreateTag: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetTagId: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetTagName: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kRenameTag: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestroyTag: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kTagAddBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kTagRemoveBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kTagClearBlobs: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kUpdateSize: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kAppendBlobSchema: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kAppendBlob: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetSize: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kSetBlobMdm: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_lib_exec.h b/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_lib_exec.h index 3e63ce550..105572c86 100644 --- a/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_lib_exec.h +++ b/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_lib_exec.h @@ -72,13 +72,13 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks_required/TASK_NAME/include/TASK_NAME/TASK_NAME_lib_exec.h b/tasks_required/TASK_NAME/include/TASK_NAME/TASK_NAME_lib_exec.h index 3d5dec399..5b9af6f98 100644 --- a/tasks_required/TASK_NAME/include/TASK_NAME/TASK_NAME_lib_exec.h +++ b/tasks_required/TASK_NAME/include/TASK_NAME/TASK_NAME_lib_exec.h @@ -92,18 +92,18 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kCustom: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_lib_exec.h b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_lib_exec.h index 67ef8580a..53fac0830 100644 --- a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_lib_exec.h +++ b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_lib_exec.h @@ -212,48 +212,48 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kCreateTaskState: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestroyTaskState: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kRegisterTaskLib: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestroyTaskLib: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetOrCreateTaskStateId: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kGetTaskStateId: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kStopRuntime: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kSetWorkOrchQueuePolicy: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kSetWorkOrchProcPolicy: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks_required/proc_queue/include/proc_queue/proc_queue_lib_exec.h b/tasks_required/proc_queue/include/proc_queue/proc_queue_lib_exec.h index d1e9d9f76..c3fffff4b 100644 --- a/tasks_required/proc_queue/include/proc_queue/proc_queue_lib_exec.h +++ b/tasks_required/proc_queue/include/proc_queue/proc_queue_lib_exec.h @@ -92,18 +92,18 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kPush: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks_required/remote_queue/include/remote_queue/remote_queue_lib_exec.h b/tasks_required/remote_queue/include/remote_queue/remote_queue_lib_exec.h index d7cf4da16..6d5ef8721 100644 --- a/tasks_required/remote_queue/include/remote_queue/remote_queue_lib_exec.h +++ b/tasks_required/remote_queue/include/remote_queue/remote_queue_lib_exec.h @@ -92,18 +92,18 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kPush: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index 1b7b03f3c..917a6d58a 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -241,8 +241,8 @@ class Server : public TaskLib { state_id); } TaskPointer task_ptr = exec->LoadStart(method, ar); - orig_task = task_ptr.task_; - hipc::Pointer &p = task_ptr.p_; + orig_task = task_ptr.ptr_; + hipc::Pointer &p = task_ptr.shm_; orig_task->domain_id_ = DomainId::GetNode(LABSTOR_CLIENT->node_id_); // Execute task diff --git a/tasks_required/small_message/include/small_message/small_message_lib_exec.h b/tasks_required/small_message/include/small_message/small_message_lib_exec.h index d8506c79c..ae08efc87 100644 --- a/tasks_required/small_message/include/small_message/small_message_lib_exec.h +++ b/tasks_required/small_message/include/small_message/small_message_lib_exec.h @@ -132,28 +132,28 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kMd: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kIo: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kMdPush: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks_required/worch_proc_round_robin/include/worch_proc_round_robin/worch_proc_round_robin_lib_exec.h b/tasks_required/worch_proc_round_robin/include/worch_proc_round_robin/worch_proc_round_robin_lib_exec.h index da2bbf2ad..5d47d3c7d 100644 --- a/tasks_required/worch_proc_round_robin/include/worch_proc_round_robin/worch_proc_round_robin_lib_exec.h +++ b/tasks_required/worch_proc_round_robin/include/worch_proc_round_robin/worch_proc_round_robin_lib_exec.h @@ -92,18 +92,18 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kSchedule: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } diff --git a/tasks_required/worch_queue_round_robin/include/worch_queue_round_robin/worch_queue_round_robin_lib_exec.h b/tasks_required/worch_queue_round_robin/include/worch_queue_round_robin/worch_queue_round_robin_lib_exec.h index badbb309e..2e6a1aec9 100644 --- a/tasks_required/worch_queue_round_robin/include/worch_queue_round_robin/worch_queue_round_robin_lib_exec.h +++ b/tasks_required/worch_queue_round_robin/include/worch_queue_round_robin/worch_queue_round_robin_lib_exec.h @@ -92,18 +92,18 @@ TaskPointer LoadStart(u32 method, BinaryInputArchive &ar) override { TaskPointer task_ptr; switch (method) { case Method::kConstruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kDestruct: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } case Method::kSchedule: { - task_ptr.task_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.p_); - ar >> *reinterpret_cast(task_ptr.task_); + task_ptr.ptr_ = LABSTOR_CLIENT->NewEmptyTask(task_ptr.shm_); + ar >> *reinterpret_cast(task_ptr.ptr_); break; } } From cd773655cc713623a481f6499d4854ec6c7d3f93 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 00:57:14 -0500 Subject: [PATCH 26/49] Try running it using PutTask as coroutingg --- .../hermes_blob_mdm/hermes_blob_mdm_tasks.h | 10 +- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 189 ++++++------------ 2 files changed, 62 insertions(+), 137 deletions(-) diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h index 037abaa9c..82f9f2a08 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h @@ -224,15 +224,6 @@ struct PutBlobTask : public Task, TaskFlags IN hipc::ShmArchive filename_; IN size_t page_size_; - TEMP int phase_ = PutBlobPhase::kCreate; - TEMP int plcmnt_idx_ = 0; - TEMP int sub_plcmnt_idx_ = 0; - TEMP LPointer data_ptr_; - TEMP size_t data_off_; - TEMP hermes::bdev::AllocateTask *cur_bdev_alloc_; - TEMP hipc::ShmArchive> schema_; - TEMP hipc::ShmArchive> bdev_writes_; - /** SHM default constructor */ HSHM_ALWAYS_INLINE explicit PutBlobTask(hipc::Allocator *alloc) : Task(alloc) {} @@ -259,6 +250,7 @@ struct PutBlobTask : public Task, TaskFlags task_state_ = state_id; method_ = Method::kPutBlob; task_flags_ = task_flags; + task_flags_.SetBits(TASK_COROUTINE); if (!blob_id.IsNull()) { lane_hash_ = blob_id.hash_; domain_id_ = domain_id; diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index df2077126..9ad9b3c4b 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -116,33 +116,6 @@ class Server : public TaskLib { * Create a blob's metadata * */ void PutBlob(PutBlobTask *task, RunContext &ctx) { - if (task->phase_ == PutBlobPhase::kCreate) { - PutBlobCreatePhase(task, ctx); - } - if (task->phase_ == PutBlobPhase::kAllocate) { - PutBlobAllocatePhase(task, ctx); - } - if (task->phase_ == PutBlobPhase::kWaitAllocate) { - if (!task->cur_bdev_alloc_->IsComplete()){ - return; - } - PutBlobWaitAllocatePhase(task, ctx); - } - if (task->phase_ == PutBlobPhase::kModify) { - PutBlobModifyPhase(task, ctx); - } - if (task->phase_ == PutBlobPhase::kWaitModify) { - PutBlobWaitModifyPhase(task, ctx); - if (task->phase_ == PutBlobPhase::kWaitModify) { - return; - } - } - } - - /** Create blob / update metadata for the PUT */ - void PutBlobCreatePhase(PutBlobTask *task, RunContext &ctx) { - HILOG(kDebug, "PutBlobPhase::kCreate {}", task->blob_id_); - // Get the blob info data structure hshm::charbuf blob_name = hshm::to_charbuf(*task->blob_name_); if (task->blob_id_.IsNull()) { @@ -174,13 +147,15 @@ class Server : public TaskLib { } // Stage in blob data from FS - task->data_ptr_.ptr_ = LABSTOR_CLIENT->GetPrivatePointer(task->data_); - task->data_ptr_.shm_ = task->data_; + LPointer data_ptr; + data_ptr.ptr_ = LABSTOR_CLIENT->GetPrivatePointer(task->data_); + data_ptr.shm_ = task->data_; + size_t data_off = 0; if (task->filename_->size() > 0) { adapter::BlobPlacement plcmnt; plcmnt.DecodeBlobName(*task->blob_name_); task->flags_.SetBits(HERMES_IS_FILE); - task->data_off_ = plcmnt.bucket_off_ + task->blob_off_ + task->data_size_; + data_off = plcmnt.bucket_off_ + task->blob_off_ + task->data_size_; if (blob_info.blob_size_ == 0 && task->blob_off_ == 0 && task->data_size_ < task->page_size_) { @@ -197,8 +172,8 @@ class Server : public TaskLib { HELOG(kError, "Failed to stage in {} bytes from {}", task->page_size_, task->filename_->str()); } HERMES_POSIX_API->close(fd); - memcpy(new_data_ptr.ptr_ + plcmnt.blob_off_, task->data_ptr_.ptr_, task->data_size_); - task->data_ptr_ = new_data_ptr; + memcpy(new_data_ptr.ptr_ + plcmnt.blob_off_, data_ptr.ptr_, task->data_size_); + data_ptr = new_data_ptr; task->blob_off_ = 0; if (ret < task->blob_off_ + task->data_size_) { task->data_size_ = task->blob_off_ + task->data_size_; @@ -218,87 +193,44 @@ class Server : public TaskLib { size_diff = needed_space - blob_info.max_blob_size_; } if (!task->flags_.Any(HERMES_IS_FILE)) { - task->data_off_ = size_diff; + data_off = size_diff; } blob_info.blob_size_ += size_diff; HILOG(kDebug, "The size diff is {} bytes", size_diff) - - // Initialize archives - HSHM_MAKE_AR0(task->schema_, nullptr); - HSHM_MAKE_AR0(task->bdev_writes_, nullptr); - // Use DPE + std::vector schema_vec; if (size_diff > 0) { Context ctx; auto *dpe = DpeFactory::Get(ctx.dpe_); - dpe->Placement({size_diff}, targets_, ctx, *task->schema_); - task->phase_ = PutBlobPhase::kAllocate; - } else { - task->phase_ = PutBlobPhase::kModify; - } - } - - /** Release buffers */ - void PutBlobFreeBuffersPhase(BlobInfo &blob_info, PutBlobTask *task, RunContext &ctx) { - for (BufferInfo &buf : blob_info.buffers_) { - TargetInfo &target = *target_map_[buf.tid_]; - std::vector buf_vec = {buf}; - target.AsyncFree(task->task_node_ + 1, std::move(buf_vec), true); - } - blob_info.buffers_.clear(); - blob_info.max_blob_size_ = 0; - blob_info.blob_size_ = 0; - } - - /** Resolve the current sub-placement using BPM */ - void PutBlobAllocatePhase(PutBlobTask *task, RunContext &ctx) { - BLOB_MAP_T &blob_map = blob_map_[ctx.lane_id_]; - BlobInfo &blob_info = blob_map[task->blob_id_]; - PlacementSchema &schema = (*task->schema_)[task->plcmnt_idx_]; - SubPlacement &placement = schema.plcmnts_[task->sub_plcmnt_idx_]; - TargetInfo &bdev = *target_map_[placement.tid_]; - HILOG(kDebug, "Allocating {} bytes of blob {}", placement.size_, task->blob_id_); - task->cur_bdev_alloc_ = bdev.AsyncAllocate(task->task_node_ + 1, - placement.size_, - blob_info.buffers_).ptr_; - task->phase_ = PutBlobPhase::kWaitAllocate; - } - - /** Wait for the current-subplacement to complete */ - void PutBlobWaitAllocatePhase(PutBlobTask *task, RunContext &ctx) { - BLOB_MAP_T &blob_map = blob_map_[ctx.lane_id_]; - BlobInfo &blob_info = blob_map[task->blob_id_]; - PlacementSchema &schema = (*task->schema_)[task->plcmnt_idx_]; - ++task->sub_plcmnt_idx_; - if (task->sub_plcmnt_idx_ >= schema.plcmnts_.size()) { - ++task->plcmnt_idx_; - task->sub_plcmnt_idx_ = 0; - } - if (task->cur_bdev_alloc_->alloc_size_ < task->cur_bdev_alloc_->size_) { - size_t diff = task->cur_bdev_alloc_->size_ - task->cur_bdev_alloc_->alloc_size_; - PlacementSchema &schema = (*task->schema_)[task->plcmnt_idx_]; - SubPlacement &sub_plcmnt = schema.plcmnts_[task->sub_plcmnt_idx_]; - sub_plcmnt.size_ += diff; - HILOG(kDebug, "Passing {} bytes to target {}", diff, sub_plcmnt.tid_); - } - LABSTOR_CLIENT->DelTask(task->cur_bdev_alloc_); - if (task->plcmnt_idx_ < (*task->schema_).size()) { - task->phase_ = PutBlobPhase::kAllocate; - return; - } else { - task->phase_ = PutBlobPhase::kModify; - task->bdev_writes_->reserve(blob_info.buffers_.size()); + dpe->Placement({size_diff}, targets_, ctx, schema_vec); + } + + // Allocate blob buffers + for (PlacementSchema &schema : schema_vec) { + for (size_t sub_idx = 0; sub_idx < schema.plcmnts_.size(); ++sub_idx) { + SubPlacement &placement = schema.plcmnts_[sub_idx]; + TargetInfo &bdev = *target_map_[placement.tid_]; + LPointer alloc_task = + bdev.AsyncAllocate(task->task_node_ + 1, + placement.size_, + blob_info.buffers_); + alloc_task->Wait(task); + if (alloc_task->alloc_size_ < alloc_task->size_) { + // SubPlacement &next_placement = schema.plcmnts_[sub_idx + 1]; + // size_t diff = alloc_task->size_ - alloc_task->alloc_size_; + // next_placement.size_ += diff; + HILOG(kFatal, "Ran outta space in this tier -- will fix soon") + } + LABSTOR_CLIENT->DelTask(alloc_task); + } } - } - /** Update the data on storage */ - void PutBlobModifyPhase(PutBlobTask *task, RunContext &ctx) { - BLOB_MAP_T &blob_map = blob_map_[ctx.lane_id_]; - BlobInfo &blob_info = blob_map[task->blob_id_]; - char *blob_buf = task->data_ptr_.ptr_; - std::vector &write_tasks = *task->bdev_writes_; + // Place blob in buffers + std::vector> write_tasks; + write_tasks.reserve(blob_info.buffers_.size()); size_t blob_off = 0, buf_off = 0; + char *blob_buf = data_ptr.ptr_; HILOG(kDebug, "Number of buffers {}", blob_info.buffers_.size()); for (BufferInfo &buf : blob_info.buffers_) { size_t blob_left = blob_off; @@ -312,56 +244,57 @@ class Server : public TaskLib { } HILOG(kDebug, "Writing {} bytes at off {} from target {}", buf_size, tgt_off, buf.tid_) TargetInfo &target = *target_map_[buf.tid_]; - bdev::WriteTask *write_task = target.AsyncWrite(task->task_node_ + 1, - blob_buf + buf_off, - tgt_off, buf_size).ptr_; + LPointer write_task = + target.AsyncWrite(task->task_node_ + 1, + blob_buf + buf_off, + tgt_off, buf_size); write_tasks.emplace_back(write_task); buf_off += buf_size; } blob_off += buf.t_size_; } - if (blob_off < task->data_size_) { - HELOG(kFatal, "Something annoying happened"); - } blob_info.max_blob_size_ = blob_off; - task->phase_ = PutBlobPhase::kWaitModify; - HILOG(kDebug, "Modified {} bytes of blob {}", blob_off, task->blob_id_); - } - /** Wait for the update to complete */ - void PutBlobWaitModifyPhase(PutBlobTask *task, RunContext &ctx) { - std::vector &write_tasks = *task->bdev_writes_; - for (bdev::WriteTask *&write_task : write_tasks) { - if (!write_task->IsComplete()) { - return; - } - } - for (bdev::WriteTask *&write_task : write_tasks) { + // Wait for the placements to complete + for (LPointer &write_task : write_tasks) { + write_task->Wait(task); LABSTOR_CLIENT->DelTask(write_task); } - HILOG(kDebug, "PutBlobTask complete"); - HSHM_DESTROY_AR(task->schema_); - HSHM_DESTROY_AR(task->bdev_writes_); - if (task->flags_.Any(HERMES_DID_STAGE_IN)) { - LABSTOR_CLIENT->FreeBuffer(task->data_ptr_); - } - // Update the bucket statistics + + // Update information int update_mode = bucket_mdm::UpdateSizeMode::kAdd; if (task->flags_.Any(HERMES_IS_FILE)) { update_mode = bucket_mdm::UpdateSizeMode::kCap; } bkt_mdm_.AsyncUpdateSize(task->task_node_ + 1, task->tag_id_, - task->data_off_, + data_off, update_mode); if (task->flags_.Any(HERMES_BLOB_DID_CREATE)) { bkt_mdm_.AsyncTagAddBlob(task->task_node_ + 1, task->tag_id_, task->blob_id_); } + + // Free data + if (task->flags_.Any(HERMES_DID_STAGE_IN)) { + LABSTOR_CLIENT->FreeBuffer(data_ptr); + } task->SetModuleComplete(); } + /** Release buffers */ + void PutBlobFreeBuffersPhase(BlobInfo &blob_info, PutBlobTask *task, RunContext &ctx) { + for (BufferInfo &buf : blob_info.buffers_) { + TargetInfo &target = *target_map_[buf.tid_]; + std::vector buf_vec = {buf}; + target.AsyncFree(task->task_node_ + 1, std::move(buf_vec), true); + } + blob_info.buffers_.clear(); + blob_info.max_blob_size_ = 0; + blob_info.blob_size_ = 0; + } + /** Get a blob's data */ void GetBlob(GetBlobTask *task, RunContext &ctx) { switch (task->phase_) { From 3acb1b87d1679ba1851e92dc729f6933810918e3 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 01:16:03 -0500 Subject: [PATCH 27/49] Don't free sync put blob --- tasks/hermes/include/hermes/bucket.h | 12 ++++++------ .../include/hermes_blob_mdm/hermes_blob_mdm_tasks.h | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tasks/hermes/include/hermes/bucket.h b/tasks/hermes/include/hermes/bucket.h index 3c13ffe30..60b21bea2 100644 --- a/tasks/hermes/include/hermes/bucket.h +++ b/tasks/hermes/include/hermes/bucket.h @@ -236,12 +236,12 @@ class Bucket { blob_id, blob_off, blob.size(), p.shm_, ctx.blob_score_, flags, ctx, task_flags); if constexpr (!ASYNC) { - if (flags.Any(HERMES_GET_BLOB_ID)) { - push_task->Wait(); - PutBlobTask *task = push_task->get(); - blob_id = task->blob_id_; - LABSTOR_CLIENT->DelTask(push_task); - } +// if (flags.Any(HERMES_GET_BLOB_ID)) { +// push_task->Wait(); +// PutBlobTask *task = push_task->get(); +// blob_id = task->blob_id_; +// LABSTOR_CLIENT->DelTask(push_task); +// } } return blob_id; } diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h index 82f9f2a08..35740abb9 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h @@ -276,11 +276,11 @@ struct PutBlobTask : public Task, TaskFlags /** Destructor */ ~PutBlobTask() { -// HSHM_DESTROY_AR(blob_name_); -// HSHM_DESTROY_AR(filename_); -// if (IsDataOwner()) { -// LABSTOR_CLIENT->FreeBuffer(data_); -// } + HSHM_DESTROY_AR(blob_name_); + HSHM_DESTROY_AR(filename_); + if (IsDataOwner()) { + LABSTOR_CLIENT->FreeBuffer(data_); + } } /** (De)serialize message call */ From 8dc94690606e6104936c9ba3bfbaccc78844a851 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 01:20:27 -0500 Subject: [PATCH 28/49] PushTask wait --- tasks/hermes/include/hermes/bucket.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/hermes/include/hermes/bucket.h b/tasks/hermes/include/hermes/bucket.h index 60b21bea2..bbdded1b4 100644 --- a/tasks/hermes/include/hermes/bucket.h +++ b/tasks/hermes/include/hermes/bucket.h @@ -236,12 +236,12 @@ class Bucket { blob_id, blob_off, blob.size(), p.shm_, ctx.blob_score_, flags, ctx, task_flags); if constexpr (!ASYNC) { -// if (flags.Any(HERMES_GET_BLOB_ID)) { -// push_task->Wait(); -// PutBlobTask *task = push_task->get(); -// blob_id = task->blob_id_; -// LABSTOR_CLIENT->DelTask(push_task); -// } + if (flags.Any(HERMES_GET_BLOB_ID)) { + push_task->Wait(); + PutBlobTask *task = push_task->get(); + blob_id = task->blob_id_; + // LABSTOR_CLIENT->DelTask(push_task); + } } return blob_id; } From 353ef38c50b93cab236fe7d31249566007de94d4 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 01:29:32 -0500 Subject: [PATCH 29/49] Freeing task print --- include/labstor/api/labstor_client.h | 2 ++ tasks/hermes/include/hermes/bucket.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index b24e5fdf2..a30254ca2 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -145,6 +145,8 @@ class Client : public ConfigurationManager { HELOG(kFatal, "Freed task {} times: node={}, state={}. method={}", task->delcnt_.load(), task->task_node_, task->task_state_, task->method_) } + HILOG(kInfo, "Freeing task_node={} task_state={} task_method={}", + task->task_node_, task->task_state_, task->method_) main_alloc_->DelObj(task); } diff --git a/tasks/hermes/include/hermes/bucket.h b/tasks/hermes/include/hermes/bucket.h index bbdded1b4..3c13ffe30 100644 --- a/tasks/hermes/include/hermes/bucket.h +++ b/tasks/hermes/include/hermes/bucket.h @@ -240,7 +240,7 @@ class Bucket { push_task->Wait(); PutBlobTask *task = push_task->get(); blob_id = task->blob_id_; - // LABSTOR_CLIENT->DelTask(push_task); + LABSTOR_CLIENT->DelTask(push_task); } } return blob_id; From 01e970a9364e5684d5cb0d3ad28dad64c364920f Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 01:37:08 -0500 Subject: [PATCH 30/49] Comment out put blob task --- .../include/hermes_blob_mdm/hermes_blob_mdm_tasks.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h index 35740abb9..82f9f2a08 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h @@ -276,11 +276,11 @@ struct PutBlobTask : public Task, TaskFlags /** Destructor */ ~PutBlobTask() { - HSHM_DESTROY_AR(blob_name_); - HSHM_DESTROY_AR(filename_); - if (IsDataOwner()) { - LABSTOR_CLIENT->FreeBuffer(data_); - } +// HSHM_DESTROY_AR(blob_name_); +// HSHM_DESTROY_AR(filename_); +// if (IsDataOwner()) { +// LABSTOR_CLIENT->FreeBuffer(data_); +// } } /** (De)serialize message call */ From d60beacb43e04371a6da4a0cee96cef817c1414c Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 01:44:14 -0500 Subject: [PATCH 31/49] Don't do fire & forget frees --- include/labstor/work_orchestrator/worker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/labstor/work_orchestrator/worker.h b/include/labstor/work_orchestrator/worker.h index 4f60cfd24..c56525368 100644 --- a/include/labstor/work_orchestrator/worker.h +++ b/include/labstor/work_orchestrator/worker.h @@ -348,7 +348,7 @@ class Worker { void EndTask(Lane *lane, TaskState *exec, Task *task, int &off) { PopTask(lane, off); if (exec && task->IsFireAndForget()) { - LABSTOR_CLIENT->DelTask(exec, task); + // LABSTOR_CLIENT->DelTask(exec, task); } else { task->SetComplete(); } From 68b2a4633141b3967efdfe084a14b020cd1abec7 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 01:49:12 -0500 Subject: [PATCH 32/49] Remove a few deltasks from hermes_blob_mdm --- include/labstor/work_orchestrator/worker.h | 2 +- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/labstor/work_orchestrator/worker.h b/include/labstor/work_orchestrator/worker.h index c56525368..4f60cfd24 100644 --- a/include/labstor/work_orchestrator/worker.h +++ b/include/labstor/work_orchestrator/worker.h @@ -348,7 +348,7 @@ class Worker { void EndTask(Lane *lane, TaskState *exec, Task *task, int &off) { PopTask(lane, off); if (exec && task->IsFireAndForget()) { - // LABSTOR_CLIENT->DelTask(exec, task); + LABSTOR_CLIENT->DelTask(exec, task); } else { task->SetComplete(); } diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index 9ad9b3c4b..668fe461d 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -258,7 +258,7 @@ class Server : public TaskLib { // Wait for the placements to complete for (LPointer &write_task : write_tasks) { write_task->Wait(task); - LABSTOR_CLIENT->DelTask(write_task); + // LABSTOR_CLIENT->DelTask(write_task); } // Update information @@ -278,7 +278,7 @@ class Server : public TaskLib { // Free data if (task->flags_.Any(HERMES_DID_STAGE_IN)) { - LABSTOR_CLIENT->FreeBuffer(data_ptr); + // LABSTOR_CLIENT->FreeBuffer(data_ptr); } task->SetModuleComplete(); } @@ -288,7 +288,7 @@ class Server : public TaskLib { for (BufferInfo &buf : blob_info.buffers_) { TargetInfo &target = *target_map_[buf.tid_]; std::vector buf_vec = {buf}; - target.AsyncFree(task->task_node_ + 1, std::move(buf_vec), true); + // target.AsyncFree(task->task_node_ + 1, std::move(buf_vec), true); } blob_info.buffers_.clear(); blob_info.max_blob_size_ = 0; From efaf2ce056bcae5e225f1b8e1db4b499bb2ad72d Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 01:51:27 -0500 Subject: [PATCH 33/49] Remove blob registration and bucket updates --- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index 668fe461d..d3cb3f667 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -266,15 +266,15 @@ class Server : public TaskLib { if (task->flags_.Any(HERMES_IS_FILE)) { update_mode = bucket_mdm::UpdateSizeMode::kCap; } - bkt_mdm_.AsyncUpdateSize(task->task_node_ + 1, - task->tag_id_, - data_off, - update_mode); - if (task->flags_.Any(HERMES_BLOB_DID_CREATE)) { - bkt_mdm_.AsyncTagAddBlob(task->task_node_ + 1, - task->tag_id_, - task->blob_id_); - } +// bkt_mdm_.AsyncUpdateSize(task->task_node_ + 1, +// task->tag_id_, +// data_off, +// update_mode); +// if (task->flags_.Any(HERMES_BLOB_DID_CREATE)) { +// bkt_mdm_.AsyncTagAddBlob(task->task_node_ + 1, +// task->tag_id_, +// task->blob_id_); +// } // Free data if (task->flags_.Any(HERMES_DID_STAGE_IN)) { From bfb1531344eedb5512b368eafbfaac404a1e8051 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 01:53:11 -0500 Subject: [PATCH 34/49] Remove deltsk from remote queue --- tasks_required/remote_queue/src/remote_queue.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index 917a6d58a..ac6c4768a 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -278,7 +278,7 @@ class Server : public TaskLib { orig_task->task_state_, state_id, method); - LABSTOR_CLIENT->DelTask(exec, orig_task); + // LABSTOR_CLIENT->DelTask(exec, orig_task); req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); } From 40bf8f1af6008c0c36d3f9e6fd203c3d42e8a9b4 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 01:58:22 -0500 Subject: [PATCH 35/49] Remove del of allocts --- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index d3cb3f667..69ba7b882 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -222,7 +222,7 @@ class Server : public TaskLib { // next_placement.size_ += diff; HILOG(kFatal, "Ran outta space in this tier -- will fix soon") } - LABSTOR_CLIENT->DelTask(alloc_task); + // LABSTOR_CLIENT->DelTask(alloc_task); } } From 50fe5902d833bccc6a7f0d669b237c30c9d23191 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 02:01:00 -0500 Subject: [PATCH 36/49] ensure its not stack overflow --- include/labstor/task_registry/task.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/labstor/task_registry/task.h b/include/labstor/task_registry/task.h index d9871b876..ed532b88c 100644 --- a/include/labstor/task_registry/task.h +++ b/include/labstor/task_registry/task.h @@ -234,7 +234,7 @@ class TaskPrio { struct RunContext { u32 lane_id_; /**< The lane id of the task */ bctx::transfer_t jmp_; /**< Current execution state of the task (runtime) */ - size_t stack_size_ = KILOBYTES(64); /**< The size of the stack for the task (runtime) */ + size_t stack_size_ = KILOBYTES(256); /**< The size of the stack for the task (runtime) */ void *stack_ptr_; /**< The pointer to the stack (runtime) */ TaskLib *exec_; From 7f93491d263d622f5e2387431e029b162c4787b4 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 12:27:57 -0500 Subject: [PATCH 37/49] Place blob in buffers --- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index 69ba7b882..b532ed9d5 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -222,7 +222,7 @@ class Server : public TaskLib { // next_placement.size_ += diff; HILOG(kFatal, "Ran outta space in this tier -- will fix soon") } - // LABSTOR_CLIENT->DelTask(alloc_task); + LABSTOR_CLIENT->DelTask(alloc_task); } } @@ -258,7 +258,7 @@ class Server : public TaskLib { // Wait for the placements to complete for (LPointer &write_task : write_tasks) { write_task->Wait(task); - // LABSTOR_CLIENT->DelTask(write_task); + LABSTOR_CLIENT->DelTask(write_task); } // Update information @@ -266,19 +266,19 @@ class Server : public TaskLib { if (task->flags_.Any(HERMES_IS_FILE)) { update_mode = bucket_mdm::UpdateSizeMode::kCap; } -// bkt_mdm_.AsyncUpdateSize(task->task_node_ + 1, -// task->tag_id_, -// data_off, -// update_mode); -// if (task->flags_.Any(HERMES_BLOB_DID_CREATE)) { -// bkt_mdm_.AsyncTagAddBlob(task->task_node_ + 1, -// task->tag_id_, -// task->blob_id_); -// } + bkt_mdm_.AsyncUpdateSize(task->task_node_ + 1, + task->tag_id_, + data_off, + update_mode); + if (task->flags_.Any(HERMES_BLOB_DID_CREATE)) { + bkt_mdm_.AsyncTagAddBlob(task->task_node_ + 1, + task->tag_id_, + task->blob_id_); + } // Free data if (task->flags_.Any(HERMES_DID_STAGE_IN)) { - // LABSTOR_CLIENT->FreeBuffer(data_ptr); + LABSTOR_CLIENT->FreeBuffer(data_ptr); } task->SetModuleComplete(); } From 2560369b6cb9d66cbe069c0f5546726e54f7c182 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 12:30:25 -0500 Subject: [PATCH 38/49] Support all deltasks --- include/labstor/api/labstor_client.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index a30254ca2..03be87336 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -145,8 +145,6 @@ class Client : public ConfigurationManager { HELOG(kFatal, "Freed task {} times: node={}, state={}. method={}", task->delcnt_.load(), task->task_node_, task->task_state_, task->method_) } - HILOG(kInfo, "Freeing task_node={} task_state={} task_method={}", - task->task_node_, task->task_state_, task->method_) main_alloc_->DelObj(task); } @@ -159,7 +157,7 @@ class Client : public ConfigurationManager { HELOG(kFatal, "Freed task {} times: node={}, state={}. method={}", task->delcnt_.load(), task->task_node_, task->task_state_, task->method_) } - // main_alloc_->DelObjLocal(task); + main_alloc_->DelObjLocal(task); } /** Destroy a task */ From 6568e4e5a3d75b6de8df9cb326e834bac564b10d Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 12:59:23 -0500 Subject: [PATCH 39/49] Slightly change access order in remote queue --- .../remote_queue/include/remote_queue/remote_queue.h | 2 +- tasks_required/remote_queue/src/remote_queue.cc | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tasks_required/remote_queue/include/remote_queue/remote_queue.h b/tasks_required/remote_queue/include/remote_queue/remote_queue.h index f0cf88119..fe9b31c3d 100644 --- a/tasks_required/remote_queue/include/remote_queue/remote_queue.h +++ b/tasks_required/remote_queue/include/remote_queue/remote_queue.h @@ -72,7 +72,7 @@ class Client : public TaskLibClient { // Create subtasks exec->ReplicateStart(orig_task->method_, domain_ids.size(), orig_task); - auto push_task = LABSTOR_CLIENT->NewTask( + LPointer push_task = LABSTOR_CLIENT->NewTask( orig_task->task_node_ + 1, DomainId::GetLocal(), id_, domain_ids, orig_task, exec, orig_task->method_, xfer); MultiQueue *queue = LABSTOR_CLIENT->GetQueue(queue_id_); diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index ac6c4768a..6c0a26a8c 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -50,7 +50,7 @@ class Server : public TaskLib { } /** Handle output from replica PUSH */ - static void HandlePushReplicaOutput(int replica, std::string &ret, PushTask *task) { + static void ClientHandlePushReplicaOutput(int replica, std::string &ret, PushTask *task) { std::vector xfer(1); xfer[0].data_ = ret.data(); xfer[0].data_size_ = ret.size(); @@ -64,13 +64,13 @@ class Server : public TaskLib { } /** Handle finalization of PUSH replicate */ - static void HandlePushReplicaEnd(PushTask *task) { + static void ClientHandlePushReplicaEnd(PushTask *task) { task->exec_->ReplicateEnd(task->orig_task_->method_, task->orig_task_); - task->orig_task_->SetModuleComplete(); HILOG(kDebug, "Completing task (task_node={}, task_state={}, method={})", task->orig_task_->task_node_, task->orig_task_->task_state_, task->orig_task_->method_); + task->orig_task_->SetModuleComplete(); task->SetModuleComplete(); } @@ -98,7 +98,7 @@ class Server : public TaskLib { task->orig_task_->method_, LABSTOR_CLIENT->node_id_, domain_id.id_); - HandlePushReplicaOutput(replica, ret, task); + ClientHandlePushReplicaOutput(replica, ret, task); } } @@ -139,7 +139,7 @@ class Server : public TaskLib { LABSTOR_CLIENT->node_id_, domain_id.id_, static_cast(io_type)); - HandlePushReplicaOutput(replica, ret, task); + ClientHandlePushReplicaOutput(replica, ret, task); } } @@ -159,7 +159,7 @@ class Server : public TaskLib { HELOG(kFatal, "The task {}/{} does not support remote calls", task->task_state_, task->method_); } } - HandlePushReplicaEnd(task); + ClientHandlePushReplicaEnd(task); } private: From 2d96735f52682ee41607b426f79456a8c9d6dece Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 13:01:47 -0500 Subject: [PATCH 40/49] Comment out all HSHM_DESTROY_AR --- .../hermes_blob_mdm/hermes_blob_mdm_tasks.h | 26 +++++++++---------- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 4 +-- .../hermes_bucket_mdm_tasks.h | 10 +++---- .../src/hermes_bucket_mdm.cc | 4 +-- .../include/hermes_mdm/hermes_mdm_tasks.h | 2 +- .../labstor_admin/labstor_admin_tasks.h | 12 ++++----- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h index 82f9f2a08..be5e50f36 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h @@ -171,7 +171,7 @@ struct GetOrCreateBlobIdTask : public Task, TaskFlags { /** Destructor */ ~GetOrCreateBlobIdTask() { - HSHM_DESTROY_AR(blob_name_) + // HSHM_DESTROY_AR(blob_name_) } /** (De)serialize message call */ @@ -276,11 +276,11 @@ struct PutBlobTask : public Task, TaskFlags /** Destructor */ ~PutBlobTask() { -// HSHM_DESTROY_AR(blob_name_); -// HSHM_DESTROY_AR(filename_); -// if (IsDataOwner()) { -// LABSTOR_CLIENT->FreeBuffer(data_); -// } + // HSHM_DESTROY_AR(blob_name_); + // HSHM_DESTROY_AR(filename_); + if (IsDataOwner()) { + LABSTOR_CLIENT->FreeBuffer(data_); + } } /** (De)serialize message call */ @@ -390,8 +390,8 @@ struct GetBlobTask : public Task, TaskFlags /** Destructor */ ~GetBlobTask() { - HSHM_DESTROY_AR(blob_name_); - HSHM_DESTROY_AR(filename_); + // HSHM_DESTROY_AR(blob_name_); + // HSHM_DESTROY_AR(filename_); } /** (De)serialize message call */ @@ -586,7 +586,7 @@ struct GetBlobIdTask : public Task, TaskFlags { /** Destructor */ ~GetBlobIdTask() { - HSHM_DESTROY_AR(blob_name_) + // HSHM_DESTROY_AR(blob_name_) } /** (De)serialize message call */ @@ -649,7 +649,7 @@ struct GetBlobNameTask : public Task, TaskFlags { /** Destructor */ ~GetBlobNameTask() { - HSHM_DESTROY_AR(blob_name_) + // HSHM_DESTROY_AR(blob_name_) }; /** (De)serialize message call */ @@ -717,7 +717,7 @@ struct GetBlobSizeTask : public Task, TaskFlags { /** Destructor */ ~GetBlobSizeTask() { - HSHM_DESTROY_AR(blob_name_) + // HSHM_DESTROY_AR(blob_name_) } /** (De)serialize message call */ @@ -833,7 +833,7 @@ struct GetBlobBuffersTask : public Task, TaskFlags { /** Destructor */ ~GetBlobBuffersTask() { - HSHM_DESTROY_AR(buffers_) + // HSHM_DESTROY_AR(buffers_) } /** (De)serialize message call */ @@ -898,7 +898,7 @@ struct RenameBlobTask : public Task, TaskFlags { /** Destructor */ ~RenameBlobTask() { - HSHM_DESTROY_AR(new_blob_name_) + // HSHM_DESTROY_AR(new_blob_name_) } /** (De)serialize message call */ diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index b532ed9d5..f0275a061 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -356,7 +356,7 @@ class Server : public TaskLib { for (bdev::ReadTask *&read_task : read_tasks) { LABSTOR_CLIENT->DelTask(read_task); } - HSHM_DESTROY_AR(task->bdev_reads_); + // HSHM_DESTROY_AR(task->bdev_reads_); HILOG(kDebug, "GetBlobTask complete"); task->SetModuleComplete(); } @@ -583,7 +583,7 @@ class Server : public TaskLib { task->tag_id_, -(ssize_t)blob_info.blob_size_, bucket_mdm::UpdateSizeMode::kAdd); - HSHM_DESTROY_AR(task->free_tasks_); + // HSHM_DESTROY_AR(task->free_tasks_); blob_map.erase(task->blob_id_); task->SetModuleComplete(); } diff --git a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h index bfb9c7060..f19aa2edb 100644 --- a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h +++ b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h @@ -375,8 +375,8 @@ struct GetOrCreateTagTask : public Task, TaskFlags { /** Destructor */ ~GetOrCreateTagTask() { - HSHM_DESTROY_AR(tag_name_) - HSHM_DESTROY_AR(traits_) + // HSHM_DESTROY_AR(tag_name_) + // HSHM_DESTROY_AR(traits_) } /** (De)serialize message call */ @@ -432,7 +432,7 @@ struct GetTagIdTask : public Task, TaskFlags { /** Destructor */ ~GetTagIdTask() { - HSHM_DESTROY_AR(tag_name_) + // HSHM_DESTROY_AR(tag_name_) } /** (De)serialize message call */ @@ -488,7 +488,7 @@ struct GetTagNameTask : public Task, TaskFlags { /** Destructor */ ~GetTagNameTask() { - HSHM_DESTROY_AR(tag_name_) + // HSHM_DESTROY_AR(tag_name_) } /** (De)serialize message call */ @@ -547,7 +547,7 @@ struct RenameTagTask : public Task, TaskFlags { /** Destructor */ ~RenameTagTask() { - HSHM_DESTROY_AR(tag_name_) + // HSHM_DESTROY_AR(tag_name_) } /** (De)serialize message call */ diff --git a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc index 5d1a96fc0..eca36dc36 100644 --- a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc +++ b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc @@ -180,7 +180,7 @@ class Server : public TaskLib { for (AppendInfo &append : append_info) { LABSTOR_CLIENT->DelTask(append.put_task_); } - HSHM_DESTROY_AR(task->schema_->append_info_); + // HSHM_DESTROY_AR(task->schema_->append_info_); LABSTOR_CLIENT->DelTask(task->schema_); task->SetModuleComplete(); } @@ -296,7 +296,7 @@ class Server : public TaskLib { for (blob_mdm::DestroyBlobTask *&blob_task : blob_tasks) { LABSTOR_CLIENT->DelTask(blob_task); } - HSHM_DESTROY_AR(task->destroy_blob_tasks_); + // HSHM_DESTROY_AR(task->destroy_blob_tasks_); TAG_MAP_T &tag_map = tag_map_[ctx.lane_id_]; tag_map.erase(task->tag_id_); task->SetModuleComplete(); diff --git a/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_tasks.h b/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_tasks.h index 3a78e6de6..6d161e3be 100644 --- a/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_tasks.h +++ b/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_tasks.h @@ -47,7 +47,7 @@ struct ConstructTask : public CreateTaskStateTask { /** Destructor */ HSHM_ALWAYS_INLINE ~ConstructTask() { - HSHM_DESTROY_AR(server_config_path_); + // HSHM_DESTROY_AR(server_config_path_); } /** (De)serialize message call */ diff --git a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_tasks.h b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_tasks.h index dd28394e9..90a428e74 100644 --- a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_tasks.h +++ b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_tasks.h @@ -50,7 +50,7 @@ struct RegisterTaskLibTaskTempl : public Task, TaskFlags { /** Destructor */ ~RegisterTaskLibTaskTempl() { - HSHM_DESTROY_AR(lib_name_); + // HSHM_DESTROY_AR(lib_name_); } /** (De)serialize message call */ @@ -118,7 +118,7 @@ struct GetOrCreateTaskStateIdTask : public Task, TaskFlags { } ~GetOrCreateTaskStateIdTask() { - HSHM_DESTROY_AR(state_name_); + // HSHM_DESTROY_AR(state_name_); } /** (De)serialize message call */ @@ -179,9 +179,9 @@ struct CreateTaskStateTask : public Task, TaskFlags { /** Destructor */ ~CreateTaskStateTask() { - HSHM_DESTROY_AR(state_name_); - HSHM_DESTROY_AR(lib_name_); - HSHM_DESTROY_AR(queue_info_); + // HSHM_DESTROY_AR(state_name_); + // HSHM_DESTROY_AR(lib_name_); + // HSHM_DESTROY_AR(queue_info_); } /** Replication (does nothing) */ @@ -245,7 +245,7 @@ struct GetTaskStateIdTask : public Task, TaskFlags { } ~GetTaskStateIdTask() { - HSHM_DESTROY_AR(state_name_); + // HSHM_DESTROY_AR(state_name_); } /** (De)serialize message call */ From 0c7bb45fe329147495d2045faa2f30a0e42b46ac Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 13:16:42 -0500 Subject: [PATCH 41/49] Re-enable remote queue --- tasks_required/remote_queue/src/remote_queue.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index 6c0a26a8c..2186a7a67 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -278,7 +278,7 @@ class Server : public TaskLib { orig_task->task_state_, state_id, method); - // LABSTOR_CLIENT->DelTask(exec, orig_task); + LABSTOR_CLIENT->DelTask(exec, orig_task); req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); } From cb4a685a6be768a6023ab4857217a399df0e688e Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 13:24:41 -0500 Subject: [PATCH 42/49] Null check in empty task --- include/labstor/api/labstor_client.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/labstor/api/labstor_client.h b/include/labstor/api/labstor_client.h index 03be87336..e66b79179 100644 --- a/include/labstor/api/labstor_client.h +++ b/include/labstor/api/labstor_client.h @@ -92,14 +92,22 @@ class Client : public ConfigurationManager { template HSHM_ALWAYS_INLINE TaskT* NewEmptyTask(hipc::Pointer &p) { - return main_alloc_->NewObj(p, main_alloc_); + TaskT *task = main_alloc_->NewObj(p, main_alloc_); + if (task == nullptr) { + throw std::runtime_error("Could not allocate buffer"); + } + return task; } /** Allocate task */ template HSHM_ALWAYS_INLINE hipc::LPointer AllocateTask() { - return main_alloc_->AllocateLocalPtr(sizeof(TaskT)); + hipc::LPointer task = main_alloc_->AllocateLocalPtr(sizeof(TaskT)); + if (task.ptr_ == nullptr) { + throw std::runtime_error("Could not allocate buffer"); + } + return task; } /** Construct task */ From 87f7b3b246dca6c0ce4e3fa8de0d8a6b37481ba1 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 13:31:15 -0500 Subject: [PATCH 43/49] Req respond --- tasks_required/remote_queue/src/remote_queue.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index 2186a7a67..2c6992641 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -279,7 +279,11 @@ class Server : public TaskLib { state_id, method); LABSTOR_CLIENT->DelTask(exec, orig_task); - req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); + if (out_xfer.size() > 0) { + req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); + } else { + req.respond(std::string()); + } } public: From e3b9f664f8f9ba0aa2721c9f0c6d461cd9aaa194 Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Thu, 28 Sep 2023 13:32:54 -0500 Subject: [PATCH 44/49] Change to debug --- tasks_required/remote_queue/src/remote_queue.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index 2c6992641..28960fafa 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -253,7 +253,7 @@ class Server : public TaskLib { orig_task->UnsetDataOwner(); orig_task->UnsetLongRunning(); queue->Emplace(orig_task->prio_, orig_task->lane_hash_, p); - HILOG(kDebug, + HILOG(kInfo, "(node {}) Executing task (task_node={}, task_state={}/{}, state_name={}, method={}, size={}, lane_hash={})", LABSTOR_CLIENT->node_id_, orig_task->task_node_, @@ -271,7 +271,7 @@ class Server : public TaskLib { TaskState *exec, TaskStateId state_id) { BinaryOutputArchive ar(DomainId::GetNode(LABSTOR_CLIENT->node_id_)); std::vector out_xfer = exec->SaveEnd(method, ar, orig_task); - HILOG(kDebug, "(node {}) Returning {} bytes of data (task_node={}, task_state={}/{}, method={})", + HILOG(kInfo, "(node {}) Returning {} bytes of data (task_node={}, task_state={}/{}, method={})", LABSTOR_CLIENT->node_id_, out_xfer[0].data_size_, orig_task->task_node_, From 22ab17c1f596714712a68e24a435c8deb59deb0b Mon Sep 17 00:00:00 2001 From: Luke Logan Date: Fri, 29 Sep 2023 00:55:52 -0500 Subject: [PATCH 45/49] Begin remote task debug --- include/labstor/task_registry/task.h | 2 ++ src/worker.cc | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/labstor/task_registry/task.h b/include/labstor/task_registry/task.h index ed532b88c..eb390a7f2 100644 --- a/include/labstor/task_registry/task.h +++ b/include/labstor/task_registry/task.h @@ -49,6 +49,8 @@ class TaskLib; #define TASK_COROUTINE BIT_OPT(u32, 16) /** This task uses argobot wait */ #define TASK_PREEMPTIVE BIT_OPT(u32, 17) +/** This task is apart of remote debugging */ +#define TASK_REMOTE_DEBUG_MARK BIT_OPT(u32, 18) /** Used to define task methods */ #define TASK_METHOD_T static inline const u32 diff --git a/src/worker.cc b/src/worker.cc index 83eba8c7a..c1dcfe19f 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -70,6 +70,12 @@ void Worker::PollGrouped(WorkEntry &work_entry) { // Attempt to run the task if it's ready and runnable bool is_remote = task->domain_id_.IsRemote(LABSTOR_RPC->GetNumHosts(), LABSTOR_CLIENT->node_id_); if (!task->IsRunDisabled() && CheckTaskGroup(task, exec, work_entry.lane_id_, task->task_node_, is_remote)) { + // TODO(llogan): Make a remote debug macro + if (task->task_state_ != LABSTOR_QM_CLIENT->admin_task_state_ && + !task->task_flags_.Any(TASK_REMOTE_DEBUG_MARK)) { + is_remote = true; + task->task_flags_.SetBits(TASK_REMOTE_DEBUG_MARK); + } // Execute or schedule task if (is_remote) { auto ids = LABSTOR_RUNTIME->ResolveDomainId(task->domain_id_); From 9c71182febef5b87d9beb4c2b235140e9f3bfdec Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Fri, 29 Sep 2023 14:27:40 -0500 Subject: [PATCH 46/49] Fix remote coroutine double-free problem --- include/labstor/api/labstor_runtime.h | 2 ++ include/labstor/labstor_types.h | 13 ++++++++++++ include/labstor/task_registry/task.h | 6 ++++++ include/labstor/work_orchestrator/scheduler.h | 2 +- src/worker.cc | 11 +++++++--- tasks/bdev/include/bdev/bdev_tasks.h | 12 +++++------ .../hermes_blob_mdm/hermes_blob_mdm_tasks.h | 20 +++++++++---------- tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc | 4 ++-- .../hermes_bucket_mdm_tasks.h | 12 +++++------ .../src/hermes_bucket_mdm.cc | 4 ++-- .../include/hermes_mdm/hermes_mdm_tasks.h | 2 +- .../labstor_admin/labstor_admin_tasks.h | 12 +++++------ .../include/proc_queue/proc_queue_tasks.h | 2 +- .../include/remote_queue/remote_queue_tasks.h | 2 +- .../remote_queue/src/remote_queue.cc | 4 ++-- 15 files changed, 67 insertions(+), 41 deletions(-) diff --git a/include/labstor/api/labstor_runtime.h b/include/labstor/api/labstor_runtime.h index 76f4525e6..4feb03bab 100644 --- a/include/labstor/api/labstor_runtime.h +++ b/include/labstor/api/labstor_runtime.h @@ -33,6 +33,7 @@ class Runtime : public ConfigurationManager { remote_queue::Client remote_queue_; RpcContext rpc_; ThalliumRpc thallium_; + bool remote_created_ = false; public: /** Default constructor */ @@ -121,6 +122,7 @@ class Runtime : public ConfigurationManager { task_registry_.RegisterTaskLib("remote_queue"); remote_queue_.CreateRoot(DomainId::GetLocal(), "remote_queue", LABSTOR_CLIENT->MakeTaskStateId()); + remote_created_ = true; } public: diff --git a/include/labstor/labstor_types.h b/include/labstor/labstor_types.h index 9d01597b3..26f9dae54 100644 --- a/include/labstor/labstor_types.h +++ b/include/labstor/labstor_types.h @@ -340,6 +340,19 @@ struct UniqueId { } }; +/** A sized data pointer */ +template +struct DataPointer { + hipc::Pointer ptr_; + size_t size_; + + /** Serialization */ + template + void serialize(Ar &ar) { + ar(ptr_, size_); + } +}; + /** Uniquely identify a task state */ using TaskStateId = UniqueId<1>; /** Uniquely identify a queue */ diff --git a/include/labstor/task_registry/task.h b/include/labstor/task_registry/task.h index eb390a7f2..23a683a1b 100644 --- a/include/labstor/task_registry/task.h +++ b/include/labstor/task_registry/task.h @@ -215,6 +215,7 @@ constexpr inline void CALL_REPLICA_END(T *task) { template struct TaskFlags : public IsTask { public: + TASK_FLAG_T IS_LOCAL = FLAGS & TF_LOCAL; TASK_FLAG_T SUPPORTS_SRL = FLAGS & (TF_SRL_SYM | TF_SRL_ASYM); TASK_FLAG_T SRL_SYM_START = FLAGS & TF_SRL_SYM_START; TASK_FLAG_T SRL_SYM_END = FLAGS & TF_SRL_SYM_END; @@ -375,6 +376,11 @@ struct Task : public hipc::ShmContainer { return task_flags_.Any(TASK_COROUTINE); } + /** Set this task as blocking */ + HSHM_ALWAYS_INLINE void UnsetCoroutine() { + task_flags_.UnsetBits(TASK_COROUTINE); + } + /** Set this task as blocking */ HSHM_ALWAYS_INLINE bool IsPreemptive() { return task_flags_.Any(TASK_PREEMPTIVE); diff --git a/include/labstor/work_orchestrator/scheduler.h b/include/labstor/work_orchestrator/scheduler.h index bcd6d9889..e8a7ad8e4 100644 --- a/include/labstor/work_orchestrator/scheduler.h +++ b/include/labstor/work_orchestrator/scheduler.h @@ -34,7 +34,7 @@ struct ScheduleTask : public Task, TaskFlags { prio_ = TaskPrio::kLongRunning; task_state_ = state_id; method_ = SchedulerMethod::kSchedule; - task_flags_.SetBits(TASK_LONG_RUNNING); + task_flags_.SetBits(TASK_LONG_RUNNING | TASK_REMOTE_DEBUG_MARK); domain_id_ = domain_id; // Custom params diff --git a/src/worker.cc b/src/worker.cc index c1dcfe19f..ecbd6eea2 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -72,16 +72,19 @@ void Worker::PollGrouped(WorkEntry &work_entry) { if (!task->IsRunDisabled() && CheckTaskGroup(task, exec, work_entry.lane_id_, task->task_node_, is_remote)) { // TODO(llogan): Make a remote debug macro if (task->task_state_ != LABSTOR_QM_CLIENT->admin_task_state_ && - !task->task_flags_.Any(TASK_REMOTE_DEBUG_MARK)) { + !task->task_flags_.Any(TASK_REMOTE_DEBUG_MARK) && + task->method_ != TaskMethod::kConstruct && + LABSTOR_RUNTIME->remote_created_) { is_remote = true; - task->task_flags_.SetBits(TASK_REMOTE_DEBUG_MARK); } + task->task_flags_.SetBits(TASK_REMOTE_DEBUG_MARK); // Execute or schedule task if (is_remote) { auto ids = LABSTOR_RUNTIME->ResolveDomainId(task->domain_id_); LABSTOR_REMOTE_QUEUE->Disperse(task, exec, ids); task->DisableRun(); task->SetUnordered(); + task->UnsetCoroutine(); } else if (task->IsCoroutine()) { if (!task->IsStarted()) { ctx.stack_ptr_ = malloc(ctx.stack_size_); @@ -89,6 +92,7 @@ void Worker::PollGrouped(WorkEntry &work_entry) { HILOG(kFatal, "The stack pointer of size {} is NULL", ctx.stack_size_, ctx.stack_ptr_); } + HILOG(kInfo, "Allocated {}", (size_t)ctx.stack_ptr_) ctx.jmp_.fctx = bctx::make_fcontext( (char*)ctx.stack_ptr_ + ctx.stack_size_, ctx.stack_size_, &RunBlocking); @@ -111,7 +115,8 @@ void Worker::PollGrouped(WorkEntry &work_entry) { entry->complete_ = true; if (task->IsCoroutine()) { // TODO(llogan): verify leak - free(ctx.stack_ptr_); + HILOG(kInfo, "Freeing {}", (size_t)ctx.stack_ptr_) + // free(ctx.stack_ptr_); } else if (task->IsPreemptive()) { ABT_thread_join(entry->thread_); } diff --git a/tasks/bdev/include/bdev/bdev_tasks.h b/tasks/bdev/include/bdev/bdev_tasks.h index c7f7be735..fc9965732 100644 --- a/tasks/bdev/include/bdev/bdev_tasks.h +++ b/tasks/bdev/include/bdev/bdev_tasks.h @@ -94,7 +94,7 @@ struct AllocateTask : public Task, TaskFlags { prio_ = TaskPrio::kLowLatency; task_state_ = state_id; method_ = Method::kAllocate; - task_flags_.SetBits(TASK_UNORDERED); + task_flags_.SetBits(TASK_UNORDERED | TASK_REMOTE_DEBUG_MARK); domain_id_ = domain_id; // Free params @@ -135,7 +135,7 @@ struct FreeTask : public Task, TaskFlags { method_ = Method::kFree; task_flags_.SetBits(0); if (fire_and_forget) { - task_flags_.SetBits(TASK_FIRE_AND_FORGET | TASK_UNORDERED); + task_flags_.SetBits(TASK_FIRE_AND_FORGET | TASK_UNORDERED | TASK_REMOTE_DEBUG_MARK); } domain_id_ = domain_id; @@ -177,7 +177,7 @@ struct WriteTask : public Task, TaskFlags { prio_ = TaskPrio::kLowLatency; task_state_ = state_id; method_ = Method::kWrite; - task_flags_.SetBits(TASK_UNORDERED); + task_flags_.SetBits(TASK_UNORDERED | TASK_REMOTE_DEBUG_MARK); domain_id_ = domain_id; // Free params @@ -220,7 +220,7 @@ struct ReadTask : public Task, TaskFlags { prio_ = TaskPrio::kLowLatency; task_state_ = state_id; method_ = Method::kRead; - task_flags_.SetBits(TASK_UNORDERED); + task_flags_.SetBits(TASK_UNORDERED | TASK_REMOTE_DEBUG_MARK); domain_id_ = domain_id; // Free params @@ -259,7 +259,7 @@ struct MonitorTask : public Task, TaskFlags { prio_ = TaskPrio::kLongRunning; task_state_ = state_id; method_ = Method::kMonitor; - task_flags_.SetBits(TASK_LONG_RUNNING); + task_flags_.SetBits(TASK_LONG_RUNNING | TASK_REMOTE_DEBUG_MARK); domain_id_ = domain_id; // Custom @@ -294,7 +294,7 @@ struct UpdateCapacityTask : public Task, TaskFlags { prio_ = TaskPrio::kLowLatency; task_state_ = state_id; method_ = Method::kUpdateCapacity; - task_flags_.SetBits(TASK_FIRE_AND_FORGET | TASK_UNORDERED); + task_flags_.SetBits(TASK_FIRE_AND_FORGET | TASK_UNORDERED | TASK_REMOTE_DEBUG_MARK); domain_id_ = domain_id; // Custom diff --git a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h index be5e50f36..35740abb9 100644 --- a/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h +++ b/tasks/hermes_blob_mdm/include/hermes_blob_mdm/hermes_blob_mdm_tasks.h @@ -171,7 +171,7 @@ struct GetOrCreateBlobIdTask : public Task, TaskFlags { /** Destructor */ ~GetOrCreateBlobIdTask() { - // HSHM_DESTROY_AR(blob_name_) + HSHM_DESTROY_AR(blob_name_) } /** (De)serialize message call */ @@ -276,8 +276,8 @@ struct PutBlobTask : public Task, TaskFlags /** Destructor */ ~PutBlobTask() { - // HSHM_DESTROY_AR(blob_name_); - // HSHM_DESTROY_AR(filename_); + HSHM_DESTROY_AR(blob_name_); + HSHM_DESTROY_AR(filename_); if (IsDataOwner()) { LABSTOR_CLIENT->FreeBuffer(data_); } @@ -390,8 +390,8 @@ struct GetBlobTask : public Task, TaskFlags /** Destructor */ ~GetBlobTask() { - // HSHM_DESTROY_AR(blob_name_); - // HSHM_DESTROY_AR(filename_); + HSHM_DESTROY_AR(blob_name_); + HSHM_DESTROY_AR(filename_); } /** (De)serialize message call */ @@ -586,7 +586,7 @@ struct GetBlobIdTask : public Task, TaskFlags { /** Destructor */ ~GetBlobIdTask() { - // HSHM_DESTROY_AR(blob_name_) + HSHM_DESTROY_AR(blob_name_) } /** (De)serialize message call */ @@ -649,7 +649,7 @@ struct GetBlobNameTask : public Task, TaskFlags { /** Destructor */ ~GetBlobNameTask() { - // HSHM_DESTROY_AR(blob_name_) + HSHM_DESTROY_AR(blob_name_) }; /** (De)serialize message call */ @@ -717,7 +717,7 @@ struct GetBlobSizeTask : public Task, TaskFlags { /** Destructor */ ~GetBlobSizeTask() { - // HSHM_DESTROY_AR(blob_name_) + HSHM_DESTROY_AR(blob_name_) } /** (De)serialize message call */ @@ -833,7 +833,7 @@ struct GetBlobBuffersTask : public Task, TaskFlags { /** Destructor */ ~GetBlobBuffersTask() { - // HSHM_DESTROY_AR(buffers_) + HSHM_DESTROY_AR(buffers_) } /** (De)serialize message call */ @@ -898,7 +898,7 @@ struct RenameBlobTask : public Task, TaskFlags { /** Destructor */ ~RenameBlobTask() { - // HSHM_DESTROY_AR(new_blob_name_) + HSHM_DESTROY_AR(new_blob_name_) } /** (De)serialize message call */ diff --git a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc index f0275a061..b532ed9d5 100644 --- a/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc +++ b/tasks/hermes_blob_mdm/src/hermes_blob_mdm.cc @@ -356,7 +356,7 @@ class Server : public TaskLib { for (bdev::ReadTask *&read_task : read_tasks) { LABSTOR_CLIENT->DelTask(read_task); } - // HSHM_DESTROY_AR(task->bdev_reads_); + HSHM_DESTROY_AR(task->bdev_reads_); HILOG(kDebug, "GetBlobTask complete"); task->SetModuleComplete(); } @@ -583,7 +583,7 @@ class Server : public TaskLib { task->tag_id_, -(ssize_t)blob_info.blob_size_, bucket_mdm::UpdateSizeMode::kAdd); - // HSHM_DESTROY_AR(task->free_tasks_); + HSHM_DESTROY_AR(task->free_tasks_); blob_map.erase(task->blob_id_); task->SetModuleComplete(); } diff --git a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h index f19aa2edb..5c8460287 100644 --- a/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h +++ b/tasks/hermes_bucket_mdm/include/hermes_bucket_mdm/hermes_bucket_mdm_tasks.h @@ -303,7 +303,7 @@ struct AppendBlobTask : public Task, TaskFlags { prio_ = TaskPrio::kLowLatency; task_state_ = state_id; method_ = Method::kAppendBlob; - task_flags_.SetBits(TASK_LOW_LATENCY | TASK_FIRE_AND_FORGET | TASK_DATA_OWNER | TASK_UNORDERED); + task_flags_.SetBits(TASK_LOW_LATENCY | TASK_FIRE_AND_FORGET | TASK_DATA_OWNER | TASK_UNORDERED | TASK_REMOTE_DEBUG_MARK); domain_id_ = domain_id; // Custom params @@ -375,8 +375,8 @@ struct GetOrCreateTagTask : public Task, TaskFlags { /** Destructor */ ~GetOrCreateTagTask() { - // HSHM_DESTROY_AR(tag_name_) - // HSHM_DESTROY_AR(traits_) + HSHM_DESTROY_AR(tag_name_) + HSHM_DESTROY_AR(traits_) } /** (De)serialize message call */ @@ -432,7 +432,7 @@ struct GetTagIdTask : public Task, TaskFlags { /** Destructor */ ~GetTagIdTask() { - // HSHM_DESTROY_AR(tag_name_) + HSHM_DESTROY_AR(tag_name_) } /** (De)serialize message call */ @@ -488,7 +488,7 @@ struct GetTagNameTask : public Task, TaskFlags { /** Destructor */ ~GetTagNameTask() { - // HSHM_DESTROY_AR(tag_name_) + HSHM_DESTROY_AR(tag_name_) } /** (De)serialize message call */ @@ -547,7 +547,7 @@ struct RenameTagTask : public Task, TaskFlags { /** Destructor */ ~RenameTagTask() { - // HSHM_DESTROY_AR(tag_name_) + HSHM_DESTROY_AR(tag_name_) } /** (De)serialize message call */ diff --git a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc index eca36dc36..5d1a96fc0 100644 --- a/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc +++ b/tasks/hermes_bucket_mdm/src/hermes_bucket_mdm.cc @@ -180,7 +180,7 @@ class Server : public TaskLib { for (AppendInfo &append : append_info) { LABSTOR_CLIENT->DelTask(append.put_task_); } - // HSHM_DESTROY_AR(task->schema_->append_info_); + HSHM_DESTROY_AR(task->schema_->append_info_); LABSTOR_CLIENT->DelTask(task->schema_); task->SetModuleComplete(); } @@ -296,7 +296,7 @@ class Server : public TaskLib { for (blob_mdm::DestroyBlobTask *&blob_task : blob_tasks) { LABSTOR_CLIENT->DelTask(blob_task); } - // HSHM_DESTROY_AR(task->destroy_blob_tasks_); + HSHM_DESTROY_AR(task->destroy_blob_tasks_); TAG_MAP_T &tag_map = tag_map_[ctx.lane_id_]; tag_map.erase(task->tag_id_); task->SetModuleComplete(); diff --git a/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_tasks.h b/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_tasks.h index 6d161e3be..3a78e6de6 100644 --- a/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_tasks.h +++ b/tasks/hermes_mdm/include/hermes_mdm/hermes_mdm_tasks.h @@ -47,7 +47,7 @@ struct ConstructTask : public CreateTaskStateTask { /** Destructor */ HSHM_ALWAYS_INLINE ~ConstructTask() { - // HSHM_DESTROY_AR(server_config_path_); + HSHM_DESTROY_AR(server_config_path_); } /** (De)serialize message call */ diff --git a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_tasks.h b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_tasks.h index 90a428e74..dd28394e9 100644 --- a/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_tasks.h +++ b/tasks_required/labstor_admin/include/labstor_admin/labstor_admin_tasks.h @@ -50,7 +50,7 @@ struct RegisterTaskLibTaskTempl : public Task, TaskFlags { /** Destructor */ ~RegisterTaskLibTaskTempl() { - // HSHM_DESTROY_AR(lib_name_); + HSHM_DESTROY_AR(lib_name_); } /** (De)serialize message call */ @@ -118,7 +118,7 @@ struct GetOrCreateTaskStateIdTask : public Task, TaskFlags { } ~GetOrCreateTaskStateIdTask() { - // HSHM_DESTROY_AR(state_name_); + HSHM_DESTROY_AR(state_name_); } /** (De)serialize message call */ @@ -179,9 +179,9 @@ struct CreateTaskStateTask : public Task, TaskFlags { /** Destructor */ ~CreateTaskStateTask() { - // HSHM_DESTROY_AR(state_name_); - // HSHM_DESTROY_AR(lib_name_); - // HSHM_DESTROY_AR(queue_info_); + HSHM_DESTROY_AR(state_name_); + HSHM_DESTROY_AR(lib_name_); + HSHM_DESTROY_AR(queue_info_); } /** Replication (does nothing) */ @@ -245,7 +245,7 @@ struct GetTaskStateIdTask : public Task, TaskFlags { } ~GetTaskStateIdTask() { - // HSHM_DESTROY_AR(state_name_); + HSHM_DESTROY_AR(state_name_); } /** (De)serialize message call */ diff --git a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h index 9372d1307..08adb8457 100644 --- a/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h +++ b/tasks_required/proc_queue/include/proc_queue/proc_queue_tasks.h @@ -100,7 +100,7 @@ struct TypedPushTask : public Task, TaskFlags { prio_ = TaskPrio::kLowLatency; task_state_ = state_id; method_ = Method::kPush; - task_flags_.SetBits(TASK_DATA_OWNER | TASK_LOW_LATENCY); + task_flags_.SetBits(TASK_DATA_OWNER | TASK_LOW_LATENCY | TASK_REMOTE_DEBUG_MARK); domain_id_ = domain_id; // Custom params diff --git a/tasks_required/remote_queue/include/remote_queue/remote_queue_tasks.h b/tasks_required/remote_queue/include/remote_queue/remote_queue_tasks.h index c3e79057d..5c146dcdc 100644 --- a/tasks_required/remote_queue/include/remote_queue/remote_queue_tasks.h +++ b/tasks_required/remote_queue/include/remote_queue/remote_queue_tasks.h @@ -111,7 +111,7 @@ struct PushTask : public Task, TaskFlags { prio_ = TaskPrio::kLowLatency; task_state_ = state_id; method_ = Method::kPush; - task_flags_.SetBits(TASK_LOW_LATENCY | TASK_PREEMPTIVE); + task_flags_.SetBits(TASK_LOW_LATENCY | TASK_PREEMPTIVE | TASK_REMOTE_DEBUG_MARK); domain_id_ = domain_id; // Custom params diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index 28960fafa..b018b4956 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -278,8 +278,8 @@ class Server : public TaskLib { orig_task->task_state_, state_id, method); - LABSTOR_CLIENT->DelTask(exec, orig_task); - if (out_xfer.size() > 0) { + // LABSTOR_CLIENT->DelTask(exec, orig_task); + if (out_xfer.size() > 0 && out_xfer[0].data_size_ > 0) { req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); } else { req.respond(std::string()); From 7b13e29e9ee658c0fed396fc63b8e5c719938ee3 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Fri, 29 Sep 2023 14:38:14 -0500 Subject: [PATCH 47/49] Don't do remote debug by default --- src/worker.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/worker.cc b/src/worker.cc index ecbd6eea2..b164d7d54 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -71,6 +71,7 @@ void Worker::PollGrouped(WorkEntry &work_entry) { bool is_remote = task->domain_id_.IsRemote(LABSTOR_RPC->GetNumHosts(), LABSTOR_CLIENT->node_id_); if (!task->IsRunDisabled() && CheckTaskGroup(task, exec, work_entry.lane_id_, task->task_node_, is_remote)) { // TODO(llogan): Make a remote debug macro +#ifdef REMOTE_DEBUG if (task->task_state_ != LABSTOR_QM_CLIENT->admin_task_state_ && !task->task_flags_.Any(TASK_REMOTE_DEBUG_MARK) && task->method_ != TaskMethod::kConstruct && @@ -78,6 +79,7 @@ void Worker::PollGrouped(WorkEntry &work_entry) { is_remote = true; } task->task_flags_.SetBits(TASK_REMOTE_DEBUG_MARK); +#endif // Execute or schedule task if (is_remote) { auto ids = LABSTOR_RUNTIME->ResolveDomainId(task->domain_id_); @@ -92,7 +94,6 @@ void Worker::PollGrouped(WorkEntry &work_entry) { HILOG(kFatal, "The stack pointer of size {} is NULL", ctx.stack_size_, ctx.stack_ptr_); } - HILOG(kInfo, "Allocated {}", (size_t)ctx.stack_ptr_) ctx.jmp_.fctx = bctx::make_fcontext( (char*)ctx.stack_ptr_ + ctx.stack_size_, ctx.stack_size_, &RunBlocking); @@ -115,8 +116,7 @@ void Worker::PollGrouped(WorkEntry &work_entry) { entry->complete_ = true; if (task->IsCoroutine()) { // TODO(llogan): verify leak - HILOG(kInfo, "Freeing {}", (size_t)ctx.stack_ptr_) - // free(ctx.stack_ptr_); + free(ctx.stack_ptr_); } else if (task->IsPreemptive()) { ABT_thread_join(entry->thread_); } From d51d6f5128370297270bc21384261aeabaccc971 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Fri, 29 Sep 2023 14:39:54 -0500 Subject: [PATCH 48/49] Use debug for prints in RPC --- tasks_required/remote_queue/src/remote_queue.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index b018b4956..3afeee499 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -253,7 +253,7 @@ class Server : public TaskLib { orig_task->UnsetDataOwner(); orig_task->UnsetLongRunning(); queue->Emplace(orig_task->prio_, orig_task->lane_hash_, p); - HILOG(kInfo, + HILOG(kDebug, "(node {}) Executing task (task_node={}, task_state={}/{}, state_name={}, method={}, size={}, lane_hash={})", LABSTOR_CLIENT->node_id_, orig_task->task_node_, @@ -271,7 +271,7 @@ class Server : public TaskLib { TaskState *exec, TaskStateId state_id) { BinaryOutputArchive ar(DomainId::GetNode(LABSTOR_CLIENT->node_id_)); std::vector out_xfer = exec->SaveEnd(method, ar, orig_task); - HILOG(kInfo, "(node {}) Returning {} bytes of data (task_node={}, task_state={}/{}, method={})", + HILOG(kDebug, "(node {}) Returning {} bytes of data (task_node={}, task_state={}/{}, method={})", LABSTOR_CLIENT->node_id_, out_xfer[0].data_size_, orig_task->task_node_, From 3c1645759699985a09a5153ebe3f667fdc1daca5 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Fri, 29 Sep 2023 14:45:24 -0500 Subject: [PATCH 49/49] Re-enable remote deltask --- tasks_required/remote_queue/src/remote_queue.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks_required/remote_queue/src/remote_queue.cc b/tasks_required/remote_queue/src/remote_queue.cc index 3afeee499..acd6b5c73 100644 --- a/tasks_required/remote_queue/src/remote_queue.cc +++ b/tasks_required/remote_queue/src/remote_queue.cc @@ -278,7 +278,7 @@ class Server : public TaskLib { orig_task->task_state_, state_id, method); - // LABSTOR_CLIENT->DelTask(exec, orig_task); + LABSTOR_CLIENT->DelTask(exec, orig_task); if (out_xfer.size() > 0 && out_xfer[0].data_size_ > 0) { req.respond(std::string((char *) out_xfer[0].data_, out_xfer[0].data_size_)); } else {