ARGOBOTS  1.1
Macros
abti_error.h File Reference
#include <assert.h>
#include <abt_config.h>
Include dependency graph for abti_error.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ABTI_ASSERT(cond)
 
#define ABTI_STATIC_ASSERT(cond)
 
#define ABTI_IS_PRINT_ABT_ERRNO_ENABLED   0
 
#define HANDLE_WARNING(msg)
 
#define HANDLE_ERROR(msg)
 
#define HANDLE_ERROR_WITH_CODE(msg, n)
 
#define HANDLE_ERROR_FUNC_WITH_CODE(n)
 
#define ABTI_SETUP_GLOBAL(pp_global)
 
#define ABTI_SETUP_LOCAL_XSTREAM(pp_local_xstream)
 
#define ABTI_SETUP_LOCAL_YTHREAD(pp_local_xstream, pp_ythread)
 
#define ABTI_HANDLE_ERROR(n)
 
#define ABTI_CHECK_ERROR(abt_errno)
 
#define ABTI_CHECK_TRUE(cond, abt_errno)
 
#define ABTI_CHECK_YIELDABLE(p_thread, pp_ythread, abt_errno)
 
#define ABTI_CHECK_TRUE_MSG(cond, abt_errno, msg)
 
#define ABTI_CHECK_NULL_XSTREAM_PTR(p)
 
#define ABTI_CHECK_NULL_POOL_PTR(p)
 
#define ABTI_CHECK_NULL_SCHED_PTR(p)
 
#define ABTI_CHECK_NULL_SCHED_CONFIG_PTR(p)
 
#define ABTI_CHECK_NULL_THREAD_PTR(p)
 
#define ABTI_CHECK_NULL_YTHREAD_PTR(p)
 
#define ABTI_CHECK_NULL_THREAD_ATTR_PTR(p)
 
#define ABTI_CHECK_NULL_TASK_PTR(p)
 
#define ABTI_CHECK_NULL_KEY_PTR(p)
 
#define ABTI_CHECK_NULL_MUTEX_PTR(p)
 
#define ABTI_CHECK_NULL_MUTEX_ATTR_PTR(p)
 
#define ABTI_CHECK_NULL_COND_PTR(p)
 
#define ABTI_CHECK_NULL_RWLOCK_PTR(p)
 
#define ABTI_CHECK_NULL_FUTURE_PTR(p)
 
#define ABTI_CHECK_NULL_EVENTUAL_PTR(p)
 
#define ABTI_CHECK_NULL_BARRIER_PTR(p)
 
#define ABTI_CHECK_NULL_XSTREAM_BARRIER_PTR(p)
 
#define ABTI_CHECK_NULL_TIMER_PTR(p)
 
#define ABTI_CHECK_NULL_TOOL_CONTEXT_PTR(p)
 

Macro Definition Documentation

◆ ABTI_ASSERT

#define ABTI_ASSERT (   cond)
Value:
do { \
assert(cond); \
} \
} while (0)

Definition at line 12 of file abti_error.h.

◆ ABTI_CHECK_ERROR

#define ABTI_CHECK_ERROR (   abt_errno)
Value:
do { \
int abt_errno_ = (abt_errno); \
ABTU_unlikely(abt_errno_ != ABT_SUCCESS)) { \
HANDLE_ERROR_FUNC_WITH_CODE(abt_errno_); \
return abt_errno_; \
} \
} while (0)

Definition at line 120 of file abti_error.h.

◆ ABTI_CHECK_NULL_BARRIER_PTR

#define ABTI_CHECK_NULL_BARRIER_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_barrier *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_BARRIER); \
} \
} while (0)

Definition at line 294 of file abti_error.h.

◆ ABTI_CHECK_NULL_COND_PTR

#define ABTI_CHECK_NULL_COND_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_cond *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_COND); \
return ABT_ERR_INV_COND; \
} \
} while (0)

Definition at line 258 of file abti_error.h.

◆ ABTI_CHECK_NULL_EVENTUAL_PTR

#define ABTI_CHECK_NULL_EVENTUAL_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_eventual *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_EVENTUAL); \
} \
} while (0)

Definition at line 285 of file abti_error.h.

◆ ABTI_CHECK_NULL_FUTURE_PTR

#define ABTI_CHECK_NULL_FUTURE_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_future *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_FUTURE); \
} \
} while (0)

Definition at line 276 of file abti_error.h.

◆ ABTI_CHECK_NULL_KEY_PTR

#define ABTI_CHECK_NULL_KEY_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_key *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_KEY); \
return ABT_ERR_INV_KEY; \
} \
} while (0)

Definition at line 231 of file abti_error.h.

◆ ABTI_CHECK_NULL_MUTEX_ATTR_PTR

