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

Feat halo #719

Open
wants to merge 10 commits into
base: development
Choose a base branch
from
4 changes: 2 additions & 2 deletions dart-impl/base/include/dash/dart/base/logging.h
Original file line number Diff line number Diff line change
@@ -31,9 +31,9 @@ enum dart__base__term_color_code {
extern "C" {
#endif

const int dart__base__term_colors[DART_LOG_TCOL_NUM_CODES];
extern const int dart__base__term_colors[DART_LOG_TCOL_NUM_CODES];

const int dart__base__unit_term_colors[DART_LOG_TCOL_NUM_CODES-1];
extern const int dart__base__unit_term_colors[DART_LOG_TCOL_NUM_CODES-1];

#ifdef __cplusplus
} /* extern "C" */
Original file line number Diff line number Diff line change
@@ -75,8 +75,6 @@ dart_ret_t dart__mpi__op_fini();
*/
#define MAX_CONTIG_ELEMENTS (INT_MAX)

#define DART_MPI_TYPE_UNDEFINED (MPI_Datatype)MPI_UNDEFINED

typedef enum {
DART_KIND_BASIC = 0,
DART_KIND_STRIDED,
@@ -190,7 +188,7 @@ MPI_Datatype dart__mpi__datatype_maxtype(dart_datatype_t dart_type) {
dart_datatype_struct_t *dts = dart__mpi__datatype_struct(dart_type);
MPI_Datatype res;
if (dart__mpi__datatype_iscontiguous(dart_type)) {
if (dts->contiguous.max_type == DART_MPI_TYPE_UNDEFINED) {
if (dts->contiguous.max_type == MPI_DATATYPE_NULL) {
dts->contiguous.max_type = dart__mpi__datatype_create_max_datatype(
dts->contiguous.mpi_type);
}
4 changes: 2 additions & 2 deletions dart-impl/mpi/src/dart_communication.c
Original file line number Diff line number Diff line change
@@ -391,11 +391,11 @@ dart__mpi__put_basic(
CHECK_MPI_RET(
dart__mpi__put(src_ptr,
nchunks,
dart__mpi__datatype_struct(dtype)->contiguous.max_type,
dart__mpi__datatype_maxtype(dtype),
team_unit_id.id,
offset,
nchunks,
dart__mpi__datatype_struct(dtype)->contiguous.max_type,
dart__mpi__datatype_maxtype(dtype),
win,
reqs, num_reqs),
"MPI_Put");
7 changes: 4 additions & 3 deletions dart-impl/mpi/src/dart_mpi_types.c
Original file line number Diff line number Diff line change
@@ -312,7 +312,7 @@ dart_type_create_custom(
new_struct->contiguous.size = num_bytes;
new_struct->contiguous.mpi_type = new_mpi_dtype;
// max_type will be created on-demand for custom types
new_struct->contiguous.max_type = DART_MPI_TYPE_UNDEFINED;
new_struct->contiguous.max_type = MPI_DATATYPE_NULL;

*newtype = (dart_datatype_t)new_struct;
DART_LOG_TRACE("Created new custom data type %p with %zu bytes`",
@@ -343,7 +343,7 @@ dart_type_destroy(dart_datatype_t *dart_type_ptr)
MPI_Type_free(&dart_type->indexed.mpi_type);
} else if (dart_type->kind == DART_KIND_CUSTOM) {
MPI_Type_free(&dart_type->contiguous.mpi_type);
if (dart_type->contiguous.max_type != DART_MPI_TYPE_UNDEFINED) {
if (dart_type->contiguous.max_type != MPI_DATATYPE_NULL) {
MPI_Type_free(&dart_type->contiguous.max_type);
}
}
@@ -357,7 +357,8 @@ dart_type_destroy(dart_datatype_t *dart_type_ptr)
static void destroy_basic_type(dart_datatype_t dart_type_id)
{
dart_datatype_struct_t *dart_type = dart__mpi__datatype_struct(dart_type_id);
MPI_Type_free(&dart_type->contiguous.max_type);
if (dart_type->contiguous.max_type != MPI_DATATYPE_NULL)
MPI_Type_free(&dart_type->contiguous.max_type);
dart_type->contiguous.max_type = MPI_DATATYPE_NULL;
}

9 changes: 9 additions & 0 deletions dash/include/dash/GlobPtr.h
Original file line number Diff line number Diff line change
@@ -121,6 +121,15 @@ class GlobPtr {
*/
self_t &operator=(const self_t &rhs) = default;

/**
* nullptr assignment operator.
*/
self_t &operator=(std::nullptr_t) {
m_dart_pointer = DART_GPTR_NULL;

return *this;
}

//clang-format off
/**
* Implicit Converting Constructor, only allowed if one of the following