Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 17 additions & 17 deletions dart-impl/mpi/src/dart_communication.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ dart_ret_t dart_get(
dart_segment_info_t *seginfo = dart_segment_get_info(
&(team_data->segdata), seg_id);
if (dart__unlikely(seginfo == NULL)) {
DART_LOG_ERROR("dart_get_blocking ! "
DART_LOG_ERROR("dart_get ! "
"Unknown segment %i on team %i", seg_id, teamid);
return DART_ERR_INVAL;
}
Expand All @@ -199,7 +199,7 @@ dart_ret_t dart_get(
// use direct memcpy if we are on the same unit
memcpy(dest, seginfo->selfbaseptr + offset,
nelem * dart__mpi__datatype_sizeof(dtype));
DART_LOG_DEBUG("dart_get_blocking: memcpy nelem:%zu "
DART_LOG_DEBUG("dart_get: memcpy nelem:%zu "
"source (coll.): offset:%lu -> dest: %p",
nelem, offset, dest);
return DART_OK;
Expand Down Expand Up @@ -286,7 +286,7 @@ dart_ret_t dart_put(
dart_segment_info_t *seginfo = dart_segment_get_info(
&(team_data->segdata), seg_id);
if (dart__unlikely(seginfo == NULL)) {
DART_LOG_ERROR("dart_get_blocking ! "
DART_LOG_ERROR("dart_put ! "
"Unknown segment %i on team %i", seg_id, teamid);
return DART_ERR_INVAL;
}
Expand All @@ -307,7 +307,7 @@ dart_ret_t dart_put(
team_unit_id, nelem, dtype);
}
#else
DART_LOG_DEBUG("dart_get_blocking: shared windows disabled");
DART_LOG_DEBUG("dart_put: shared windows disabled");
#endif /* !defined(DART_MPI_DISABLE_SHARED_WINDOWS) */

// source on another node or shared memory windows disabled
Expand Down Expand Up @@ -384,7 +384,7 @@ dart_ret_t dart_accumulate(
dart_segment_info_t *seginfo = dart_segment_get_info(
&(team_data->segdata), seg_id);
if (dart__unlikely(seginfo == NULL)) {
DART_LOG_ERROR("dart_get_blocking ! "
DART_LOG_ERROR("dart_accumulate ! "
"Unknown segment %i on team %i", seg_id, teamid);
return DART_ERR_INVAL;
}
Expand Down Expand Up @@ -528,7 +528,7 @@ dart_ret_t dart_compare_and_swap(
dart_segment_info_t *seginfo = dart_segment_get_info(
&(team_data->segdata), seg_id);
if (dart__unlikely(seginfo == NULL)) {
DART_LOG_ERROR("dart_get_blocking ! "
DART_LOG_ERROR("dart_compare_and_swap ! "
"Unknown segment %i on team %i", seg_id, teamid);
return DART_ERR_INVAL;
}
Expand Down Expand Up @@ -578,7 +578,7 @@ dart_ret_t dart_get_handle(
dart_segment_info_t *seginfo = dart_segment_get_info(
&(team_data->segdata), seg_id);
if (dart__unlikely(seginfo == NULL)) {
DART_LOG_ERROR("dart_get_blocking ! "
DART_LOG_ERROR("dart_get_handle ! "
"Unknown segment %i on team %i", seg_id, teamid);
return DART_ERR_INVAL;
}
Expand Down Expand Up @@ -619,7 +619,7 @@ dart_ret_t dart_get_handle(
handle->needs_flush = false;

if (nchunks > 0) {
DART_LOG_TRACE("dart_get_blocking: MPI_Rget (dest %p, size %zu)",
DART_LOG_TRACE("dart_get_handle: MPI_Rget (dest %p, size %zu)",
dest_ptr, nchunks * MAX_CONTIG_ELEMENTS);
if (MPI_Rget(dest_ptr,
nchunks,
Expand All @@ -631,7 +631,7 @@ dart_ret_t dart_get_handle(
win,
&handle->reqs[handle->num_reqs++]) != MPI_SUCCESS) {
free(handle);
DART_LOG_ERROR("dart_get_blocking ! MPI_Rget failed");
DART_LOG_ERROR("dart_get_handle ! MPI_Rget failed");
return DART_ERR_INVAL;
}
offset += nchunks * MAX_CONTIG_ELEMENTS;
Expand All @@ -641,7 +641,7 @@ dart_ret_t dart_get_handle(
if (remainder > 0) {
MPI_Datatype mpi_dtype = dart__mpi__datatype(dtype);
DART_LOG_TRACE(
"dart_get_blocking: MPI_Rget (dest %p, size %zu)", dest_ptr, remainder);
"dart_get_handle: MPI_Rget (dest %p, size %zu)", dest_ptr, remainder);
if (MPI_Rget(dest_ptr,
remainder,
mpi_dtype,
Expand All @@ -652,7 +652,7 @@ dart_ret_t dart_get_handle(
win,
&handle->reqs[handle->num_reqs++]) != MPI_SUCCESS) {
free(handle);
DART_LOG_ERROR("dart_get_blocking ! MPI_Rget failed");
DART_LOG_ERROR("dart_get_handle ! MPI_Rget failed");
return DART_ERR_INVAL;
}
}
Expand Down Expand Up @@ -690,7 +690,7 @@ dart_ret_t dart_put_handle(
dart_segment_info_t *seginfo = dart_segment_get_info(
&(team_data->segdata), seg_id);
if (dart__unlikely(seginfo == NULL)) {
DART_LOG_ERROR("dart_get_blocking ! "
DART_LOG_ERROR("dart_put_handle ! "
"Unknown segment %i on team %i", seg_id, teamid);
return DART_ERR_INVAL;
}
Expand Down Expand Up @@ -741,7 +741,7 @@ dart_ret_t dart_put_handle(
win,
&handle->reqs[handle->num_reqs++]) != MPI_SUCCESS) {
free(handle);
DART_LOG_ERROR("dart_get ! MPI_Put failed");
DART_LOG_ERROR("dart_put_handle ! MPI_Put failed");
return DART_ERR_INVAL;
}
}
Expand Down Expand Up @@ -779,7 +779,7 @@ dart_ret_t dart_put_blocking(
dart_segment_info_t *seginfo = dart_segment_get_info(
&(team_data->segdata), seg_id);
if (dart__unlikely(seginfo == NULL)) {
DART_LOG_ERROR("dart_get_blocking ! "
DART_LOG_ERROR("dart_put_blocking ! "
"Unknown segment %i on team %i", seg_id, teamid);
return DART_ERR_INVAL;
}
Expand All @@ -792,7 +792,7 @@ dart_ret_t dart_put_blocking(
if (team_unit_id.id == team_data->unitid) {
memcpy(seginfo->selfbaseptr + offset, src,
nelem * dart__mpi__datatype_sizeof(dtype));
DART_LOG_DEBUG("dart_put: memcpy nelem:%zu (from global allocation)"
DART_LOG_DEBUG("dart_put_blocking: memcpy nelem:%zu (from global allocation)"
"offset: %"PRIu64"", nelem, offset);
return DART_OK;
}
Expand All @@ -804,7 +804,7 @@ dart_ret_t dart_put_blocking(
team_unit_id, nelem, dtype);
}
#else
DART_LOG_DEBUG("dart_get_blocking: shared windows disabled");
DART_LOG_DEBUG("dart_put_blocking: shared windows disabled");
#endif /* !defined(DART_MPI_DISABLE_SHARED_WINDOWS) */

MPI_Win win = seginfo->win;
Expand Down Expand Up @@ -929,7 +929,7 @@ dart_ret_t dart_get_blocking(
const size_t nchunks = nelem / MAX_CONTIG_ELEMENTS;
const size_t remainder = nelem % MAX_CONTIG_ELEMENTS;
char * dest_ptr = (char*) dest;
MPI_Request reqs[2];
MPI_Request reqs[2] = {MPI_REQUEST_NULL, MPI_REQUEST_NULL};
int nreqs = 0;

if (nchunks > 0) {
Expand Down
74 changes: 34 additions & 40 deletions dash/include/dash/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,40 +384,33 @@ class AsyncArrayRef
_array->m_globmem->flush();
}

inline void flush_local() const {
// could also call _array->flush_local();
_array->m_globmem->flush_local();
}

inline void flush_all() const {
/**
* Complete all outstanding asynchronous operations on the referenced array
* to the specified unit.
*/
inline void flush(dash::team_unit_t target) const {
// could also call _array->flush();
_array->m_globmem->flush_all();
}

inline void flush_local_all() const {
// could also call _array->flush_local_all();
_array->m_globmem->flush_local_all();
_array->m_globmem->flush(target);
}

/**
* Block until all locally invoked operations on global memory have been
* communicated.
*
* \see DashAsyncProxyConcept
* Locally complete all outstanding asynchronous operations on the referenced array
* on all units.
*/
inline void push() const {
_array->m_globmem->flush_local_all();
inline void flush_local() const {
// could also call _array->flush_local();
_array->m_globmem->flush_local();
}

/**
* Block until all remote operations on this unit's local memory have been
* completed.
*
* \see DashAsyncProxyConcept
* Locally complete all outstanding asynchronous operations on the referenced array
* to the specified unit.
*/
inline void fetch() const {
_array->m_globmem->flush_all();
inline void flush_local(dash::team_unit_t target) const {
// could also call _array->flush_local();
_array->m_globmem->flush_local(target);
}

};

#endif // DOXYGEN
Expand Down Expand Up @@ -894,7 +887,7 @@ class Array
* \code
* dash::Array<int> a1(1024 * dash::size());
* dash::fill(a1.begin(), a1.end(), 123);
*
*
* // create copy of array a1:
* dash::Array<int> a2(a1.size());
* dash::copy(a1.begin(), a1.end(), a2.begin());
Expand Down Expand Up @@ -923,7 +916,7 @@ class Array
* \code
* dash::Array<int> a1(1024 * dash::size());
* dash::fill(a1.begin(), a1.end(), 123);
*
*
* // create copy of array a1:
* dash::Array<int> a2(a1.size());
* dash::copy(a1.begin(), a1.end(), a2.begin());
Expand Down Expand Up @@ -1193,7 +1186,7 @@ class Array
{
DASH_LOG_TRACE_VAR("Array.barrier()", m_team);
if (nullptr != m_globmem) {
m_globmem->flush_all();
m_globmem->flush();
}
if (nullptr != m_team && *m_team != dash::Team::Null()) {
m_team->barrier();
Expand All @@ -1202,35 +1195,36 @@ class Array
}

/**
* Complete all outstanding non-blocking operations executed by all units
* Complete all outstanding non-blocking operations to all units
* on the array's underlying global memory.
*/
inline void flush() const {
m_globmem->flush();
}

/**
* Complete all outstanding non-blocking operations executed by the
* local unit on the array's underlying global memory.
* Complete all outstanding non-blocking operations to the specified unit
* on the array's underlying global memory.
*/
inline void flush_local() const {
m_globmem->flush_local();
inline void flush(dash::team_unit_t target) const {
m_globmem->flush(target);
}

/**
* Complete all outstanding non-blocking operations executed by all units
* on the array's underlying global memory.
* Locally complete all outstanding non-blocking operations to all units on
* the array's underlying global memory.
*/
inline void flush_all() const {
m_globmem->flush_all();
inline void flush_local() const {
m_globmem->flush_local();
}


/**
* Complete all outstanding non-blocking operations executed by the
* local unit on the array's underlying global memory.
* Locally complete all outstanding non-blocking operations to the
* specified unit on the array's underlying global memory.
*/
inline void flush_local_all() const {
m_globmem->flush_local_all();
inline void flush_local(dash::team_unit_t target) const {
m_globmem->flush_local(target);
}

/**
Expand Down
Loading