Skip to content

Commit

Permalink
Merge pull request #486 from lukemartinlogan/master
Browse files Browse the repository at this point in the history
Hermes 0.9.5
  • Loading branch information
lukemartinlogan committed Feb 6, 2023
2 parents 0c61ed5 + d83dd21 commit 7416623
Show file tree
Hide file tree
Showing 111 changed files with 12,844 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ GTAGS

.gdb_history

/cmake-build-debug/
/cmake-build-release/
/cmake-build-*
/.idea/
/.clang-format
__pycache__/
Expand Down
5 changes: 3 additions & 2 deletions adapter/test/mpiio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ target_link_libraries(hermes_mpiio_adapter_test hermes_mpiio)
add_dependencies(hermes_mpiio_adapter_test hermes_mpiio hermes_daemon)
set_target_properties(hermes_mpiio_adapter_test PROPERTIES COMPILE_FLAGS "-DHERMES_INTERCEPT=1")

mpi_daemon(hermes_mpiio_adapter_test 2 "[synchronicity=async] -d yes" "async" 1)
mpi_daemon(hermes_mpiio_adapter_test 2 "[synchronicity=sync] -d yes" "sync" 1)
# TODO(llogan): add back
# mpi_daemon(hermes_mpiio_adapter_test 2 "[synchronicity=async] -d yes" "async" 1)
# mpi_daemon(hermes_mpiio_adapter_test 2 "[synchronicity=sync] -d yes" "sync" 1)

