DASH  0.3.0
dart_types.h File Reference
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
Include dependency graph for dart_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dart_global_unit
 Data type for storing a global unit ID. More...
 
struct  dart_local_unit
 Data type for storing a unit ID relative to a team. More...
 
struct  dart_locality_scope_pos_t
 
struct  dart_hwinfo_t
 Hardware locality information for a single locality domain. More...
 
struct  dart_module_location_t
 
struct  dart_domain_locality_s
 A domain is a group of processing entities such as cores in a specific NUMA domain or a Intel MIC entity. More...
 
struct  dart_unit_locality_t
 Locality and topology information of a single unit. More...
 
struct  dart_config_t
 

Macros

#define DART_OP_MINMAX_MIN   0
 Position of the minimum element in MINMAX tuple. More...
 
#define DART_OP_MINMAX_MAX   1
 Position of the maximum element in MINMAX tuple. More...
 
#define DART_TYPE_UNDEFINED   (dart_datatype_t)(0)
 
#define DART_TYPE_BYTE   (dart_datatype_t)(1)
 integral data types More...
 
#define DART_TYPE_SHORT   (dart_datatype_t)(2)
 
#define DART_TYPE_INT   (dart_datatype_t)(3)
 
#define DART_TYPE_UINT   (dart_datatype_t)(4)
 
#define DART_TYPE_LONG   (dart_datatype_t)(5)
 
#define DART_TYPE_ULONG   (dart_datatype_t)(6)
 
#define DART_TYPE_LONGLONG   (dart_datatype_t)(7)
 
#define DART_TYPE_ULONGLONG   (dart_datatype_t)(8)
 
#define DART_TYPE_FLOAT   (dart_datatype_t)(9)
 floating point data types More...
 
#define DART_TYPE_DOUBLE   (dart_datatype_t)(10)
 
#define DART_TYPE_LONG_DOUBLE   (dart_datatype_t)(11)
 
#define DART_TYPE_LAST   (dart_datatype_t)(12)
 Reserved, do not use! More...
 
#define DART_TYPE_SIZET   DART_TYPE_ULONG
 size for integral size_t More...
 
#define DART_UNDEFINED_UNIT_ID   ((dart_unit_t)(-1))
 Undefined unit ID. More...
 
#define DART_TEAM_UNIT_ID(__u)   (dart_create_team_unit(__u))
 Create a dart_team_unit_t from a dart_unit_t. More...
 
#define DART_GLOBAL_UNIT_ID(__u)   (dart_create_global_unit(__u))
 Create a dart_global_unit_t from a dart_unit_t. More...
 
#define DART_UNDEFINED_TEAM_UNIT_ID   DART_TEAM_UNIT_ID(DART_UNDEFINED_UNIT_ID)
 A dart_team_unit_t representing an undefined team-relative unit. More...
 
#define DART_UNDEFINED_GLOBAL_UNIT_ID   DART_GLOBAL_UNIT_ID(DART_UNDEFINED_UNIT_ID)
 A dart_global_unit_t representing an undefined global unit. More...
 
#define DART_UNDEFINED_TEAM_ID   ((dart_team_t)(-1))
 Undefined team ID. More...
 
#define DART_LOCALITY_HOST_MAX_SIZE   ((int)(256))
 Maximum size of a host name string in dart_hwinfo_t. More...
 
#define DART_LOCALITY_DOMAIN_TAG_MAX_SIZE   ((int)(32))
 Maximum size of a domain tag string in dart_hwinfo_t. More...
 
#define DART_LOCALITY_MAX_DOMAIN_SCOPES   ((int)(12))
 Maximum number of domain scopes in dart_hwinfo_t. More...
 
#define DART_LOCALITY_UNIT_MAX_CPUS   ((int)(64))
 Maximum size of a domain tag string in dart_hwinfo_t. More...
 
#define DART_LOCALITY_MAX_NUMA_ID   ((int)(16))
 Maximum number of NUMA domains supported. More...
 
#define DART_LOCALITY_MAX_CACHE_LEVELS   ((int)( 5))
 Maximum number of cache levels supported in dart_hwinfo_t. More...
 

Typedefs

typedef uintptr_t dart_operation_t
 
typedef intptr_t dart_datatype_t
 Raw data types supported by the DART interface. More...
 
typedef int32_t dart_unit_t
 Data type for storing a unit ID. More...
 
typedef struct dart_global_unit dart_global_unit_t
 Data type for storing a global unit ID. More...
 
