Skip to content

Commit

Permalink
debugging output--
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 17, 2024
1 parent 8c8ec21 commit 4d55471
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace wrench {

std::map<simgrid::s4u::Host *, std::tuple<unsigned long, sg_size_t>> compute_resources;

// Core availabilities (for each hosts, how many cores and how many bytes of RAM are currently available on it)
// Core availabilities (for each host, how many cores and how many bytes of RAM are currently available on it)
std::unordered_map<simgrid::s4u::Host *, sg_size_t> ram_availabilities;
std::unordered_map<simgrid::s4u::Host *, unsigned long> running_thread_counts;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ namespace wrench {

std::vector<std::shared_ptr<FileLocation>> lookupFileLocation(const std::shared_ptr<DataFile> &file, S4U_CommPort *answer_commport);

std::vector<std::shared_ptr<FileLocation>> lookupOrDesignateStorageService(const std::shared_ptr<FileLocation> location);
std::vector<std::shared_ptr<FileLocation>> lookupOrDesignateStorageService(const std::shared_ptr<FileLocation>& location);

std::vector<std::shared_ptr<FileLocation>> lookupOrDesignateStorageService(const std::shared_ptr<FileLocation> location, unsigned int stripe_count);
std::vector<std::shared_ptr<FileLocation>> lookupOrDesignateStorageService(const std::shared_ptr<FileLocation>& location, unsigned int stripe_count);

bool hasFile(const std::shared_ptr<FileLocation> &location) override;

Expand Down Expand Up @@ -298,7 +298,7 @@ namespace wrench {

int main() override;

std::vector<std::shared_ptr<FileLocation>> lookupOrDesignateStorageService(const std::shared_ptr<DataFile> concrete_file_location,
std::vector<std::shared_ptr<FileLocation>> lookupOrDesignateStorageService(const std::shared_ptr<DataFile>& concrete_file_location,
unsigned int stripe_count,
S4U_CommPort *answer_commport);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace wrench {
"Must specify at least one valid StorageService");
}

if (std::any_of(storage_services.begin(), storage_services.end(), [](const auto &elem) { return elem == NULL; })) {
if (std::any_of(storage_services.begin(), storage_services.end(), [](const auto &elem) { return elem == nullptr; })) {
throw std::invalid_argument("One of the StorageServices provided is not initialized");
}

Expand Down Expand Up @@ -337,7 +337,7 @@ namespace wrench {
* @return A vector of shared_ptr on a FileLocation if the DataFile is known to the CompoundStorageService or could be allocated
* or empty vector if it's not / could not be allocated.
*/
std::vector<std::shared_ptr<FileLocation>> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr<DataFile> file, unsigned int stripe_count, S4U_CommPort *answer_commport) {
std::vector<std::shared_ptr<FileLocation>> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr<DataFile>& file, unsigned int stripe_count, S4U_CommPort *answer_commport) {
WRENCH_INFO("CSS::lookupOrDesignateStorageService() - DataFile + commport");

this->commport->putMessage(new CompoundStorageAllocationRequestMessage(
Expand All @@ -361,7 +361,7 @@ namespace wrench {
* @return A shared_ptr on a FileLocation if the DataFile is known to the CompoundStorageService or could be allocated
* or nullptr if it's not.
*/
std::vector<std::shared_ptr<FileLocation>> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr<FileLocation> location) {
std::vector<std::shared_ptr<FileLocation>> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr<FileLocation>& location) {

auto temp_commport = S4U_CommPort::getTemporaryCommPort();

Expand All @@ -383,7 +383,7 @@ namespace wrench {
* @return A shared_ptr on a FileLocation if the DataFile is known to the CompoundStorageService or could be allocated
* or nullptr if it's not.
*/
std::vector<std::shared_ptr<FileLocation>> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr<FileLocation> location, unsigned int stripe_count) {
std::vector<std::shared_ptr<FileLocation>> CompoundStorageService::lookupOrDesignateStorageService(const std::shared_ptr<FileLocation>& location, unsigned int stripe_count) {

auto temp_commport = S4U_CommPort::getTemporaryCommPort();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "wrench/services/storage/storage_helpers/FileTransferThreadMessage.h"

#include <wrench-dev.h>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <utility>
//#include <wrench/services/memory/MemoryManager.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,12 @@ class StorageServiceLinkFailuresTestWMS : public wrench::ExecutionController {
std::shared_ptr<wrench::DataFile> findRandomFileOnStorageService(const std::shared_ptr<wrench::StorageService>& ss) {
std::uniform_int_distribution<unsigned long> dist_files(0, this->test->files.size() - 1);

std::cerr << "IN FINDING RANDOM FILE!\n";
for (int trial = 0; trial < NUM_FILES; trial++) {
auto potential_file = this->test->files.at(dist_files(rng));
if (wrench::StorageService::lookupFileAtLocation(wrench::FileLocation::LOCATION(ss, potential_file))) {
std::cerr << "FOUND ONE!!\n";
return potential_file;
}
}
std::cerr << "DIDN'T FIND ONE!!\n";
return nullptr;
}

Expand Down

0 comments on commit 4d55471

Please sign in to comment.