Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ae7116a
Intermediate commit, likely broken
devreal May 10, 2017
9a22dcc
Store shared memory window information as segment 0 in the segment ha…
devreal May 18, 2017
7f727ad
Get rid of some of the shared memory window global variables
devreal May 18, 2017
01bfc92
Remove dead code
devreal May 18, 2017
81a2ad6
Adapt atomic operations to use seginfo
devreal May 18, 2017
9d04282
Refrain from using the local allocation window global variable
devreal May 19, 2017
5ed5e98
Ensure local consistency of non-blocking read-after-write operations
devreal May 19, 2017
ce54b67
Document visibility of updates through dart_put
devreal May 19, 2017
0dc6b90
No need to pre-allocate local segment and to link it into other teams
devreal May 19, 2017
3a3ae66
Add test case for consistent put/get
devreal May 19, 2017
e46e3ec
Merge branch 'development' into feat-dart-asyncput
devreal May 19, 2017
f654686
Do not overwrite CFLAGS with release CFLAGS (pretty sure I had fixed …
devreal May 19, 2017
6f760e5
Fix assignment of win variable
devreal May 19, 2017
72334ec
Remove debug output
devreal May 19, 2017
9e0bb5c
Do not re-use variable used in put
devreal May 19, 2017
1c1ff80
Introduce flags for dart_get* to control odering with dart_put (and a…
devreal May 29, 2017
2843dd0
Merge branch 'development' into feat-dart-asyncput
fuchsto May 31, 2017
5b36640
Make dart_segment_get_info static inline
devreal Jun 1, 2017
7d8f7cb
Replace if() checks with DART_ASSERT_MSG and add some short-cuts
devreal Jun 1, 2017
18465fa
Add dart_team_memalloc_aligned_full which does not allocate into the …
devreal Jun 2, 2017
b9bfc99
Make triggering progress in DART optional as it is quite expensive (~…
devreal Jun 2, 2017
e0c1415
Output whether explicit progress is enabled
devreal Jun 2, 2017
dfe44e9
Fix missing MPI_Win_lock in dart_team_memalloc_aligned_full
devreal Jun 2, 2017
208e66c
Mark segment dirty in atomic operations
devreal Jun 2, 2017
00188e6
Temporarily add DART_FULL_ALLOC to SymmetricAllocator
devreal Jun 23, 2017
eabfc41
Add GlobAsyncRef<Atomic<T>> overload
devreal Jun 23, 2017
4c6abfc
Merge branch 'feat-dart-asyncput' of github.com:dash-project/dash int…
devreal Jun 23, 2017
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
4 changes: 2 additions & 2 deletions CMakeExt/Threading.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ if (ENABLE_THREADSUPPORT)
if (DART_SYNC_BUILTINS)
MESSAGE(STATUS "Found builtin __sync_add_and_fetch")
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS_RELEASE} -DDART_HAVE_SYNC_BUILTINS")
"${CMAKE_C_FLAGS} -DDART_HAVE_SYNC_BUILTINS")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS_RELEASE} -DDART_HAVE_SYNC_BUILTINS")
"${CMAKE_CXX_FLAGS} -DDART_HAVE_SYNC_BUILTINS")
else()
# error out for now
MESSAGE(STATUS "Compiling builtin __sync_add_and_fetch failed with error "
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ option(ENABLE_HDF5
"Specify whether HDF5 features are enabled" on)
option(ENABLE_NASTYMPI
"Specify whether the NastyMPI proxy should be enabled" off)
option(ENABLE_DART_PROGRESS
"Specify whether DART explicitely triggers progress" off)

if (BUILD_COVERAGE_TESTS)
set(BUILD_TESTS TRUE CACHE BOOLEAN
Expand Down Expand Up @@ -264,6 +266,8 @@ message(INFO "Unified RMA memory model: (ENABLE_UNIFIED_MEMORY_MODEL) "
${ENABLE_UNIFIED_MEMORY_MODEL})
message(INFO "MPI shared windows: (ENABLE_SHARED_WINDOWS) "
${ENABLE_SHARED_WINDOWS})
message(INFO "Explicit DART progress: (ENABLE_DART_PROGRESS) "
${ENABLE_DART_PROGRESS})
message(INFO "Enable multithreading: (ENABLE_THREADSUPPORT) "
${ENABLE_THREADSUPPORT})
message(INFO "Default index type long: (ENABLE_DEFAULT_INDEX_TYPE_LONG) "
Expand Down
1 change: 1 addition & 0 deletions build.debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ rm -Rf $BUILD_DIR/*
-DENABLE_ASSERTIONS=ON \
\
-DENABLE_SHARED_WINDOWS=ON \
-DENABLE_DART_PROGRESS=ON \
-DENABLE_UNIFIED_MEMORY_MODEL=ON \
-DENABLE_DEFAULT_INDEX_TYPE_LONG=ON \
\
Expand Down
1 change: 1 addition & 0 deletions build.dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ rm -Rf $BUILD_DIR/*
-DENABLE_ASSERTIONS=ON \
\
-DENABLE_SHARED_WINDOWS=ON \
-DENABLE_DART_PROGRESS=ON \
-DENABLE_UNIFIED_MEMORY_MODEL=ON \
-DENABLE_DEFAULT_INDEX_TYPE_LONG=ON \
\
Expand Down
1 change: 1 addition & 0 deletions build.minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ rm -Rf $BUILD_DIR/*
-DENABLE_ASSERTIONS=ON \
\
-DENABLE_SHARED_WINDOWS=OFF \
-DENABLE_DART_PROGRESS=OFF \
-DENABLE_UNIFIED_MEMORY_MODEL=ON \
-DENABLE_DEFAULT_INDEX_TYPE_LONG=OFF \
\
Expand Down
57 changes: 46 additions & 11 deletions dart-if/include/dash/dart/if/dart_communication.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ extern "C" {
#define DART_INTERFACE_ON
/** \endcond */

/*
* Set of flags to be passed to \ref dart_get, \ref dart_get_blocking, and
* \ref dart_get_handle to control their behavior.
*/
typedef enum {
/// Empty flag
DART_FLAG_NONE = 0,
/// Enforce odering of communication operations
DART_FLAG_ORDERED = 1
} dart_communication_flags_t;


/**
* \name Collective operations
* Collective operations involving all units of a given team.
Expand Down Expand Up @@ -170,8 +182,10 @@ dart_ret_t dart_allgatherv(
*
* \param sendbuf The buffer containing the data to be sent by each unit.
* \param recvbuf The buffer to hold the received data.
* \param nelem Number of elements sent by each process and received from each unit.
* \param dtype The data type of values in \c sendbuf and \c recvbuf to use in \c op.
* \param nelem Number of elements sent by each process and received from
* each unit.
* \param dtype The data type of values in \c sendbuf and \c recvbuf to use
* in \c op.
* \param op The reduction operation to perform.
* \param team The team to participate in the allreduce.
*
Expand All @@ -192,8 +206,10 @@ dart_ret_t dart_allreduce(
* DART Equivalent to MPI_Reduce.
*
* \param sendbuf Buffer containing \c nelem elements to reduce using \c op.
* \param recvbuf Buffer of size \c nelem to store the result of the element-wise operation \c op in.
* \param nelem The number of elements of type \c dtype in \c sendbuf and \c recvbuf.
* \param recvbuf Buffer of size \c nelem to store the result of the
* element-wise operation \c op in.
* \param nelem The number of elements of type \c dtype in \c sendbuf
* and \c recvbuf.
* \param dtype The data type of values stored in \c sendbuf and \c recvbuf.
* \param op The reduce operation to perform.
* \param root The unit receiving the reduced values.
Expand Down Expand Up @@ -333,6 +349,8 @@ dart_ret_t dart_compare_and_swap(
* \param gptr A global pointer determining the source of the get operation.
* \param nelem The number of elements of type \c dtype to transfer.
* \param dtype The data type of the values in buffer \c dest.
* \param flags Flags controling the behavior of \c dart_get,
* see \ref dart_communication_flags_t.
*
* \return \c DART_OK on success, any other of \ref dart_ret_t otherwise.
*
Expand All @@ -343,7 +361,8 @@ dart_ret_t dart_get(
void * dest,
dart_gptr_t gptr,
size_t nelem,
dart_datatype_t dtype) DART_NOTHROW;
dart_datatype_t dtype,
int flags) DART_NOTHROW;

/**
* 'REGULAR' variant of dart_put.
Expand All @@ -352,6 +371,9 @@ dart_ret_t dart_get(
* is guaranteed. A later flush operation is needed to guarantee
* local and remote completion.
*
* However, a \ref dart_get or \ref dart_get_blocking following this put will
* be guaranteed to read the updated value.
*
* \param gptr A global pointer determining the target of the put operation.
* \param src The local source buffer to load the data from.
* \param nelem The number of elements of type \c dtype to transfer.
Expand All @@ -370,14 +392,16 @@ dart_ret_t dart_put(


/**
* Guarantee completion of all outstanding operations involving a segment on a certain unit
* Guarantee completion of all outstanding operations involving a segment on
* a certain unit.
*
* Guarantees local and remote completion of all pending puts and
* gets on a certain memory allocation / window / segment for the
* target unit specified in gptr.
* Similar to \c MPI_Win_flush().
*
* \param gptr Global pointer identifying the segment and unit to complete outstanding operations for.
* \param gptr Global pointer identifying the segment and unit to complete
* outstanding operations for.
* \return \c DART_OK on success, any other of \ref dart_ret_t otherwise.
*
* \threadsafe
Expand Down Expand Up @@ -463,7 +487,10 @@ typedef struct dart_handle_struct * dart_handle_t;
* \param gptr Global pointer being the source of the data transfer.
* \param nelem The number of elements of \c dtype in buffer \c dest.
* \param dtype The data type of the values in buffer \c dest.
* \param[out] handle Pointer to DART handle to instantiate for later use with \c dart_wait, \c dart_wait_all etc.
* \param flags Flags controling the behavior of \c dart_get_handle,
* see \ref dart_communication_flags_t.
* \param[out] handle Pointer to DART handle to instantiate for later use
* with \c dart_wait, \c dart_wait_all etc.
*
* \return \c DART_OK on success, any other of \ref dart_ret_t otherwise.
*
Expand All @@ -475,19 +502,24 @@ dart_ret_t dart_get_handle(
dart_gptr_t gptr,
size_t nelem,
dart_datatype_t dtype,
dart_handle_t * handle) DART_NOTHROW;
dart_handle_t * handle,
int flags) DART_NOTHROW;

/**
* 'HANDLE' variant of dart_put.
* Neither local nor remote completion is guaranteed. A later
* dart_wait*() call or a fence/flush operation is needed to guarantee
* completion.
*
* The update will not be visible in a following call to \ref dart_get variant
* unless the operation has been completed.
*
* \param gptr Global pointer being the target of the data transfer.
* \param src Local source memory to transfer data from.
* \param nelem The number of elements of type \c dtype to transfer.
* \param dtype The data type of the values in buffer \c dest.
* \param[out] handle Pointer to DART handle to instantiate for later use with \c dart_wait, \c dart_wait_all etc.
* \param[out] handle Pointer to DART handle to instantiate for later use with
* \c dart_wait, \c dart_wait_all etc.
*
* \return \c DART_OK on success, any other of \ref dart_ret_t otherwise.
*
Expand Down Expand Up @@ -606,6 +638,8 @@ dart_ret_t dart_testall_local(
* \param gptr Global pointer being the source of the data transfer.
* \param nelem The number of elements of type \c dtype to transfer.
* \param dtype The data type of the values in buffer \c dest.
* \param flags Flags controling the behavior of \c dart_get_blocking,
* see \ref dart_communication_flags_t.
*
* \return \c DART_OK on success, any other of \ref dart_ret_t otherwise.
*
Expand All @@ -616,7 +650,8 @@ dart_ret_t dart_get_blocking(
void * dest,
dart_gptr_t gptr,
size_t nelem,
dart_datatype_t dtype) DART_NOTHROW;
dart_datatype_t dtype,
int flags) DART_NOTHROW;

/**
* 'BLOCKING' variant of dart_put.
Expand Down
7 changes: 7 additions & 0 deletions dart-if/include/dash/dart/if/dart_globmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,13 @@ dart_ret_t dart_team_memalloc_aligned(
dart_datatype_t dtype,
dart_gptr_t * gptr) DART_NOTHROW;


dart_ret_t dart_team_memalloc_aligned_full(
dart_team_t teamid,
size_t nelem,
dart_datatype_t dtype,
dart_gptr_t * gptr) DART_NOTHROW;

/**
* Collective function to free global memory previously allocated
* using \ref dart_team_memalloc_aligned.
Expand Down
7 changes: 7 additions & 0 deletions dart-impl/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ set(ENABLE_PAPI ${ENABLE_PAPI}
PARENT_SCOPE)
set(ENABLE_HDF5 ${ENABLE_HDF5}
PARENT_SCOPE)
set(ENABLE_DART_PROGRESS ${ENABLE_DART_PROGRESS}
PARENT_SCOPE)

message(STATUS "MPI include path: " ${MPI_INCLUDE_PATH})
message(STATUS "MPI libraries:")
Expand Down Expand Up @@ -143,6 +145,11 @@ if (NOT ENABLE_SHARED_WINDOWS)
${ADDITIONAL_COMPILE_FLAGS} -DDART_MPI_DISABLE_SHARED_WINDOWS)
endif()

if (ENABLE_DART_PROGRESS)
set(ADDITIONAL_COMPILE_FLAGS
${ADDITIONAL_COMPILE_FLAGS} -DDART_ENABLE_PROGRESS)
endif()

if(MPI_COMPILE_FLAGS)
set (ADDITIONAL_COMPILE_FLAGS
${ADDITIONAL_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
Expand Down
3 changes: 0 additions & 3 deletions dart-impl/mpi/include/dash/dart/mpi/dart_globmem_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@

/* Global object for one-sided communication on memory region allocated with 'local allocation'. */
extern MPI_Win dart_win_local_alloc DART_INTERNAL;
#if !defined(DART_MPI_DISABLE_SHARED_WINDOWS)
extern MPI_Win dart_sharedmem_win_local_alloc DART_INTERNAL;
#endif

#endif /* DART__MPI__DART_GLOBMEM_PRIV_H__ */
86 changes: 79 additions & 7 deletions dart-impl/mpi/include/dash/dart/mpi/dart_segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#ifndef DART_SEGMENT_H_
#define DART_SEGMENT_H_
#include <mpi.h>
#include <stdbool.h>
#include <stdlib.h>

#include <dash/dart/if/dart_types.h>
#include <dash/dart/base/macro.h>
Expand All @@ -18,13 +20,16 @@ typedef int16_t dart_segid_t;

typedef struct
{
dart_segid_t segid; /* seg_id determines a global pointer uniquely */
size_t size;
MPI_Aint * disp; /* address set of memory location of all units in certain team. */
char ** baseptr;
char * selfbaseptr;
MPI_Win win;
uint16_t flags;
MPI_Aint * disp; /* offsets at all units in the team */
char ** baseptr; /* baseptr of all units in the sharedmem group */
char * selfbaseptr; /* baseptr of the current unit */
MPI_Win shmwin; /* sharedmem window */
MPI_Win win; /* window used to access this segment */
uint16_t flags; /* 16 bit flags */
dart_segid_t segid; /* ID of the segment, globally unique in a team */
bool dirty; /* whether the segment has pending writes */
bool isshm; /* whether this is a shared memory segment */
} dart_segment_info_t;

// forward declaration to make the compiler happy
Expand All @@ -50,10 +55,60 @@ typedef struct {
} dart_segmentdata_t;

typedef enum {
DART_SEGMENT_LOCAL_ALLOC,
DART_SEGMENT_ALLOC,
DART_SEGMENT_REGISTER
} dart_segment_type;

struct dart_seghash_elem {
dart_seghash_elem_t *next;
dart_segment_info_t data;
};

static inline int hash_segid(dart_segid_t segid)
{
/* Simply use the lower bits of the segment ID.
* Since segment IDs are allocated continuously, this is likely to cause
* collisions starting at (segment number == DART_SEGMENT_HASH_SIZE)
* TODO: come up with a random distribution to account for random free'd
* segments?
* */
return (abs(segid) % DART_SEGMENT_HASH_SIZE);
}

static inline
MPI_Aint
dart_segment_disp(dart_segment_info_t *seginfo, dart_team_unit_t team_unit_id)
{
return (seginfo->disp != NULL) ? seginfo->disp[team_unit_id.id] : 0;
}

/**
* Returns the segment info for the segment with ID \c segid.
*/
static inline dart_segment_info_t * dart_segment_get_info(
dart_segmentdata_t *segdata,
dart_segid_t segid)
{
int slot = hash_segid(segid);
dart_seghash_elem_t *elem = segdata->hashtab[slot];

while (elem != NULL) {
if (elem->data.segid == segid) {
break;
}
elem = elem->next;
}

// if (elem == NULL) {
// DART_LOG_ERROR("dart_segment__get_segment : "
// "Invalid segment ID %i on team %i",
// segid, segdata->team_id);
// return NULL;
// }

return &(elem->data);
}

/**
* Initialize the segment data hash table.
Expand All @@ -80,6 +135,13 @@ dart_segment_register(
dart_segmentdata_t *segdata,
dart_segment_info_t *seg) DART_INTERNAL;

/**
* Returns the segment info for the segment with ID \c segid.
*/
//dart_segment_info_t * dart_segment_get_info(
// dart_segmentdata_t *segdata,
// dart_segid_t segid) DART_INTERNAL;


#if !defined(DART_MPI_DISABLE_SHARED_WINDOWS)

Expand All @@ -92,7 +154,7 @@ dart_segment_register(
* \retval non-negative integer Search successfully.
* \retval negative integer Failure.
*/
dart_ret_t dart_segment_get_win(
dart_ret_t dart_segment_get_shmwin(
dart_segmentdata_t * segdata,
int16_t seg_id,
MPI_Win * win) DART_INTERNAL;
Expand All @@ -104,6 +166,16 @@ dart_ret_t dart_segment_get_baseptr(
char ** baseptr_s) DART_INTERNAL;
#endif

dart_ret_t dart_segment_get_dirty(
dart_segmentdata_t * segdata,
int16_t segid,
bool * dirty) DART_INTERNAL;

dart_ret_t dart_segment_set_dirty(
dart_segmentdata_t * segdata,
int16_t segid,
bool dirty) DART_INTERNAL;

dart_ret_t dart_segment_get_selfbaseptr(
dart_segmentdata_t * segdata,
int16_t seg_id,
Expand Down
5 changes: 0 additions & 5 deletions dart-impl/mpi/include/dash/dart/mpi/dart_team_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ typedef struct dart_team_data {

} dart_team_data_t;


#if !defined(DART_MPI_DISABLE_SHARED_WINDOWS)

extern char* *dart_sharedmem_local_baseptr_set DART_INTERNAL;
#endif
/* @brief Initiate the free-team-list and allocated-team-list.
*
* This call will be invoked within dart_init(), and the free teamlist consist of
Expand Down
Loading