typedef struct dart_local_unit dart_team_unit_t
 Data type for storing a unit ID relative to a team. More...
 
typedef int16_t dart_team_t
 Data type for storing a team ID. More...
 
typedef struct dart_domain_locality_s dart_domain_locality_t
 
typedef void(* dart_operator_t) (const void *invec, void *inoutvec, size_t len, void *user_data)
 The operator called from a reduction operation. More...
 

Enumerations

enum  dart_ret_t {
  DART_OK = 0, DART_PENDING = 1, DART_ERR_INVAL = 2, DART_ERR_NOTFOUND = 3,
  DART_ERR_NOTINIT = 4, DART_ERR_NOMEM = 5, DART_ERR_OTHER = 999
}
 Return values of functions in the DART interface. More...
 
enum  { DART_EXIT_SUCCESS = EXIT_SUCCESS, DART_EXIT_ABORT = EXIT_FAILURE, DART_EXIT_ASSERT = -6 }
 Return values of DART applications. More...
 
enum  {
  DART_OP_UNDEFINED = 0, DART_OP_MIN, DART_OP_MAX, DART_OP_MINMAX,
  DART_OP_SUM, DART_OP_PROD, DART_OP_BAND, DART_OP_LAND,
  DART_OP_BOR, DART_OP_LOR, DART_OP_BXOR, DART_OP_LXOR,
  DART_OP_REPLACE, DART_OP_NO_OP, DART_OP_LAST
}
 Operations to be used for certain RMA and collective operations. More...
 
enum  dart_thread_support_level_t { DART_THREAD_SINGLE = 0, DART_THREAD_MULTIPLE = 10 }
 Levels of thread-support offered by DART. More...
 
enum  dart_locality_scope_t {
  DART_LOCALITY_SCOPE_UNDEFINED = -1, DART_LOCALITY_SCOPE_GLOBAL = 0, DART_LOCALITY_SCOPE_GROUP = 1, DART_LOCALITY_SCOPE_NETWORK = 50,
  DART_LOCALITY_SCOPE_NODE = 100, DART_LOCALITY_SCOPE_MODULE = 200, DART_LOCALITY_SCOPE_NUMA = 300, DART_LOCALITY_SCOPE_UNIT = 400,
  DART_LOCALITY_SCOPE_PACKAGE = 500, DART_LOCALITY_SCOPE_UNCORE = 510, DART_LOCALITY_SCOPE_CACHE = 530, DART_LOCALITY_SCOPE_CORE = 550,
  DART_LOCALITY_SCOPE_CPU = 600
}
 Scopes of locality domains. More...
 

Functions

static dart_team_unit_t dart_create_team_unit (dart_unit_t unit)
 Create a dart_team_unit_t from a dart_unit_t. More...
 
static dart_global_unit_t dart_create_global_unit (dart_unit_t unit)
 Create a dart_global_unit_t from a dart_unit_t. More...
 
dart_ret_t dart_type_create_strided (dart_datatype_t basetype, size_t stride, size_t blocklen, dart_datatype_t *newtype)
 Create a strided data type using blocks of size blocklen and a stride of stride. More...
 
dart_ret_t dart_type_create_indexed (dart_datatype_t basetype, size_t count, const size_t blocklen[], const size_t offset[], dart_datatype_t *newtype)
 Create an indexed data type using count blocks of size blocklen[i] with offsets offset[i] for each 0 <= i < count. More...
 
dart_ret_t dart_type_create_custom (size_t num_bytes, dart_datatype_t *newtype)
 Create a custom data type of size num_bytes bytes. More...
 
dart_ret_t dart_type_destroy (dart_datatype_t *dart_type)
 Destroy a data type that was previously created using dart_type_create_strided or dart_type_create_indexed. More...
 
dart_ret_t dart_op_create (dart_operator_t op, void *userdata, bool commute, dart_datatype_t dtype, bool dtype_is_tmp, dart_operation_t *new_op)
 Create a new operation new_op that can be used in collective reduction operations, i.e., dart_reduce, dart_allreduce. More...
 
dart_ret_t dart_op_destroy (dart_operation_t *op)
 Destroy a operation object created through dart_op_create and set op to DART_OP_UNDEFINED. More...
 

Macro Definition Documentation

◆ DART_LOCALITY_DOMAIN_TAG_MAX_SIZE

#define DART_LOCALITY_DOMAIN_TAG_MAX_SIZE   ((int)(32))

Maximum size of a domain tag string in dart_hwinfo_t.

Definition at line 339 of file dart_types.h.

