Added Nek changes, fixing things

There is a waiting/sleep issue, detected and corrected by Marc

Merge request reports

Loading
+1 −1
Changes for lib/libcargo.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ transfer::wait() const {
    auto s = status();

    while(!s.done() && !s.failed()) {
        s = wait_for(150ms);
        s = wait_for(1000ms);
    }

    return s;
+1 −0
Changes for src/net/server.cpp: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -343,6 +343,7 @@ server::run() {
		LOGGER_INFO("LIBGKFS_HOSTS_FILE env variable set to: {}", gkfs_hosts);
	}


    LOGGER_INFO("");
    LOGGER_INFO("[[ Start up successful, awaiting requests... ]]");

+11 −8
Changes for src/posix_file/posix_file/fs_plugin/gekko_plugin.cpp: 11 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -79,19 +79,22 @@ gekko_plugin::readdir(const std::string& path) {
    for(auto& file : files) {

        struct stat buf; 
        stat("/" + file, &buf);
        std::string correct_path = file;
        if(path.size() != 1) {
            correct_path = path + "/" + file;
        } else {
            correct_path = "/" + file;
        }

        stat(correct_path, &buf);
       
        if(S_ISDIR(buf.st_mode)) {

            std::vector<std::string> subfiles = readdir("/" + file);
            std::vector<std::string> subfiles = readdir(correct_path);
            final_list.insert(final_list.end(), subfiles.begin(),
                              subfiles.end());
        } else {

            if(path.size() != 1) {
                final_list.push_back(path + "/" + file);
            } else {
                final_list.push_back("/" + file);
            }
                final_list.push_back(correct_path);          
        }
    }
  
+13 −3
Changes for src/posix_file/posix_file/file.hpp: 13 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ public:
    file_handle&
    operator=(const file_handle& other) = delete;

    explicit operator bool() const noexcept {
    explicit
    operator bool() const noexcept {
        return valid();
    }

@@ -161,7 +162,8 @@ public:

    explicit file(std::filesystem::path filepath,
                  cargo::FSPlugin::type t) noexcept
        : m_path(std::move(filepath)), m_fs_plugin(cargo::FSPlugin::make_fs(t)) {}
        : m_path(std::move(filepath)),
          m_fs_plugin(cargo::FSPlugin::make_fs(t)) {}

    file(std::filesystem::path filepath, int fd,
         std::shared_ptr<cargo::FSPlugin> fs_plugin) noexcept
@@ -293,6 +295,14 @@ protected:
    std::shared_ptr<cargo::FSPlugin> m_fs_plugin;
};

static void
recursive_mkdir(const std::filesystem::path& path,
                std::shared_ptr<cargo::FSPlugin> fs_plugin) {
    if(path.has_parent_path() and path != "/") {
        recursive_mkdir(path.parent_path(), fs_plugin);
        fs_plugin->mkdir(path.parent_path().c_str(), 0755);
    }
}

static inline file
open(const std::filesystem::path& filepath, int flags, ::mode_t mode,
@@ -304,7 +314,7 @@ open(const std::filesystem::path& filepath, int flags, ::mode_t mode,
    // We don't check if it exists, we just create it if flags is set to O_CREAT

    if(flags & O_CREAT) {
        fs_plugin->mkdir(filepath.parent_path().c_str(), 0755);
        recursive_mkdir(filepath, fs_plugin);
    }

    int fd = fs_plugin->open(filepath.c_str(), flags, mode);
+9 −6
Changes for src/proto/mpi/message.hpp: 9 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -26,12 +26,14 @@
#define CARGO_PROTO_MPI_MESSAGE_HPP

#include <fmt/format.h>
#include <fmt/ranges.h>
#include <filesystem>
#include <boost/archive/binary_oarchive.hpp>
#include <utility>
#include <optional>
#include "cargo.hpp"
#include "boost_serialization_std_optional.hpp"
#include <boost/serialization/vector.hpp>
#include "posix_file/file.hpp"

namespace cargo {
@@ -54,8 +56,8 @@ public:
    transfer_message() = default;

    transfer_message(std::uint64_t tid, std::uint32_t seqno,
                     std::string input_path, std::uint32_t i_type,
                     std::string output_path, std::uint32_t o_type)
                     std::vector<std::string> input_path, std::uint32_t i_type,
                     std::vector<std::string> output_path, std::uint32_t o_type)
        : m_tid(tid), m_seqno(seqno), m_input_path(std::move(input_path)),
          m_i_type(i_type), m_output_path(std::move(output_path)),
          m_o_type(o_type) {}
@@ -70,12 +72,12 @@ public:
        return m_seqno;
    }

    [[nodiscard]] const std::string&
    [[nodiscard]] const std::vector<std::string> &
    input_path() const {
        return m_input_path;
    }

    [[nodiscard]] const std::string&
    [[nodiscard]] const std::vector<std::string> &
    output_path() const {
        return m_output_path;
    }
@@ -107,9 +109,9 @@ private:

    std::uint64_t m_tid{};
    std::uint32_t m_seqno{};
    std::string m_input_path;
    std::vector<std::string> m_input_path;
    std::uint32_t m_i_type{};
    std::string m_output_path;
    std::vector<std::string> m_output_path;
    std::uint32_t m_o_type{};
};

@@ -244,6 +246,7 @@ struct fmt::formatter<cargo::transfer_message> : formatter<std::string_view> {
    }
};


template <>
struct fmt::formatter<cargo::status_message> : formatter<std::string_view> {
    // parse is inherited from formatter<string_view>.
Loading
Loading