ARGOBOTS
1.1
src
error.c
Go to the documentation of this file.
1
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2
/*
3
* See COPYRIGHT in top-level directory.
4
*/
5
6
#include "
abti.h
"
7
51
int
ABT_error_get_str
(
int
err,
char
*str,
size_t
*len)
52
{
53
static
const
char
*err_str[] = {
"ABT_SUCCESS"
,
54
"ABT_ERR_UNINITIALIZED"
,
55
"ABT_ERR_MEM"
,
56
"ABT_ERR_OTHER"
,
57
"ABT_ERR_INV_XSTREAM"
,
58
"ABT_ERR_INV_XSTREAM_RANK"
,
59
"ABT_ERR_INV_XSTREAM_BARRIER"
,
60
"ABT_ERR_INV_SCHED"
,
61
"ABT_ERR_INV_SCHED_KIND"
,
62
"ABT_ERR_INV_SCHED_PREDEF"
,
63
"ABT_ERR_INV_SCHED_TYPE"
,
64
"ABT_ERR_INV_SCHED_CONFIG"
,
65
"ABT_ERR_INV_POOL"
,
66
"ABT_ERR_INV_POOL_KIND"
,
67
"ABT_ERR_INV_POOL_ACCESS"
,
68
"ABT_ERR_INV_UNIT"
,
69
"ABT_ERR_INV_THREAD"
,
70
"ABT_ERR_INV_THREAD_ATTR"
,
71
"ABT_ERR_INV_TASK"
,
72
"ABT_ERR_INV_KEY"
,
73
"ABT_ERR_INV_MUTEX"
,
74
"ABT_ERR_INV_MUTEX_ATTR"
,
75
"ABT_ERR_INV_COND"
,
76
"ABT_ERR_INV_RWLOCK"
,
77
"ABT_ERR_INV_EVENTUAL"
,
78
"ABT_ERR_INV_FUTURE"
,
79
"ABT_ERR_INV_BARRIER"
,
80
"ABT_ERR_INV_TIMER"
,
81
"ABT_ERR_INV_QUERY_KIND"
,
82
"ABT_ERR_XSTREAM"
,
83
"ABT_ERR_XSTREAM_STATE"
,
84
"ABT_ERR_XSTREAM_BARRIER"
,
85
"ABT_ERR_SCHED"
,
86
"ABT_ERR_SCHED_CONFIG"
,
87
"ABT_ERR_POOL"
,
88
"ABT_ERR_UNIT"
,
89
"ABT_ERR_THREAD"
,
90
"ABT_ERR_TASK"
,
91
"ABT_ERR_KEY"
,
92
"ABT_ERR_MUTEX"
,
93
"ABT_ERR_MUTEX_LOCKED"
,
94
"ABT_ERR_COND"
,
95
"ABT_ERR_COND_TIMEDOUT"
,
96
"ABT_ERR_RWLOCK"
,
97
"ABT_ERR_EVENTUAL"
,
98
"ABT_ERR_FUTURE"
,
99
"ABT_ERR_BARRIER"
,
100
"ABT_ERR_TIMER"
,
101
"ABT_ERR_MIGRATION_TARGET"
,
102
"ABT_ERR_MIGRATION_NA"
,
103
"ABT_ERR_MISSING_JOIN"
,
104
"ABT_ERR_FEATURE_NA"
,
105
"ABT_ERR_INV_TOOL_CONTEXT"
,
106
"ABT_ERR_INV_ARG"
,
107
"ABT_ERR_SYS"
,
108
"ABT_ERR_CPUID"
};
109
110
#ifndef ABT_CONFIG_ENABLE_VER_20_API
111
ABTI_CHECK_TRUE
(err >=
ABT_SUCCESS
&&
112
err < (
int
)(
sizeof
(err_str) /
sizeof
(err_str[0])),
113
ABT_ERR_OTHER
);
114
/* This entry does not exist. */
115
ABTI_CHECK_TRUE
(err_str[err],
ABT_ERR_OTHER
);
116
#else
117
ABTI_CHECK_TRUE
(err >=
ABT_SUCCESS
&&
118
err < (
int
)(
sizeof
(err_str) /
sizeof
(err_str[0])),
119
ABT_ERR_INV_ARG
);
120
/* This entry does not exist. */
121
ABTI_CHECK_TRUE
(err_str[err],
ABT_ERR_INV_ARG
);
122
#endif
123
124
if
(str)
125
strcpy(str, err_str[err]);
126
if
(len)
127
*len = strlen(err_str[err]);
128
return
ABT_SUCCESS
;
129
}
abti.h
ABT_error_get_str
int ABT_error_get_str(int err, char *str, size_t *len)
Retrieve a string of an error code and its length.
Definition:
error.c:52
ABT_SUCCESS
#define ABT_SUCCESS
Error code: the routine returns successfully.
Definition:
abt.h:92
ABT_ERR_INV_ARG
#define ABT_ERR_INV_ARG
Error code: invalid user argument.
Definition:
abt.h:250
ABT_ERR_OTHER
#define ABT_ERR_OTHER
Error code: other error.
Definition:
abt.h:109
ABTI_CHECK_TRUE
#define ABTI_CHECK_TRUE(cond, abt_errno)
Definition:
abti_error.h:130
Generated on Thu Apr 1 2021 07:02:51 for ARGOBOTS by
1.8.17