set(MPIIO_TESTS
mpiio_adapter_test
Expand Down
2 changes: 2 additions & 0 deletions ci/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ set -x
set -e
set -o pipefail

sudo apt-get install -y pkg-config

# Change this especially when your $HOME doesn't have enough disk space.
INSTALL_DIR="${HOME}/${LOCAL}"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Distributed under BSD 3-Clause license. *
* Copyright by The HDF Group. *
* Copyright by the Illinois Institute of Technology. *
* All rights reserved. *
* *
* This file is part of Hermes. The full Hermes copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the top directory. If you do not *
* have access to the file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef HERMES_SHM_INCLUDE_HERMES_SHM_CONSTANTS_DATA_STRUCTURE_SINGLETON_MACROS_H_H
#define HERMES_SHM_INCLUDE_HERMES_SHM_CONSTANTS_DATA_STRUCTURE_SINGLETON_MACROS_H_H

#include <hermes_shm/util/singleton.h>

#define HERMES_SHM_SYSTEM_INFO scs::Singleton<hermes_shm::SystemInfo>::GetInstance()
#define HERMES_SHM_SYSTEM_INFO_T hermes_shm::SystemInfo*

#define HERMES_SHM_MEMORY_MANAGER scs::Singleton<hermes_shm::ipc::MemoryManager>::GetInstance()
#define HERMES_SHM_MEMORY_MANAGER_T hermes_shm::ipc::MemoryManager*

#define HERMES_SHM_THREAD_MANAGER scs::Singleton<hermes_shm::ThreadManager>::GetInstance()
#define HERMES_SHM_THREAD_MANAGER_T hermes_shm::ThreadManager*

#endif // include_labstor_constants_data_structure_singleton_macros_h
30 changes: 30 additions & 0 deletions hermes_shm/include/hermes_shm/constants/macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Distributed under BSD 3-Clause license. *
* Copyright by The HDF Group. *
* Copyright by the Illinois Institute of Technology. *
* All rights reserved. *
* *
* This file is part of Hermes. The full Hermes copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the top directory. If you do not *
* have access to the file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef HERMES_SHM_MACROS_H
#define HERMES_SHM_MACROS_H

#define KILOBYTES(n) ((size_t)(n) * (1<<10))
#define MEGABYTES(n) ((size_t)(n) * (1<<20))
#define GIGABYTES(n) ((size_t)(n) * (1<<30))

#define TYPE_BITS(type) ((sizeof(type)*8))

#define TYPE_WRAP(...) (__VA_ARGS__)

#define TYPE_UNWRAP(X) ESC(ISH X)
#define ISH(...) ISH __VA_ARGS__
#define ESC(...) ESC_(__VA_ARGS__)
#define ESC_(...) VAN ## __VA_ARGS__
#define VANISH

#endif // HERMES_SHM_MACROS_H
22 changes: 22 additions & 0 deletions hermes_shm/include/hermes_shm/data_structures/data_structure.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Distributed under BSD 3-Clause license. *
* Copyright by The HDF Group. *
* Copyright by the Illinois Institute of Technology. *
* All rights reserved. *
* *
* This file is part of Hermes. The full Hermes copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the top directory. If you do not *
* have access to the file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef HERMES_SHM_DATA_STRUCTURES_DATA_STRUCTURE_H_
#define HERMES_SHM_DATA_STRUCTURES_DATA_STRUCTURE_H_

#include "internal/shm_archive.h"
#include "internal/shm_container.h"
#include "internal/shm_smart_ptr.h"
#include "internal/shm_macros.h"
#include "internal/shm_container.h"

#endif // HERMES_SHM_DATA_STRUCTURES_DATA_STRUCTURE_H_
105 changes: 105 additions & 0 deletions hermes_shm/include/hermes_shm/data_structures/internal/shm_archive.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Distributed under BSD 3-Clause license. *
* Copyright by The HDF Group. *
* Copyright by the Illinois Institute of Technology. *
* All rights reserved. *
* *
* This file is part of Hermes. The full Hermes copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the top directory. If you do not *
* have access to the file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef HERMES_SHM_DATA_STRUCTURES_SHM_ARCHIVE_H_
#define HERMES_SHM_DATA_STRUCTURES_SHM_ARCHIVE_H_

#include "hermes_shm/memory/memory_manager.h"
#include "shm_macros.h"

namespace hermes_shm::ipc {

/**
* Indicates that a data structure can be stored directly in memory or
* shared memory.
* */
class ShmPredictable {};

/**
* Indicates that a data structure can be archived in shared memory
* and has a corresponding TypedPointer override.
* */
class ShmArchiveable : public ShmPredictable {
/**
* Initialize a SHM data structure in shared-memory.
* Constructors may wrap around these.
* */
// void shm_init(...);

/**
* Destroys the shared-memory allocated by the object.
* Destructors may wrap around this.
* */
// void shm_destroy();

/**
* Deep copy of an object. Wrapped by copy constructor
* */
// void shm_strong_copy(const CLASS_NAME &other);
// SHM_INHERIT_COPY_OPS(CLASS_NAME)

/**
* Copies only the object's pointers.
* */
// void WeakCopy(const CLASS_NAME &other);

/**
* Moves the object's contents into another object
* */
// void shm_weak_move(CLASS_NAME &other);
// SHM_INHERIT_MOVE_OPS(CLASS_NAME)

/**
* Store object into a TypedPointer
* */
// void shm_serialize(TypedPointer<TYPED_CLASS> &ar) const;
// SHM_SERIALIZE_OPS(TYPED_CLASS)

/**
* Construct object from a TypedPointer.
* */
// void shm_deserialize(const TypedPointer<TYPED_CLASS> &ar);
// SHM_DESERIALIZE_OPS(TYPED_CLASS)
};

/**
* Enables a specific TypedPointer type to be serialized
* */
#define SHM_SERIALIZE_OPS(TYPED_CLASS)\
void operator>>(hipc::TypedPointer<TYPE_UNWRAP(TYPED_CLASS)> &ar) const {\
shm_serialize(ar);\
}\
void operator>>(hipc::TypedAtomicPointer<TYPE_UNWRAP(TYPED_CLASS)> &ar) const {\
shm_serialize(ar);\
}

/**
* Enables a specific TypedPointer type to be deserialized
* */
#define SHM_DESERIALIZE_OPS(TYPED_CLASS)\
void operator<<(const hipc::TypedPointer<TYPE_UNWRAP(TYPED_CLASS)> &ar) {\
shm_deserialize(ar);\
}\
void operator<<(\
const hipc::TypedAtomicPointer<TYPE_UNWRAP(TYPED_CLASS)> &ar) {\
shm_deserialize(ar);\
}

/** Enables serialization + deserialization for data structures */
#define SHM_SERIALIZE_DESERIALIZE_OPS(AR_TYPE)\
SHM_SERIALIZE_OPS(AR_TYPE)\
SHM_DESERIALIZE_OPS(AR_TYPE)


} // namespace hermes_shm::ipc

#endif // HERMES_SHM_DATA_STRUCTURES_SHM_ARCHIVE_H_
Loading

0 comments on commit 7416623

Please sign in to comment.