Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds fabric attached memory support #136

Open
wants to merge 90 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
f81312a
feat(Endpoint): construct from a URI
mcakircali Feb 9, 2024
c6a1d1b
feat(Exception): add PermissionDenied, NotFound, and AlreadyExists
mcakircali May 28, 2024
7e55bcc
style(Endpoint): fix spacing
mcakircali May 28, 2024
18e2173
feat(FAM): add FamConfig
mcakircali May 28, 2024
d89ce1d
feat(FAM): add FamProperty
mcakircali May 28, 2024
0100289
feat(FAM): add FamSessionDetail
mcakircali May 28, 2024
9d15d21
feat(FAM): add FamObjectDetail and FamRegionDetail
mcakircali May 28, 2024
834e383
feat(FAM): add FamObject
mcakircali May 28, 2024
cf9d3ce
feat(FAM): add FamRegion
mcakircali May 28, 2024
9a15889
feat(FAM): add FamSession
mcakircali May 28, 2024
0ac8e1c
style(FAM): cleanup FamObject
mcakircali May 28, 2024
019a023
feat(FAM): add FamName
mcakircali May 28, 2024
eae3d56
feat(FAM): add FamObjectName
mcakircali May 28, 2024
ac97194
feat(FAM): add FamURIManager
mcakircali May 28, 2024
fa65557
feat(FAM): add FamHandle
mcakircali May 28, 2024
612e118
feat(FAM): add CMake stuff
mcakircali May 28, 2024
23c812b
feat(FAM): add basic test for region
mcakircali May 28, 2024
15eec53
fix(FAM): no name fam objects are valid
mcakircali May 29, 2024
9c12f27
style(FAM): cleanup fam test
mcakircali May 29, 2024
88559c1
feat(FAM): added FamList and FamIterator
mcakircali May 29, 2024
563bfcb
feat(FAM): added test for FamList
mcakircali May 29, 2024
7def82a
feat(Buffer): added view() method
mcakircali May 29, 2024
a24d283
chore(git): update gitignore
mcakircali Jun 4, 2024
8a7e645
fix(FAM): minor FamList
mcakircali Jun 4, 2024
159c2ed
fix(FAM): missing add()
mcakircali Jun 7, 2024
83a4133
feat(FAM): FamList size and const_iterator
mcakircali Jun 7, 2024
aeeb708
feat(FAM): FamList test multi-thread
mcakircali Jun 7, 2024
a27c704
fix(FAM): logics in name and handle
mcakircali Jun 7, 2024
7d9229b
fix(FAM): FamNode helpers
mcakircali Jun 7, 2024
aaed9ba
feat(FAM): atomic subtract and uid/gid property
mcakircali Jun 7, 2024
9143b1a
feat(FAM): tests common header
mcakircali Jun 7, 2024
c7e3527
fix(FAM): session API, remove object and region details
mcakircali Jun 12, 2024
eac0563
fix(FAM): default session name
mcakircali Jun 12, 2024
fcbb4f0
refactor(FAM)!: type declarations for object/region/session
mcakircali Jun 12, 2024
e765362
fix(FAM): API FamObject and FamRegion
mcakircali Jun 12, 2024
4ebff2b
fix(FAM): removed FamObjectName, and move all its stuff to FamName
mcakircali Jun 12, 2024
7102266
fix(FAM): FamURIManager uses FamName
mcakircali Jun 12, 2024
f5f4ba0
fix(FAM): CMakeLists left over FamObjectName
mcakircali Jun 12, 2024
2031014
feat(FAM): FamList and FamListIterator uses non smart ptr
mcakircali Jun 12, 2024
d2a33f0
feat(FAM): FamHandle API uses URI
mcakircali Jun 12, 2024
fdbd96e
fix(FAM): FamList tests
mcakircali Jun 12, 2024
0b0b9f8
fix(FAM): bug in FamName path parsing
mcakircali Jun 12, 2024
941c5b3
refactor(FAM): cosmetic
mcakircali Jun 12, 2024
be4cf01
test(FAM): added more region and object API stuff
mcakircali Jun 12, 2024
a3507c3
feat(Exceptions): added OutOfStorage exception
mcakircali Jun 13, 2024
9b7fcd7
test(FAM): added more object tests
mcakircali Jun 13, 2024
80cb07d
feat(FAM): added version to FamNode header
mcakircali Jun 13, 2024
479cdce
fix(FAM): added missing find_package in CMakeLists
mcakircali Jun 13, 2024
d23597b
style(FAM): cosmetic
mcakircali Jun 13, 2024
feb59d0
feat(FAM): added FamNamePath
mcakircali Jun 14, 2024
7664d3e
test(FAM): ctor URI and Name
mcakircali Jun 14, 2024
e6540ba
feat(URI): added Endpoint getter
mcakircali Jun 15, 2024
b80d778
feat(FAM): API for FamNamePath from URI and cleanup
mcakircali Jun 15, 2024
5446778
test(FAM): fixes API
mcakircali Jun 15, 2024
498945a
feat(URI): extended ctor for Endpoint
mcakircali Jun 17, 2024
d2260c2
feat(FAM): moved FamPath to seperate source
mcakircali Jun 17, 2024
5a9e3c3
test(FAM): fixed API changes
mcakircali Jun 17, 2024
389f058
test(FAM): added FamPath tests
mcakircali Jun 17, 2024
da231b4
feat(cmake): added FindLibUUID
mcakircali Jun 17, 2024
0a76dea
feat(FAM): generate UUID V5
mcakircali Jun 17, 2024
2600ae9
fix(FAM): FamHandle API
mcakircali Jun 17, 2024
7d67f59
feat(FAM): FamName with endpoint member
mcakircali Jul 2, 2024
f37c54a
feat(FAM): small changes to FamName and FamPath
mcakircali Jul 2, 2024
c46d522
fix(FAM): added metadata server exception
mcakircali Jul 5, 2024
8084b8c
feat(FAM): make FamName abstract
mcakircali Jul 5, 2024
fe74e68
feat(FAM): added FamRegionName
mcakircali Jul 5, 2024
5f2f4d2
feat(FAM): added FamObjectName
mcakircali Jul 5, 2024
f4c14b3
fix(FAM): use FamObjectName in FamHandle
mcakircali Jul 5, 2024
8406fd6
fix(FAM): use FamObjectName in FamURIManager
mcakircali Jul 5, 2024
c916b13
test(FAM): refactor after FamName changes
mcakircali Jul 5, 2024
3c06f56
fix(FAM): FamName API
mcakircali Jul 5, 2024
0635489
fix(FAM): cleanup
mcakircali Jul 5, 2024
de2db6d
feat(FAM): added ctor for FamPath
mcakircali Jul 5, 2024
c5e5e0a
test(FAM): added Name stuff and fixes
mcakircali Jul 5, 2024
cbd82e2
feat(FAM): get object from region
mcakircali Jul 6, 2024
f25c67f
feat(FAM): static uuid method
mcakircali Jul 6, 2024
3f8826f
feat(FAM): added object uuid method
mcakircali Jul 6, 2024
b876c28
feat(FAM): added uri belongs method
mcakircali Jul 6, 2024
0636715
test(FAM): comment out Buffer data()
mcakircali Jul 8, 2024
ebd49b5
feat(FAM): added Stream API to FamName
mcakircali Jul 16, 2024
10cde31
feat(FAM): added Stream API to FamPath
mcakircali Jul 16, 2024
98bba5a
fix(FAM): assert handle obj
mcakircali Jul 16, 2024
a582f72
feat(FAM): added uriBelongs to FamRegionName
mcakircali Jul 16, 2024
2f37426
feat(FAM): added buffer() to ObjectName
mcakircali Jul 16, 2024
b35baf0
test(FAM): API fixes
mcakircali Jul 16, 2024
a6b564d
feat(FAM): added FamMap (WIP)
mcakircali Oct 30, 2024
4ffb14a
fix(FAM): Fam_Descriptor_Status issue
mcakircali Nov 6, 2024
6d0c0cb
fix(FAM): nothrow get session
mcakircali Nov 10, 2024
95413af
feat(FAM): add string support for property
mcakircali Nov 10, 2024
354715b
fix(FAM): cmake LibUUID issue on some systems
mcakircali Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ doc/latex
.idea
build/
*.ccls-cache
compile_commands.json
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ if( NOT TARGET OpenMP::OpenMP_CXX )
set( eckit_HAVE_OMP 0 )
endif()

