Commit bf854d00 authored by Ramon Nou's avatar Ramon Nou
Browse files

close file

parent e105dc10
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -238,7 +238,7 @@ set_target_properties(spdlog PROPERTIES POSITION_INDEPENDENT_CODE ON)
message(STATUS "[${PROJECT_NAME}] Searching for CLI11")
message(STATUS "[${PROJECT_NAME}] Searching for CLI11")
FetchContent_Declare(cli11
FetchContent_Declare(cli11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11
GIT_TAG 291c58789c031208f08f4f261a858b5b7083e8e2 # v2.3.2
GIT_TAG v2.5.0 # v2.3.2
GIT_SHALLOW ON
GIT_SHALLOW ON
GIT_PROGRESS ON
GIT_PROGRESS ON
)
)
@@ -293,6 +293,7 @@ endif()


### Threads: required by ASIO
### Threads: required by ASIO
find_package(Threads REQUIRED)
find_package(Threads REQUIRED)
find_package(Python3 COMPONENTS Development)


### ASIO: used for signal handling
### ASIO: used for signal handling
###
###
+1 −0
Original line number Original line Diff line number Diff line
@@ -45,6 +45,7 @@ target_link_libraries(cargo PRIVATE
        Boost::serialization
        Boost::serialization
        Boost::mpi
        Boost::mpi
        net::rpc_client
        net::rpc_client
        Python3::Python
)
)


## Install library + targets ###################################################
## Install library + targets ###################################################
+3 −2
Original line number Original line Diff line number Diff line
@@ -242,8 +242,9 @@ master_server::ftio_scheduling_ult() {
            continue;
            continue;
        }
        }


        LOGGER_INFO("Checking if there is work to do in {}",
        LOGGER_INFO("Checking if there is work to do in {} (should be empty : {})",
                    m_pending_transfer.m_sources);
                    m_pending_transfer.m_sources, m_pending_transfer.m_expanded_sources );

        m_pending_transfer.m_expanded_sources = {};
        m_pending_transfer.m_expanded_sources = {};
        m_pending_transfer.m_expanded_targets = {};
        m_pending_transfer.m_expanded_targets = {};
        
        
+4 −1
Original line number Original line Diff line number Diff line
@@ -288,6 +288,9 @@ public:
        return bytes_written;
        return bytes_written;
    }
    }


    int handle() const noexcept {
        return m_handle.native();
    }
    
    
protected:
protected:
    const std::filesystem::path m_path;
    const std::filesystem::path m_path;
+6 −4
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ mpio_write::operator()() {
        // We need to open the file and ask size (using fs_plugin)
        // We need to open the file and ask size (using fs_plugin)
        m_input_file = std::make_unique<posix_file::file>(
        m_input_file = std::make_unique<posix_file::file>(
                posix_file::open(m_input_path, O_RDONLY, 0, m_fs_i_type));
                posix_file::open(m_input_path, O_RDONLY, 0, m_fs_i_type));

        LOGGER_INFO("Worker: Opening {} --> handler {} ", m_input_path, m_input_file->handle());     
        std::size_t file_size = m_file_size;
        std::size_t file_size = m_file_size;


        // compute the number of blocks in the file
        // compute the number of blocks in the file
@@ -117,7 +117,7 @@ mpio_write::progress(int ongoing_index) {
    using posix_file::views::strided;
    using posix_file::views::strided;


    // compute the number of blocks in the file
    // compute the number of blocks in the file

   // LOGGER_INFO("Worker: Progress {}/{} --> handler {} ", ongoing_index, m_input_path, m_input_file->handle());     
    int index = 0;
    int index = 0;
    if(ongoing_index == 0) {
    if(ongoing_index == 0) {
        m_bytes_per_rank = 0;
        m_bytes_per_rank = 0;
@@ -177,7 +177,7 @@ mpio_write::progress(int ongoing_index) {


            ++index;
            ++index;
        }
        }

        m_input_file->close();
        // step 2. write buffer data in parallel to the PFS
        // step 2. write buffer data in parallel to the PFS
        //LOGGER_INFO("START WRITING file {}", m_output_path);
        //LOGGER_INFO("START WRITING file {}", m_output_path);
        const auto output_file =
        const auto output_file =
@@ -227,6 +227,8 @@ mpio_write::progress(int ongoing_index) {
            m_status = make_mpi_error(ec);
            m_status = make_mpi_error(ec);
            return -1;
            return -1;
        }
        }
        
        
    } catch(const mpioxx::io_error& e) {
    } catch(const mpioxx::io_error& e) {
        LOGGER_ERROR("{}() failed: {}", e.where(), e.what());
        LOGGER_ERROR("{}() failed: {}", e.where(), e.what());
        m_status = make_mpi_error(e.error_code());
        m_status = make_mpi_error(e.error_code());