Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #51 from Intel-HLS/dev
Browse files Browse the repository at this point in the history
New C APIs, bug fixes, minor fixes, and error messages
  • Loading branch information
stavrospapadopoulos authored Aug 12, 2016
2 parents 44c3054 + 35e7a23 commit b28795a
Show file tree
Hide file tree
Showing 32 changed files with 2,446 additions and 912 deletions.
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,9 @@ endif

# --- Verbose mode handler --- #
VERBOSE =
ifeq ($(VERBOSE),)
VERBOSE = 2
endif
ifeq ($(VERBOSE),0)
ifeq ($(VERBOSE),1)
CPPFLAGS += -DNVERBOSE
endif
ifneq ($(VERBOSE),0)
CPPFLAGS += -DVERBOSE=$(VERBOSE)
endif

# --- Compilers --- #
CXX = g++
Expand Down
14 changes: 14 additions & 0 deletions core/include/array/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@
#define TILEDB_AR_ERR -1
/**@}*/

/** Default error message. */
#define TILEDB_AR_ERRMSG std::string("[TileDB::Array] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_ar_errmsg;



class ArrayReadState;
class Fragment;

Expand Down
13 changes: 13 additions & 0 deletions core/include/array/array_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@
/**@}*/


/** Default error message. */
#define TILEDB_AIT_ERRMSG std::string("[TileDB::ArrayIterator] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_ait_errmsg;




/** Enables iteration (read) over an array's cells. */
Expand Down
12 changes: 12 additions & 0 deletions core/include/array/array_read_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@
/** Size of the starting offset of a variable cell value. */
#define TILEDB_CELL_VAR_OFFSET_SIZE sizeof(size_t)

/** Default error message. */
#define TILEDB_ARS_ERRMSG std::string("[TileDB::ArrayReadState] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_ars_errmsg;




Expand Down
12 changes: 12 additions & 0 deletions core/include/array/array_schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@
// Default parameters.
#define TILEDB_AS_CAPACITY 10000

/** Default error message. */
#define TILEDB_AS_ERRMSG std::string("[TileDB::ArraySchema] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_as_errmsg;




Expand Down
54 changes: 54 additions & 0 deletions core/include/c_api/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,27 @@
#include <mpi.h>
#include <stdint.h>
#include <stddef.h>
#include <string>
#include <unistd.h>


/* ********************************* */
/* CONSTANTS */
/* ********************************* */

/** Default error message. */
#define TILEDB_ERRMSG std::string("[TileDB] Error: ")

/** Maximum error message length. */
#define TILEDB_ERRMSG_MAX_LEN 2000




/* ********************************* */
/* MACROS */
/* ********************************* */

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -49,6 +68,18 @@ extern "C" {
# define TILEDB_EXPORT
#endif




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern char tiledb_errmsg[TILEDB_ERRMSG_MAX_LEN];




/* ********************************* */
/* CONFIG */
/* ********************************* */
Expand Down Expand Up @@ -1036,6 +1067,16 @@ TILEDB_EXPORT int tiledb_ls_workspaces(
char** workspaces,
int* workspace_num);

/**
* Counts the number of TileDB workspaces.
*
* @param tiledb_ctx The TileDB context.
* @param workspace_num The number of TileDB workspaces to be returned.
* @return TILEDB_OK for success and TILEDB_ERR for error.
*/
TILEDB_EXPORT int tiledb_ls_workspaces_c(
const TileDB_CTX* tiledb_ctx,
int* workspace_num);

/**
* Lists all the TileDB objects in a directory, copying their names into the
Expand Down Expand Up @@ -1067,6 +1108,19 @@ TILEDB_EXPORT int tiledb_ls(
int* dir_types,
int* dir_num);

/**
* Counts the TileDB objects in a directory.
*
* @param tiledb_ctx The TileDB context.
* @param parent_dir The parent directory of the TileDB objects to be listed.
* @param dir_num The number of TileDB objects to be returned.
* @return TILEDB_OK for success and TILEDB_ERR for error.
*/
TILEDB_EXPORT int tiledb_ls_c(
const TileDB_CTX* tiledb_ctx,
const char* parent_dir,
int* dir_num);




Expand Down
2 changes: 1 addition & 1 deletion core/include/c_api/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <limits.h>

/** Version. */
#define TILEDB_VERSION "0.3.3"
#define TILEDB_VERSION "0.3.4"

/**@{*/
/** Return code. */
Expand Down
12 changes: 12 additions & 0 deletions core/include/fragment/book_keeping.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@
#define TILEDB_BK_ERR -1
/**@}*/

/** Default error message. */
#define TILEDB_BK_ERRMSG std::string("[TileDB::BookKeeping] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_bk_errmsg;




Expand Down
12 changes: 12 additions & 0 deletions core/include/fragment/fragment.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@
#define TILEDB_FG_ERR -1
/**@}*/

/** Default error message. */
#define TILEDB_FG_ERRMSG std::string("[TileDB::Fragment] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_fg_errmsg;




Expand Down
12 changes: 12 additions & 0 deletions core/include/fragment/read_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@
#define TILEDB_RS_ERR -1
/**@}*/

/** Default error message. */
#define TILEDB_RS_ERRMSG std::string("[TileDB::ReadState] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_rs_errmsg;




Expand Down
15 changes: 15 additions & 0 deletions core/include/fragment/write_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@
#define TILEDB_WS_ERR -1
/**@}*/

/** Default error message. */
#define TILEDB_WS_ERRMSG std::string("[TileDB::WriteState] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_ws_errmsg;




class BookKeeping;
class Fragment;

Expand Down
14 changes: 14 additions & 0 deletions core/include/metadata/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@
#define TILEDB_MT_ERR -1
/**@}*/

/** Default error message. */
#define TILEDB_MT_ERRMSG std::string("[TileDB::Metadata] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_mt_errmsg;




/** Manages a TileDB metadata object. */
class Metadata {
Expand Down
15 changes: 15 additions & 0 deletions core/include/metadata/metadata_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@
#define TILEDB_MIT_ERR -1
/**@}*/

/** Default error message. */
#define TILEDB_MIT_ERRMSG std::string("[TileDB::MetadataIterator] Error: ")




/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_mit_errmsg;




/** Enables iteration (read) over metadata values. */
class MetadataIterator {
public:
Expand Down
11 changes: 11 additions & 0 deletions core/include/misc/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@
#define TILEDB_UT_ERR -1
/**@}*/

/** Default error message. */
#define TILEDB_UT_ERRMSG std::string("[TileDB::utils] Error: ")

/** Maximum number of bytes written in a single I/O. */
#define TILEDB_UT_MAX_WRITE_COUNT 1500000000 // ~ 1.5 GB


/* ********************************* */
/* GLOBAL VARIABLES */
/* ********************************* */

extern std::string tiledb_ut_errmsg;


/* ********************************* */
Expand Down
Loading

0 comments on commit b28795a

Please sign in to comment.