#define ABTI_CHECK_NULL_MUTEX_ATTR_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_mutex_attr *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_MUTEX_ATTR); \
} \
} while (0)

Definition at line 249 of file abti_error.h.

◆ ABTI_CHECK_NULL_MUTEX_PTR

#define ABTI_CHECK_NULL_MUTEX_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_mutex *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_MUTEX); \
} \
} while (0)

Definition at line 240 of file abti_error.h.

◆ ABTI_CHECK_NULL_POOL_PTR

#define ABTI_CHECK_NULL_POOL_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_pool *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_POOL); \
return ABT_ERR_INV_POOL; \
} \
} while (0)

Definition at line 168 of file abti_error.h.

◆ ABTI_CHECK_NULL_RWLOCK_PTR

#define ABTI_CHECK_NULL_RWLOCK_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_rwlock *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_RWLOCK); \
} \
} while (0)

Definition at line 267 of file abti_error.h.

◆ ABTI_CHECK_NULL_SCHED_CONFIG_PTR

#define ABTI_CHECK_NULL_SCHED_CONFIG_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_sched_config *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_SCHED_CONFIG); \
} \
} while (0)

Definition at line 186 of file abti_error.h.

◆ ABTI_CHECK_NULL_SCHED_PTR

#define ABTI_CHECK_NULL_SCHED_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_sched *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_SCHED); \
} \
} while (0)

Definition at line 177 of file abti_error.h.

◆ ABTI_CHECK_NULL_TASK_PTR

#define ABTI_CHECK_NULL_TASK_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_thread *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_TASK); \
return ABT_ERR_INV_TASK; \
} \
} while (0)

Definition at line 222 of file abti_error.h.

◆ ABTI_CHECK_NULL_THREAD_ATTR_PTR

#define ABTI_CHECK_NULL_THREAD_ATTR_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_thread_attr *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_THREAD_ATTR); \
} \
} while (0)

Definition at line 213 of file abti_error.h.

◆ ABTI_CHECK_NULL_THREAD_PTR

#define ABTI_CHECK_NULL_THREAD_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_thread *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_THREAD); \
} \
} while (0)

Definition at line 195 of file abti_error.h.

◆ ABTI_CHECK_NULL_TIMER_PTR

#define ABTI_CHECK_NULL_TIMER_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_timer *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_TIMER); \
} \
} while (0)

Definition at line 312 of file abti_error.h.

◆ ABTI_CHECK_NULL_TOOL_CONTEXT_PTR

#define ABTI_CHECK_NULL_TOOL_CONTEXT_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_tool_context *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_TOOL_CONTEXT); \
} \
} while (0)

Definition at line 321 of file abti_error.h.

◆ ABTI_CHECK_NULL_XSTREAM_BARRIER_PTR

#define ABTI_CHECK_NULL_XSTREAM_BARRIER_PTR (   p)
Value:
do { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_XSTREAM_BARRIER); \
} \
} while (0)

Definition at line 303 of file abti_error.h.

◆ ABTI_CHECK_NULL_XSTREAM_PTR

#define ABTI_CHECK_NULL_XSTREAM_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_xstream *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_XSTREAM); \
} \
} while (0)

Definition at line 159 of file abti_error.h.

◆ ABTI_CHECK_NULL_YTHREAD_PTR

#define ABTI_CHECK_NULL_YTHREAD_PTR (   p)
Value:
do { \
ABTU_unlikely(p == (ABTI_ythread *)NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_THREAD); \
} \
} while (0)

Definition at line 204 of file abti_error.h.

◆ ABTI_CHECK_TRUE

#define ABTI_CHECK_TRUE (   cond,
  abt_errno 
)
Value:
do { \
int abt_errno_ = (abt_errno); \
HANDLE_ERROR_FUNC_WITH_CODE(abt_errno_); \
return abt_errno_; \
} \
} while (0)

Definition at line 130 of file abti_error.h.

◆ ABTI_CHECK_TRUE_MSG

#define ABTI_CHECK_TRUE_MSG (   cond,
  abt_errno,
  msg 
)
Value:
do { \
HANDLE_ERROR(msg); \
return (abt_errno); \
} \
} while (0)

Definition at line 151 of file abti_error.h.

◆ ABTI_CHECK_YIELDABLE

#define ABTI_CHECK_YIELDABLE (   p_thread,
  pp_ythread,
  abt_errno 
)
Value:
do { \
ABTI_thread *p_tmp = (p_thread); \
int abt_errno_ = (abt_errno); \
HANDLE_ERROR_FUNC_WITH_CODE(abt_errno_); \
return abt_errno_; \
} \
*(pp_ythread) = ABTI_thread_get_ythread(p_tmp); \
} while (0)

Definition at line 139 of file abti_error.h.