◆ DART_LOCALITY_HOST_MAX_SIZE

#define DART_LOCALITY_HOST_MAX_SIZE   ((int)(256))

Maximum size of a host name string in dart_hwinfo_t.

Definition at line 336 of file dart_types.h.

◆ DART_LOCALITY_MAX_CACHE_LEVELS

#define DART_LOCALITY_MAX_CACHE_LEVELS   ((int)( 5))

Maximum number of cache levels supported in dart_hwinfo_t.

Definition at line 348 of file dart_types.h.

◆ DART_LOCALITY_MAX_DOMAIN_SCOPES

#define DART_LOCALITY_MAX_DOMAIN_SCOPES   ((int)(12))

Maximum number of domain scopes in dart_hwinfo_t.

Definition at line 341 of file dart_types.h.

◆ DART_LOCALITY_MAX_NUMA_ID

#define DART_LOCALITY_MAX_NUMA_ID   ((int)(16))

Maximum number of NUMA domains supported.

Definition at line 346 of file dart_types.h.

◆ DART_LOCALITY_UNIT_MAX_CPUS

#define DART_LOCALITY_UNIT_MAX_CPUS   ((int)(64))

Maximum size of a domain tag string in dart_hwinfo_t.

Todo:
Unused?

Definition at line 344 of file dart_types.h.

◆ DART_TYPE_BYTE

#define DART_TYPE_BYTE   (dart_datatype_t)(1)

integral data types

Definition at line 125 of file dart_types.h.

Referenced by dash::equal(), dash::min_element(), and dash::coarray::sync_images().

◆ DART_TYPE_FLOAT

#define DART_TYPE_FLOAT   (dart_datatype_t)(9)

floating point data types

Definition at line 134 of file dart_types.h.

◆ DART_TYPE_LAST

#define DART_TYPE_LAST   (dart_datatype_t)(12)

Reserved, do not use!

Definition at line 138 of file dart_types.h.

◆ DART_TYPE_SIZET

#define DART_TYPE_SIZET   DART_TYPE_ULONG

size for integral size_t

Definition at line 143 of file dart_types.h.

Typedef Documentation

◆ dart_operator_t

typedef void(* dart_operator_t) (const void *invec, void *inoutvec, size_t len, void *user_data)

The operator called from a reduction operation.

The operator should apply the intended operation to each of the len elements in invec and inoutvec and store the result in inoutvec, i.e., inoutvec[i] = invec[i] o inoutvec[i], i = 0,...,len-1 The parameter userdata is the pointer passed to dart_op_create. The memory pointed to by is managed by the caller.

Definition at line 782 of file dart_types.h.

Enumeration Type Documentation

◆ dart_thread_support_level_t

Levels of thread-support offered by DART.

DART_THREAD_MULTIPLE is supported if DART has been build with DART_ENABLE_THREADSUPPORT and the underlying communication backend supports thread-safe access.

Enumerator
DART_THREAD_SINGLE 

No support for thread-based concurrency in DART is provided.

DART_THREAD_MULTIPLE 

Support for thread-based concurrency is provided by DART and the underlying runtime.

Definition at line 269 of file dart_types.h.

270 {
272  DART_THREAD_SINGLE = 0,
dart_thread_support_level_t
Levels of thread-support offered by DART.
Definition: dart_types.h:269
No support for thread-based concurrency in DART is provided.
Definition: dart_types.h:272
Support for thread-based concurrency is provided by DART and the underlying runtime.
Definition: dart_types.h:277

Function Documentation

◆ dart_op_create()

dart_ret_t dart_op_create ( dart_operator_t  op,
void *  userdata,
bool  commute,
dart_datatype_t  dtype,
bool  dtype_is_tmp,
dart_operation_t *  new_op 
)

Create a new operation new_op that can be used in collective reduction operations, i.e., dart_reduce, dart_allreduce.

Parameters
opThe operator to invoke.
userdataA pointer to user-defined data that is passed to each invocation of op.
commuteWhether or not the operation is commutative.
dtypeThe datatype op operates on. Only contiguous data types can be used (basic, custom).
dtype_is_tmpSignal that the dtype is a temporary DART type that is only used in the context of the newly created operation. This may allow for additional optimizations.
[out]new_opPointer to the new operation.
See also
dart_op_destroy
dart_operator_t

◆ dart_op_destroy()

dart_ret_t dart_op_destroy ( dart_operation_t *  op)

Destroy a operation object created through dart_op_create and set op to DART_OP_UNDEFINED.