From 169709457a928964e2fba370d2e3b70ea0ee4e7e Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Mon, 30 Sep 2024 23:53:45 -1000 Subject: [PATCH] tmp commit --- src/File.cpp | 5 ----- src/Partition.cpp | 4 +--- src/PartitionFIFOCaching.cpp | 6 ++++-- src/PartitionLRUCaching.cpp | 1 - 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/File.cpp b/src/File.cpp index 542a220..9a9e709 100644 --- a/src/File.cpp +++ b/src/File.cpp @@ -157,14 +157,10 @@ namespace simgrid::fsmod { */ sg_size_t File::write(sg_size_t num_bytes, bool simulate_it) { - std::cerr << "IN FILE WRITE!\n"; - if (num_bytes == 0) /* Nothing to write, return */ return 0; - std::cerr << "CALLING WRITE_INIT_CHECKS\n"; int my_sequence_number = write_init_checks(num_bytes); - std::cerr << "IN FILE WRITE\n"; // Do the I/O simulation if need be if (simulate_it) { try { @@ -173,7 +169,6 @@ namespace simgrid::fsmod { throw xbt::UnimplementedError("Handling of hardware resource failures not implemented"); } } - std::cerr << "IN FILE WRITE: CALLED PARTITION WRITE\n"; // Update metadata_->set_access_date(s4u::Engine::get_clock()); diff --git a/src/Partition.cpp b/src/Partition.cpp index 1927890..2d5ec7e 100644 --- a/src/Partition.cpp +++ b/src/Partition.cpp @@ -111,7 +111,6 @@ namespace simgrid::fsmod { if (dst_metadata && dst_metadata->get_file_refcount()) { throw FileIsOpenException(XBT_THROW_POINT, dst_dir_path + "/" + dst_file_name); } - // Create space if needed if (dst_metadata) { auto src_size = src_metadata->get_current_size(); @@ -124,15 +123,14 @@ namespace simgrid::fsmod { } // Do the move (reusing the original unique ptr, just in case) - auto uniq_ptr = std::move(content_.at(src_dir_path).at(src_file_name)); content_.at(src_dir_path).erase(src_file_name); this->new_file_deletion_event(src_metadata); uniq_ptr->file_name_ = dst_file_name; uniq_ptr->set_modification_date(s4u::Engine::get_clock()); - uniq_ptr->set_access_date(s4u::Engine::get_clock()); content_[dst_dir_path][dst_file_name] = std::move(uniq_ptr); this->new_file_creation_event(content_[dst_dir_path][dst_file_name].get()); + content_[dst_dir_path][dst_file_name]->set_access_date(s4u::Engine::get_clock()); } std::set> Partition::list_files_in_directory(const std::string &dir_path) const { diff --git a/src/PartitionFIFOCaching.cpp b/src/PartitionFIFOCaching.cpp index 750821d..221d86e 100644 --- a/src/PartitionFIFOCaching.cpp +++ b/src/PartitionFIFOCaching.cpp @@ -14,7 +14,7 @@ namespace simgrid::fsmod { sg_size_t space_that_can_be_created = 0.0; std::vector files_to_remove_to_create_space; - std::cerr << "IN CREATE SPACE!\n"; + std::cerr << "** IN CREATE SPACE!\n"; for (auto const& [victim, victim_metadata]: priority_list_) { std::cerr << "LOOKING AT VICTIM " << victim_metadata->file_name_ << "\n"; @@ -37,12 +37,14 @@ namespace simgrid::fsmod { throw NotEnoughSpaceException(XBT_THROW_POINT, "Unable to evict files to create enough space"); } for (auto const &victim: files_to_remove_to_create_space) { + std::cerr << "EVICTING VICTIM: " << this->priority_list_[victim]->file_name_ << "\n"; this->delete_file(this->priority_list_[victim]->dir_path_, this->priority_list_[victim]->file_name_); } + std::cerr << "** RETURNING FROM CREATE SPACE\n"; } void PartitionFIFOCaching::print_priority_list() { - std::cerr << "PLIST = "; + std::cerr << "PLIST " << this->get_name() << " = "; for (auto const &i : priority_list_) { std::cerr << " " << i.second->file_name_ << " "; } diff --git a/src/PartitionLRUCaching.cpp b/src/PartitionLRUCaching.cpp index 548520d..f9e7225 100644 --- a/src/PartitionLRUCaching.cpp +++ b/src/PartitionLRUCaching.cpp @@ -8,7 +8,6 @@ namespace simgrid::fsmod { void PartitionLRUCaching::new_file_access_event(FileMetadata *file_metadata) { - std::cerr << "NEW FILE ACCESS ENVENT FOR " << file_metadata->file_name_ << "!\n"; rm_from_priority_list(file_metadata); file_metadata->sequence_number_ = get_next_sequence_number(); add_to_priority_list(file_metadata);