### OpenFAM Support

ecbuild_add_option( FEATURE OPENFAM
DEFAULT OFF
REQUIRED_PACKAGES "LibUUID REQUIRED" "protobuf REQUIRED" "gRPC REQUIRED" "OpenFAM REQUIRED"
DESCRIPTION "Enables OpenFAM support" )

if( eckit_HAVE_OPENFAM )
find_package( LibUUID REQUIRED )
find_package( protobuf CONFIG REQUIRED )
find_package( gRPC CONFIG REQUIRED )
Comment on lines +118 to +119
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should specify the desired minimum version to search for.

find_package( OpenFAM 3.0.1 CONFIG REQUIRED )
endif()

### RADOS

ecbuild_add_option( FEATURE RADOS
Expand Down
108 changes: 108 additions & 0 deletions cmake/FindLibUUID.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Copyright 2024- European Centre for Medium-Range Weather Forecasts (ECMWF)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.
#
# Requires:
# FindPackageHandleStandardArgs (CMake standard module)
#

#[=======================================================================[.rst:
FindLibUUID
--------

This module finds the libuuid (from util-linux) library.

Imported Targets
^^^^^^^^^^^^^^^^

This module provides the following imported targets, if found:

``LibUUID``
The libuuid library

Result variables
^^^^^^^^^^^^^^^^

This module will set the following variables in your project:

``LIB_UUID_FOUND``
True if the libuuid library is found.
``LIB_UUID_INCLUDE_DIRS``
Include directories needed to use libuuid.
``LIB_UUID_LIBRARIES``
Libraries needed to link to libuuid.

Cache variables
^^^^^^^^^^^^^^^

The following cache variables may also be set to help find libuuid library:

``LIB_UUID_INCLUDE_DIR``
where to find the libuuid headers.
``LIB_UUID_LIBRARY``
where to find the libuuid library.

Hints
^^^^^

The environment variables ``LIB_UUID_ROOT``, ``LIB_UUID_DIR``, and ``LIB_UUID_PATH``
may also be set to help find libuuid library.

#]=======================================================================]

find_path(LIB_UUID_INCLUDE_DIR uuid.h
HINTS
${LIB_UUID_ROOT}
${LIB_UUID_DIR}
${LIB_UUID_PATH}
ENV LIB_UUID_ROOT
ENV LIB_UUID_DIR
ENV LIB_UUID_PATH
PATH_SUFFIXES uuid
Comment on lines +69 to +75
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we working with custom compiled / custom locations for libuuid? if not the default search locations should be sufficient to pick up libuuid

)

find_library(LIB_UUID_LIBRARY
NAMES uuid
HINTS
${LIB_UUID_ROOT}
${LIB_UUID_DIR}
${LIB_UUID_PATH}
ENV LIB_UUID_ROOT
ENV LIB_UUID_DIR
ENV LIB_UUID_PATH
PATH_SUFFIXES lib lib64
)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(LibUUID REQUIRED_VARS
LIB_UUID_LIBRARY
LIB_UUID_INCLUDE_DIR)

if (LIB_UUID_FOUND)
set(LIB_UUID_LIBRARIES ${LIB_UUID_LIBRARY})
set(LIB_UUID_INCLUDE_DIRS ${LIB_UUID_INCLUDE_DIR})
if(NOT TARGET LibUUID)
add_library(LibUUID UNKOWN IMPORTED)
set_target_properties(LibUUID PROPERTIES
IMPORTED_LOCATION "${LIB_UUID_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LIB_UUID_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${LIB_UUID_LIBRARY}")
endif()
endif()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that your custom find package follows the one make uses internally for liquid, see: https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/Modules/FindLibUUID.cmake

Ofc you can drop msgs/cygwin stuff.


mark_as_advanced(LIB_UUID_INCLUDE_DIR LIB_UUID_LIBRARY)
31 changes: 31 additions & 0 deletions src/eckit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,36 @@ list(APPEND eckit_message_srcs
message/Splitter.h
)

if(HAVE_OPENFAM)
list(APPEND eckit_io_srcs
io/fam/detail/FamSessionDetail.cc
io/fam/FamConfig.h
io/fam/FamHandle.cc
io/fam/FamHandle.h
io/fam/FamList.cc
io/fam/FamList.h
io/fam/FamListIterator.cc
io/fam/FamListIterator.h
io/fam/FamName.cc
io/fam/FamName.h
io/fam/FamObject.cc
io/fam/FamObject.h
io/fam/FamObjectName.cc
io/fam/FamObjectName.h
io/fam/FamPath.cc
io/fam/FamPath.h
io/fam/FamProperty.h
io/fam/FamRegion.cc
io/fam/FamRegion.h
io/fam/FamRegionName.cc
io/fam/FamRegionName.h
io/fam/FamSession.cc
io/fam/FamSession.h
io/fam/FamURIManager.cc
io/fam/FamURIManager.h
)
endif(HAVE_OPENFAM)

if(HAVE_RADOS)
list( APPEND eckit_io_srcs
io/rados/RadosHandle.cc
Expand Down Expand Up @@ -943,6 +973,7 @@ ecbuild_add_library(
"${CURL_LIBRARIES}"
"${AIO_LIBRARIES}"
"${RADOS_LIBRARIES}"
$<${HAVE_OPENFAM}:OpenFAM::openfam>

PUBLIC_LIBS
${CMATH_LIBRARIES}
Expand Down
8 changes: 8 additions & 0 deletions src/eckit/exception/Exceptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ Abort::Abort(const std::string& r, const CodeLocation& loc) :
Retry::Retry(const std::string& r) :
Exception(std::string("Retry: ") + r) {}

PermissionDenied::PermissionDenied(const std::string& r): Exception(std::string("Permission denied: ") + r) { }

NotFound::NotFound(const std::string& r): Exception(std::string("Not found: ") + r) { }

AlreadyExists::AlreadyExists(const std::string& r): Exception(std::string("Already exists: ") + r) { }

OutOfStorage::OutOfStorage(const std::string& r): Exception(std::string("Out of storage: ") + r) { }

Cancel::Cancel(const std::string& r) :
Exception(std::string("Cancel: ") + r) {}

Expand Down
20 changes: 20 additions & 0 deletions src/eckit/exception/Exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,26 @@ class Retry : public Exception {
Retry(const std::string&);
};

class PermissionDenied: public Exception {
public:
PermissionDenied(const std::string&);
};

class NotFound: public Exception {
public:
NotFound(const std::string&);
};

class AlreadyExists: public Exception {
public:
AlreadyExists(const std::string&);
};

class OutOfStorage: public Exception {
public:
OutOfStorage(const std::string&);
};

class UserError : public Exception {
public:
UserError(const std::string&, const CodeLocation&);
Expand Down
3 changes: 3 additions & 0 deletions src/eckit/filesystem/URI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ URI::URI(const std::string& scheme, const URI& uri, const std::string& hostname,
fragment_(uri.fragment_),
queryValues_(uri.queryValues_) {}

URI::URI(std::string scheme, const net::Endpoint& endpoint, std::string name) noexcept:
name_(std::move(name)), scheme_(std::move(scheme)), host_(endpoint.host()), port_(endpoint.port()) { }

URI::URI(Stream& s) {
s >> scheme_;
s >> user_;
Expand Down
6 changes: 5 additions & 1 deletion src/eckit/filesystem/URI.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "eckit/io/Offset.h"
#include "eckit/net/Endpoint.h"

#include <string>

namespace eckit {

Expand All @@ -48,6 +49,7 @@ class URI {
URI(const std::string& scheme, const URI& uri);
URI(const std::string& scheme, const std::string& hostname, int port);
URI(const std::string& scheme, const URI& uri, const std::string& hostname, int port);
URI(std::string scheme, const net::Endpoint& endpoint, std::string name) noexcept;
URI(Stream& s);

// Destructor
Expand All @@ -62,7 +64,9 @@ class URI {
DataHandle* newReadHandle(const OffsetList&, const LengthList&) const;
DataHandle* newReadHandle() const;

void endpoint(const eckit::net::Endpoint& endpoint) {
net::Endpoint endpoint() const { return {host_, port_}; }

void endpoint(const net::Endpoint& endpoint) {
host_ = endpoint.host();
port_ = endpoint.port();
}
Expand Down
2 changes: 2 additions & 0 deletions src/eckit/io/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class Buffer : private NonCopyable {

~Buffer();

std::string_view view() const noexcept { return std::string_view(buffer_, size_); }

Comment on lines +43 to +44
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buffer is a byte buffer and while it could be used as a c-string it think this should not be done. Especially. since the only usage I can see is in tests.

operator char*() { return buffer_; }
operator const char*() const { return buffer_; }

Expand Down
47 changes: 47 additions & 0 deletions src/eckit/io/fam/FamConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* (C) Copyright 1996- ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergovernmental organisation nor
* does it submit to any jurisdiction.
*/

/*
* This software was developed as part of the Horizon Europe programme funded project OpenCUBE
* (Grant agreement: 101092984) horizon-opencube.eu
*/

/// @file FamConfig.h
/// @author Metin Cakircali
/// @date May 2024

#pragma once

#include "eckit/net/Endpoint.h"

#include <ostream>
#include <string>

namespace eckit {

//----------------------------------------------------------------------------------------------------------------------

struct FamConfig {
net::Endpoint endpoint {"127.0.0.1", -1};
std::string sessionName {"EckitFamSession"};

bool operator==(const FamConfig& other) const {
return (endpoint == other.endpoint && sessionName == other.sessionName);
}

friend std::ostream& operator<<(std::ostream& out, const FamConfig& config) {
out << "endpoint=" << config.endpoint << ", sessionName=" << config.sessionName;
return out;
}
Comment on lines +39 to +42
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not need to be a friend.

};

//----------------------------------------------------------------------------------------------------------------------

} // namespace eckit
Loading
Loading