diff --git a/src/wrench/communicator/Communicator.cpp b/src/wrench/communicator/Communicator.cpp index cd890751de..2fa77a505c 100755 --- a/src/wrench/communicator/Communicator.cpp +++ b/src/wrench/communicator/Communicator.cpp @@ -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)); } @@ -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)); diff --git a/src/wrench/services/storage/simple/SimpleStorageService.cpp b/src/wrench/services/storage/simple/SimpleStorageService.cpp index 240870f162..7fce3055d4 100644 --- a/src/wrench/services/storage/simple/SimpleStorageService.cpp +++ b/src/wrench/services/storage/simple/SimpleStorageService.cpp @@ -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)); } } @@ -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( diff --git a/src/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.cpp b/src/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.cpp index e78d93e037..9b9bff31ef 100644 --- a/src/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.cpp +++ b/src/wrench/services/storage/simple/SimpleStorageServiceNonBufferized.cpp @@ -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"); }