Skip to content

Commit

Permalink
more double cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 22, 2024
1 parent 7716174 commit 71e3d02
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/wrench/communicator/Communicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ namespace wrench {
* @param config: the SMPI config option
*/
void Communicator::MPI_Alltoall(sg_size_t bytes, std::string config) {
if (bytes < 1.0) {
throw std::runtime_error("Communicator::MPI_Alltoall(): invalid argument (should be >= 1.0)");
if (bytes < 1) {
throw std::runtime_error("Communicator::MPI_Alltoall(): invalid argument (should be >= 1)");
}
this->performSMPIOperation("Alltoall", this->participating_hosts, nullptr, bytes, "smpi/alltoall:" + std::move(config));
}
Expand All @@ -186,7 +186,7 @@ namespace wrench {
* @param config: the SMPI config option
*/
void Communicator::MPI_Bcast(int root_rank, sg_size_t bytes, std::string config) {
if ((bytes < 1.0) or (root_rank < 0) or (root_rank >= (int) this->size)) {
if ((bytes < 1) or (root_rank < 0) or (root_rank >= (int) this->size)) {
throw std::runtime_error("Communicator::MPI_Bcast(): invalid argument");
}
this->performSMPIOperation("Bcast", this->participating_hosts, this->rank_to_host[root_rank], bytes, "smpi/bcast:" + std::move(config));
Expand Down
10 changes: 3 additions & 7 deletions src/wrench/services/storage/simple/SimpleStorageService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,21 @@ namespace wrench {
bool bufferized = false;// By default, non-bufferized
// bool bufferized = true; // By default, bufferized

std::cerr << "ASDASD\n";
if (property_list.find(wrench::SimpleStorageServiceProperty::BUFFER_SIZE) != property_list.end()) {
sg_size_t buffer_size = UnitParser::parse_size(property_list[wrench::SimpleStorageServiceProperty::BUFFER_SIZE]);
bufferized = buffer_size >= 1.0;// more than one byte means bufferized
bufferized = buffer_size >= 1;// more than one byte means bufferized
} else {
property_list[wrench::SimpleStorageServiceProperty::BUFFER_SIZE] = "0B";// enforce a zero buffersize
}
std::cerr << "ASDASD\n";

if (Simulation::isLinkShutdownSimulationEnabled() and (not bufferized)) {
throw std::runtime_error("SimpleStorageService::createSimpleStorageService(): Cannot use non-bufferized (i.e., buffer size == 0) "
"storage services and also simulate link shutdowns. This feature is not implemented yet.");
}

std::cerr << "ASDASD\n";
if (bufferized) {
std::cerr << "ASDASD4\n";
return (SimpleStorageService *) (new SimpleStorageServiceBufferized(hostname, mount_points, property_list, messagepayload_list));
} else {
std::cerr << "ASDASD1\n";
return (SimpleStorageService *) (new SimpleStorageServiceNonBufferized(hostname, mount_points, property_list, messagepayload_list));
}
}
Expand Down Expand Up @@ -139,7 +134,8 @@ namespace wrench {
} else {
throw std::invalid_argument("SimpleStorageService::SimpleStorageService(): Invalid caching behavior " + caching_behavior_property);
}
this->file_system->mount_partition(mp, sgfs::OneDiskStorage::create(this->getName()+"_fspart_"+mp, disk), (sg_size_t)disk_capacity, caching_scheme);
auto storage = sgfs::OneDiskStorage::create(this->getName()+"_fspart_"+mp, disk);
this->file_system->mount_partition(mp, storage, (sg_size_t)disk_capacity, caching_scheme);
}

this->num_concurrent_connections = this->getPropertyValueAsUnsignedLong(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ namespace wrench {
S4U_CommPort *answer_commport,
simgrid::s4u::Host *requesting_host) {

if (buffer_size >= 1.0) {
if (buffer_size >= 1) {
throw std::runtime_error("SimpleStorageServiceNonBufferized::processFileWriteRequest(): Cannot process a write requests with a non-zero buffer size");
}

Expand Down

0 comments on commit 71e3d02

Please sign in to comment.