Skip to content

Commit

Permalink
Merge branch 'main' of github.com:simgrid/file-system-module
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 24, 2024
2 parents 1ef2d52 + c754244 commit a4bac0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 2 additions & 3 deletions include/fsmod/Storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ namespace simgrid::fsmod {
[[nodiscard]] virtual s4u::ActorPtr start_controller(s4u::Host* host, const std::function<void()> &func);

protected:
s4u::Host* controller_host_ = nullptr;
s4u::ActorPtr controller_ = nullptr;
explicit Storage(std::string name): name_(std::move(name)) {}
virtual ~Storage() = default;

Expand All @@ -55,7 +53,8 @@ namespace simgrid::fsmod {
private:
std::string name_;
std::vector<s4u::Disk*> disks_;

s4u::Host* controller_host_ = nullptr;
s4u::ActorPtr controller_ = nullptr;
};

} // namespace simgrid::fsmod
Expand Down
9 changes: 7 additions & 2 deletions src/JBODStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ namespace simgrid::fsmod {

// Create a Comm to transfer data to the host that requested a read to the controller host of the JBOD
// Do not assign the destination of the Comm yet, will be done after the completion of the IOs
auto source_host = (controller_host_ == nullptr ? this->get_first_disk()->get_host() : controller_host_);
auto source_host = get_controller_host();
if (source_host == nullptr)
source_host = this->get_first_disk()->get_host();

auto comm = s4u::Comm::sendto_init()->set_source(source_host)->set_payload_size(size);
comm->set_name("Transfer from JBod");

Expand Down Expand Up @@ -186,7 +189,9 @@ namespace simgrid::fsmod {
// Do not start computing the parity block before the completion of the comm to the controller
comm->add_successor(parity_block_comp);
// Start the comm by setting its destination
auto destination_host = (controller_host_ == nullptr ? this->get_first_disk()->get_host() : controller_host_);
auto destination_host = get_controller_host();
if (destination_host == nullptr)
destination_host = this->get_first_disk()->get_host();
comm->set_destination(destination_host);

// Parity Block Computation is now blocked by Comm, start it by assigning it to the controller host
Expand Down

0 comments on commit a4bac0d

Please sign in to comment.