◆ ABTI_HANDLE_ERROR

#define ABTI_HANDLE_ERROR (   n)
Value:
do { \
HANDLE_ERROR_FUNC_WITH_CODE(n); \
return n; \
} while (0)

Definition at line 114 of file abti_error.h.

◆ ABTI_IS_PRINT_ABT_ERRNO_ENABLED

#define ABTI_IS_PRINT_ABT_ERRNO_ENABLED   0

Definition at line 27 of file abti_error.h.

◆ ABTI_SETUP_GLOBAL

#define ABTI_SETUP_GLOBAL (   pp_global)
Value:
do { \
ABTI_global *p_global_tmp = ABTI_global_get_global_or_null(); \
ABTU_unlikely(p_global_tmp == NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_UNINITIALIZED); \
} \
ABTI_global **pp_global_tmp = (pp_global); \
if (pp_global_tmp) { \
*pp_global_tmp = p_global_tmp; \
} \
} while (0)

Definition at line 59 of file abti_error.h.

◆ ABTI_SETUP_LOCAL_XSTREAM

#define ABTI_SETUP_LOCAL_XSTREAM (   pp_local_xstream)
Value:
do { \
ABTI_xstream *p_local_xstream_tmp = \
ABTI_local_get_xstream_or_null(ABTI_local_get_local()); \
ABTU_unlikely(p_local_xstream_tmp == NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_XSTREAM); \
} \
ABTI_xstream **pp_local_xstream_tmp = (pp_local_xstream); \
if (pp_local_xstream_tmp) { \
*pp_local_xstream_tmp = p_local_xstream_tmp; \
} \
} while (0)

Definition at line 73 of file abti_error.h.

◆ ABTI_SETUP_LOCAL_YTHREAD

#define ABTI_SETUP_LOCAL_YTHREAD (   pp_local_xstream,
  pp_ythread 
)
Value:
do { \
ABTI_xstream *p_local_xstream_tmp = \
ABTI_local_get_xstream_or_null(ABTI_local_get_local()); \
ABTU_unlikely(p_local_xstream_tmp == NULL)) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_XSTREAM); \
} \
ABTI_xstream **pp_local_xstream_tmp = (pp_local_xstream); \
if (pp_local_xstream_tmp) { \
*pp_local_xstream_tmp = p_local_xstream_tmp; \
} \
ABTI_thread *p_thread_tmp = p_local_xstream_tmp->p_thread; \
!(p_thread_tmp->type & ABTI_THREAD_TYPE_YIELDABLE))) { \
HANDLE_ERROR_FUNC_WITH_CODE(ABT_ERR_INV_THREAD); \
} \
ABTI_ythread **pp_ythread_tmp = (pp_ythread); \
if (pp_ythread_tmp) { \
*pp_ythread_tmp = ABTI_thread_get_ythread(p_thread_tmp); \
} \
} while (0)

Definition at line 88 of file abti_error.h.

◆ ABTI_STATIC_ASSERT

#define ABTI_STATIC_ASSERT (   cond)
Value:
do { \
((void)sizeof(char[2 * !!(cond)-1])); \
} while (0)

Definition at line 19 of file abti_error.h.

◆ HANDLE_ERROR

#define HANDLE_ERROR (   msg)
Value:
do { \
fprintf(stderr, "[%s:%d] %s\n", __FILE__, __LINE__, msg); \
} \
} while (0)

Definition at line 37 of file abti_error.h.

◆ HANDLE_ERROR_FUNC_WITH_CODE

#define HANDLE_ERROR_FUNC_WITH_CODE (   n)
Value:
do { \
fprintf(stderr, "[%s:%d] %s: %d\n", __FILE__, __LINE__, __func__, \
n); \
} \
} while (0)

Definition at line 51 of file abti_error.h.

◆ HANDLE_ERROR_WITH_CODE

#define HANDLE_ERROR_WITH_CODE (   msg,
 
)
Value:
do { \
fprintf(stderr, "[%s:%d] %s: %d\n", __FILE__, __LINE__, msg, n); \
} \
} while (0)

Definition at line 44 of file abti_error.h.

◆ HANDLE_WARNING

#define HANDLE_WARNING (   msg)
Value:
do { \
fprintf(stderr, "[%s:%d] %s\n", __FILE__, __LINE__, msg); \
} \
} while (0)

Definition at line 30 of file abti_error.h.

