Skip to content

Commit

Permalink
debug messages--
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 8, 2024
1 parent 988eb91 commit 4540a67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/Partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ namespace simgrid::fsmod {
void Partition::delete_file(const std::string &dir_path, const std::string &file_name) {
auto* metadata_ptr = this->get_file_metadata(dir_path, file_name);
if (not metadata_ptr) {
throw FileNotFoundException(XBT_THROW_POINT, dir_path + "/" + file_name);
throw FileNotFoundException(XBT_THROW_POINT, "delete: " + dir_path + "/" + file_name);
}

if (metadata_ptr->get_file_refcount() > 0) {
throw FileIsOpenException(XBT_THROW_POINT, dir_path + "/" + file_name);
throw FileIsOpenException(XBT_THROW_POINT, "delete: " + dir_path + "/" + file_name);
}

this->new_file_deletion_event(metadata_ptr);
Expand Down Expand Up @@ -106,10 +106,10 @@ namespace simgrid::fsmod {

// Sanity checks
if (src_metadata->get_file_refcount() > 0) {
throw FileIsOpenException(XBT_THROW_POINT, src_dir_path + "/" + src_file_name);
throw FileIsOpenException(XBT_THROW_POINT, "move: " + src_dir_path + "/" + src_file_name);
}
if (dst_metadata && dst_metadata->get_file_refcount()) {
throw FileIsOpenException(XBT_THROW_POINT, dst_dir_path + "/" + dst_file_name);
throw FileIsOpenException(XBT_THROW_POINT, "move: " + dst_dir_path + "/" + dst_file_name);
}

// Create space if needed
Expand Down Expand Up @@ -172,7 +172,7 @@ namespace simgrid::fsmod {
sg_size_t freed_space = 0;
for (const auto &[filename, metadata]: content_.at(dir_path)) {
if (metadata->get_file_refcount() != 0) {
throw FileIsOpenException(XBT_THROW_POINT, "No content deleted in directory before file " + filename + " is open");
throw FileIsOpenException(XBT_THROW_POINT, "No content deleted in directory because file " + filename + " is open");
}
freed_space += metadata->get_current_size();
}
Expand Down
5 changes: 0 additions & 5 deletions src/PartitionFIFOCaching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ namespace simgrid::fsmod {
sg_size_t space_that_can_be_created = 0.0;
std::vector<unsigned long> files_to_remove_to_create_space;

std::cerr << "** IN CREATE SPACE!\n";

for (auto const& [victim, victim_metadata]: priority_list_) {
std::cerr << "LOOKING AT VICTIM " << victim_metadata->file_name_ << "\n";
// Never evict an open file
if (victim_metadata->file_refcount_ > 0) {
continue;
Expand All @@ -37,10 +34,8 @@ 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() {
Expand Down

0 comments on commit 4540a67

Please sign in to comment.