ABTI_key
Definition: abti.h:413
ABT_ERR_INV_SCHED_CONFIG
#define ABT_ERR_INV_SCHED_CONFIG
Error code: invalid scheduler configuration.
Definition: abt.h:151
ABT_ERR_INV_THREAD
#define ABT_ERR_INV_THREAD
Error code: invalid work unit.
Definition: abt.h:176
ABT_ERR_UNINITIALIZED
#define ABT_ERR_UNINITIALIZED
Error code: Argobots it not initialized.
Definition: abt.h:97
ABTI_future
Definition: abti.h:456
ABT_ERR_INV_XSTREAM
#define ABT_ERR_INV_XSTREAM
Error code: invalid execution stream.
Definition: abt.h:114
ABT_ERR_INV_RWLOCK
#define ABT_ERR_INV_RWLOCK
Error code: invalid readers-writer lock.
Definition: abt.h:215
ABTI_eventual
Definition: abti.h:448
ABTI_xstream_barrier
Definition: abti.h:472
ABTI_THREAD_TYPE_YIELDABLE
#define ABTI_THREAD_TYPE_YIELDABLE
Definition: abti.h:86
ABTI_thread_get_ythread
static ABTI_ythread * ABTI_thread_get_ythread(ABTI_thread *p_thread)
Definition: abti_thread.h:52
ABTI_tool_context
Definition: abti.h:489
ABTI_thread
Definition: abti.h:371
ABTI_IS_ERROR_CHECK_ENABLED
#define ABTI_IS_ERROR_CHECK_ENABLED
Definition: abti.h:20
ABTI_barrier
Definition: abti.h:465
ABTI_xstream
Definition: abti.h:264
ABT_ERR_INV_MUTEX
#define ABT_ERR_INV_MUTEX
Error code: invalid mutex.
Definition: abt.h:200
ABTI_sched_config
Definition: abti.h:323
ABT_ERR_INV_KEY
#define ABT_ERR_INV_KEY
Error code: invalid work-unit-specific data key.
Definition: abt.h:195
ABTI_thread_attr
Definition: abti.h:388
ABT_ERR_INV_SCHED
#define ABT_ERR_INV_SCHED
Error code: invalid scheduler.
Definition: abt.h:129
ABTI_pool
Definition: abti.h:327
ABTI_cond
Definition: abti.h:435
ABT_ERR_INV_COND
#define ABT_ERR_INV_COND
Error code: invalid condition variable.
Definition: abt.h:210
ABTI_timer
Definition: abti.h:483
ABTI_rwlock
Definition: abti.h:441
ABT_ERR_INV_BARRIER
#define ABT_ERR_INV_BARRIER
Error code: invalid barrier.
Definition: abt.h:230
ABT_ERR_INV_FUTURE
#define ABT_ERR_INV_FUTURE
Error code: invalid future.
Definition: abt.h:225
ABT_ERR_INV_THREAD_ATTR
#define ABT_ERR_INV_THREAD_ATTR
Error code: invalid ULT attribute.
Definition: abt.h:181
ABTI_local_get_local
static ABTI_local * ABTI_local_get_local(void)
Definition: abti_local.h:41
ABT_ERR_INV_TASK
#define ABT_ERR_INV_TASK
Error code: invalid work unit.
Definition: abt.h:190
ABT_SUCCESS
#define ABT_SUCCESS
Error code: the routine returns successfully.
Definition: abt.h:92
ABT_ERR_INV_TIMER
#define ABT_ERR_INV_TIMER
Error code: invalid timer.
Definition: abt.h:235
ABTI_IS_EXT_THREAD_ENABLED
#define ABTI_IS_EXT_THREAD_ENABLED
Definition: abti.h:28
ABTU_unlikely
#define ABTU_unlikely(cond)
Definition: abtu.h:112
ABTI_sched
Definition: abti.h:289
ABTI_ythread
Definition: abti.h:406
ABTI_mutex_attr
Definition: abti.h:170
ABT_ERR_INV_POOL
#define ABT_ERR_INV_POOL
Error code: invalid pool.
Definition: abt.h:156
ABT_ERR_INV_MUTEX_ATTR
#define ABT_ERR_INV_MUTEX_ATTR
Error code: invalid mutex attribute.
Definition: abt.h:205
ABT_ERR_INV_EVENTUAL
#define ABT_ERR_INV_EVENTUAL
Error code: invalid eventual.
Definition: abt.h:220
ABTI_global_get_global_or_null
static ABTI_global * ABTI_global_get_global_or_null(void)
Definition: abti_global.h:15
ABT_ERR_INV_XSTREAM_BARRIER
#define ABT_ERR_INV_XSTREAM_BARRIER
Error code: invalid execution stream barrier.
Definition: abt.h:124
ABTI_IS_PRINT_ABT_ERRNO_ENABLED
#define ABTI_IS_PRINT_ABT_ERRNO_ENABLED
Definition: abti_error.h:27
ABT_ERR_INV_TOOL_CONTEXT
#define ABT_ERR_INV_TOOL_CONTEXT
Error code: invalid tool context.
Definition: abt.h:245
ABTI_mutex
Definition: abti.h:174