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

Commit a54a7a7

Browse files
Merge pull request #58 from Intel-HLS/dev
Version 0.5.0
2 parents 82ef689 + a400510 commit a54a7a7

26 files changed

+2528
-231
lines changed

.travis.yml

+22-5
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,39 @@ sudo: required
33
dist: trusty
44

55
install:
6-
#Install lcov and MPICH
7-
- sudo apt-get -y install lcov mpich zlib1g-dev libssl-dev libgtest-dev
6+
# Install lcov, MPICH, zlib, OpenSSL, Gtest and LZ4
7+
- sudo apt-get -y install lcov mpich zlib1g-dev libssl-dev libgtest-dev liblz4-dev
8+
# Install Zstandard
9+
- wget https://github.com/facebook/zstd/archive/v1.0.0.tar.gz
10+
- tar xf v1.0.0.tar.gz
11+
- cd zstd-1.0.0
12+
- sudo make install PREFIX='/usr'
13+
- cd $TRAVIS_BUILD_DIR
14+
# Install Blosc
15+
- git clone https://github.com/Blosc/c-blosc
16+
- cd c-blosc
17+
- mkdir build
18+
- cd build
19+
- cmake -DCMAKE_INSTALL_PREFIX='/usr' ..
20+
- cmake --build .
21+
- sudo cmake --build . --target install
22+
- cd $TRAVIS_BUILD_DIR
23+
# Install Google Test
824
- cd /usr/src/gtest
925
- sudo cmake .
1026
- sudo make
1127
- sudo mv libgtest* /usr/lib/
1228
- cd $TRAVIS_BUILD_DIR
13-
# install lcov to coveralls conversion + upload tool
29+
# Install lcov to coveralls conversion + upload tool
1430
- gem install coveralls-lcov
1531

1632
before_script:
1733
- lcov --directory . --zerocounters
1834

1935
script:
20-
- make CXX=mpic++ INCLUDE_PATHS=-I/usr/include/mpich MPILIB=-lmpich -j 4
21-
- make test CXX=mpic++ INCLUDE_PATHS=-I/usr/include/mpich MPILIB=-lmpich
36+
- make clean
37+
- make -j 4
38+
- make test -j 4
2239
- lcov --directory . --capture --output-file coverage.info
2340
- lcov --list coverage.info # debug before upload
2441

Makefile

+34-6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,28 @@ ifeq ($(VERBOSE),1)
4848
CPPFLAGS += -DVERBOSE
4949
endif
5050

51+
# --- MAC address interface --- #
52+
MAC_ADDRESS_INTERFACE =
53+
ifneq ($(MAC_ADDRESS_INTERFACE),)
54+
CPPFLAGS += -DTILEDB_MAC_ADDRESS_INTERFACE=$(MAC_ADDRESS_INTERFACE)
55+
endif
56+
57+
# --- Compression levels --- #
58+
COMPRESSION_LEVEL_GZIP =
59+
ifneq ($(COMPRESSION_LEVEL_GZIP),)
60+
CPPFLAGS += -DTILEDB_COMPRESSION_LEVEL_GZIP=$(COMPRESSION_LEVEL_GZIP)
61+
endif
62+
63+
COMPRESSION_LEVEL_ZSTD =
64+
ifneq ($(COMPRESSION_LEVEL_ZSTD),)
65+
CPPFLAGS += -DTILEDB_COMPRESSION_LEVEL_ZSTD=$(COMPRESSION_LEVEL_ZSTD)
66+
endif
67+
68+
COMPRESSION_LEVEL_BLOSC =
69+
ifneq ($(COMPRESSION_LEVEL_BLOSC),)
70+
CPPFLAGS += -DTILEDB_COMPRESSION_LEVEL_BLOSC=$(COMPRESSION_LEVEL_BLOSC)
71+
endif
72+
5173
# --- Use parallel sort --- #
5274
USE_PARALLEL_SORT =
5375
ifeq ($(USE_PARALLEL_SORT),1)
@@ -137,7 +159,10 @@ ifdef TRAVIS
137159
endif
138160

139161
# --- Libraries --- #
140-
ZLIB = -lz
162+
ZLIB = -lz
163+
ZSTD = -lzstd
164+
LZ4 = -llz4
165+
BLOSC = -lblosc
141166
OPENSSLLIB = -lcrypto
142167
GTESTLIB = -lgtest -lgtest_main
143168
MPILIB =
@@ -237,7 +262,8 @@ $(CORE_LIB_DIR)/libtiledb.$(SHLIB_EXT): $(CORE_OBJ)
237262
@mkdir -p $(CORE_LIB_DIR)
238263
@echo "Creating dynamic library libtiledb.$(SHLIB_EXT)"
239264
@$(CXX) $(SHLIB_FLAGS) $(SONAME) -o $@ $^ $(LIBRARY_PATHS) $(MPILIB) \
240-
$(PTHREADLIB) $(ZLIB) $(OPENSSLLIB) $(OPENMP_FLAG)
265+
$(PTHREADLIB) $(ZLIB) $(ZSTD) $(LZ4) $(BLOSC) \
266+
$(OPENSSLLIB) $(OPENMP_FLAG)
241267

242268
$(CORE_LIB_DIR)/libtiledb.a: $(CORE_OBJ)
243269
@mkdir -p $(CORE_LIB_DIR)
@@ -275,8 +301,9 @@ $(EXAMPLES_OBJ_DIR)/%.o: $(EXAMPLES_SRC_DIR)/%.cc
275301
$(EXAMPLES_BIN_DIR)/%: $(EXAMPLES_OBJ_DIR)/%.o $(CORE_LIB_DIR)/libtiledb.a
276302
@mkdir -p $(EXAMPLES_BIN_DIR)
277303
@echo "Creating $@"
278-
@$(CXX) -std=gnu++11 -o $@ $^ $(LIBRARY_PATHS) $(MPILIB) $(ZLIB) \
279-
$(PTHREADLIB) $(OPENSSLLIB) $(OPENMP_FLAG)
304+
@$(CXX) -std=gnu++11 -o $@ $^ $(LIBRARY_PATHS) $(MPILIB) \
305+
$(ZLIB) $(LZ4) $(ZSTD) $(BLOSC) \
306+
$(PTHREADLIB) $(OPENSSLLIB) $(OPENMP_FLAG)
280307

281308
# --- Cleaning --- #
282309

@@ -308,8 +335,9 @@ $(TEST_OBJ_DIR)/%.o: $(TEST_SRC_DIR)/%.cc
308335

309336
$(TEST_BIN_DIR)/tiledb_test: $(TEST_OBJ) $(CORE_LIB_DIR)/libtiledb.a
310337
@mkdir -p $(TEST_BIN_DIR)
311-
@echo "Creating test_cmd"
312-
@$(CXX) -o $@ $^ $(LIBRARY_PATHS) $(MPILIB) $(ZLIB) \
338+
@echo "Creating tiledb_test"
339+
@$(CXX) -o $@ $^ $(LIBRARY_PATHS) $(MPILIB) \
340+
$(ZLIB) $(ZSTD) $(LZ4) $(BLOSC) \
313341
$(PTHREADLIB) $(OPENSSLLIB) $(GTESTLIB) $(OPENMP_FLAG)
314342

315343
# --- Cleaning --- #

core/include/array/array.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "array_sorted_write_state.h"
4040
#include "array_schema.h"
4141
#include "book_keeping.h"
42-
#include "config.h"
42+
#include "storage_manager_config.h"
4343
#include "constants.h"
4444
#include "fragment.h"
4545
#include <pthread.h>
@@ -138,7 +138,7 @@ class Array {
138138
const std::vector<int>& attribute_ids() const;
139139

140140
/** Returns the configuration parameters. */
141-
const Config* config() const;
141+
const StorageManagerConfig* config() const;
142142

143143
/** Returns the number of fragments in this array. */
144144
int fragment_num() const;
@@ -307,7 +307,7 @@ class Array {
307307
const char** attributes,
308308
int attribute_num,
309309
const void* subarray,
310-
const Config* config,
310+
const StorageManagerConfig* config,
311311
Array* array_clone = NULL);
312312

313313
/**
@@ -471,7 +471,7 @@ class Array {
471471
*/
472472
std::vector<int> attribute_ids_;
473473
/** Configuration parameters. */
474-
const Config* config_;
474+
const StorageManagerConfig* config_;
475475
/** The array fragments. */
476476
std::vector<Fragment*> fragments_;
477477
/**

core/include/array/array_schema.h

+13-1
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ class ArraySchema {
294294
/** Returns the type of the i-th attribute, or NULL if 'i' is invalid. */
295295
int type(int i) const;
296296

297+
/** Returns the type size of the i-th attribute. */
298+
size_t type_size(int i) const;
299+
297300
/** Returns the number of attributes with variable-sized values. */
298301
int var_attribute_num() const;
299302

@@ -707,7 +710,16 @@ class ArraySchema {
707710
* The compression type for each attribute (plus one extra at the end for the
708711
* coordinates. It can be one of the following:
709712
* - TILEDB_NO_COMPRESSION
710-
* - TILEDB_GZIP.
713+
* - TILEDB_GZIP
714+
* - TILEDB_ZSTD
715+
* - TILEDB_LZ4
716+
* - TILEDB_BLOSC
717+
* - TILEDB_BLOSC_LZ4
718+
* - TILEDB_BLOSC_LZ4HC
719+
* - TILEDB_BLOSC_SNAPPY
720+
* - TILEDB_BLOSC_ZLIB
721+
* - TILEDB_BLOSC_ZSTD
722+
* - TILEDB_RLE
711723
*/
712724
std::vector<int> compression_;
713725
/** Auxiliary variable used when calculating Hilbert ids. */

core/include/array/array_schema_c.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,16 @@ typedef struct ArraySchemaC {
6969
* The compression type for each attribute (plus one extra at the end for the
7070
* coordinates. It can be one of the following:
7171
* - TILEDB_NO_COMPRESSION
72-
* - TILEDB_GZIP.
72+
* - TILEDB_GZIP
73+
* - TILEDB_ZSTD
74+
* - TILEDB_LZ4
75+
* - TILEDB_BLOSC
76+
* - TILEDB_BLOSC_LZ4
77+
* - TILEDB_BLOSC_LZ4HC
78+
* - TILEDB_BLOSC_SNAPPY
79+
* - TILEDB_BLOSC_ZLIB
80+
* - TILEDB_BLOSC_ZSTD
81+
* - TILEDB_RLE
7382
*/
7483
int* compression_;
7584
/**

core/include/c_api/c_api.h

+20-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ typedef struct TileDB_Config {
100100
/**
101101
* The method for reading data from a file.
102102
* It can be one of the following:
103-
* - TILEDB_IO_MMAP
103+
* - TILEDB_IO_MMAP (default)
104104
* TileDB will use mmap.
105105
* - TILEDB_IO_READ
106106
* TileDB will use standard OS read.
@@ -111,7 +111,7 @@ typedef struct TileDB_Config {
111111
/**
112112
* The method for writing data to a file.
113113
* It can be one of the following:
114-
* - TILEDB_IO_WRITE
114+
* - TILEDB_IO_WRITE (default)
115115
* TileDB will use standard OS write.
116116
* - TILEDB_IO_MPI
117117
* TileDB will use MPI-IO write.
@@ -233,6 +233,15 @@ typedef struct TileDB_ArraySchema {
233233
* coordinates). It can be one of the following:
234234
* - TILEDB_NO_COMPRESSION
235235
* - TILEDB_GZIP
236+
* - TILEDB_ZSTD
237+
* - TILEDB_LZ4
238+
* - TILEDB_BLOSC
239+
* - TILEDB_BLOSC_LZ4
240+
* - TILEDB_BLOSC_LZ4HC
241+
* - TILEDB_BLOSC_SNAPPY
242+
* - TILEDB_BLOSC_ZLIB
243+
* - TILEDB_BLOSC_ZSTD
244+
* - TILEDB_RLE
236245
*
237246
* If it is *NULL*, then the default TILEDB_NO_COMPRESSION is used for all
238247
* attributes.
@@ -737,6 +746,15 @@ typedef struct TileDB_MetadataSchema {
737746
* key). It can be one of the following:
738747
* - TILEDB_NO_COMPRESSION
739748
* - TILEDB_GZIP
749+
* - TILEDB_ZSTD
750+
* - TILEDB_LZ4
751+
* - TILEDB_BLOSC
752+
* - TILEDB_BLOSC_LZ4
753+
* - TILEDB_BLOSC_LZ4HC
754+
* - TILEDB_BLOSC_SNAPPY
755+
* - TILEDB_BLOSC_ZLIB
756+
* - TILEDB_BLOSC_ZSTD
757+
* - TILEDB_RLE
740758
*
741759
* If it is *NULL*, then the default TILEDB_NO_COMPRESSION is used for all
742760
* attributes.

core/include/c_api/constants.h

+35-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <limits.h>
3838

3939
/** Version. */
40-
#define TILEDB_VERSION "0.4.0"
40+
#define TILEDB_VERSION "0.5.0"
4141

4242
/**@{*/
4343
/** Return code. */
@@ -134,6 +134,15 @@
134134
/** Compression type. */
135135
#define TILEDB_NO_COMPRESSION 0
136136
#define TILEDB_GZIP 1
137+
#define TILEDB_ZSTD 2
138+
#define TILEDB_LZ4 3
139+
#define TILEDB_BLOSC 4
140+
#define TILEDB_BLOSC_LZ4 5
141+
#define TILEDB_BLOSC_LZ4HC 6
142+
#define TILEDB_BLOSC_SNAPPY 7
143+
#define TILEDB_BLOSC_ZLIB 8
144+
#define TILEDB_BLOSC_ZSTD 9
145+
#define TILEDB_RLE 10
137146
/**@}*/
138147

139148
/**@{*/
@@ -167,7 +176,30 @@
167176
#define TILEDB_SORTED_BUFFER_VAR_SIZE 10000000 // ~10MB
168177
/**@}*/
169178

170-
/** The alignment to assist vectorization. */
171-
#define ALIGNMENT 64
179+
/**@{*/
180+
/** Compression levels. */
181+
#ifndef TILEDB_COMPRESSION_LEVEL_GZIP
182+
# define TILEDB_COMPRESSION_LEVEL_GZIP Z_DEFAULT_COMPRESSION
183+
#endif
184+
#ifndef TILEDB_COMPRESSION_LEVEL_ZSTD
185+
# define TILEDB_COMPRESSION_LEVEL_ZSTD 1
186+
#endif
187+
#ifndef TILEDB_COMPRESSION_LEVEL_BLOSC
188+
# define TILEDB_COMPRESSION_LEVEL_BLOSC 5
189+
#endif
190+
/**@}*/
191+
192+
/**@{*/
193+
/** MAC address interface. */
194+
#if defined(__APPLE__) && defined(__MACH__)
195+
#ifndef TILEDB_MAC_ADDRESS_INTERFACE
196+
#define TILEDB_MAC_ADDRESS_INTERFACE en0
197+
#endif
198+
#else
199+
#ifndef TILEDB_MAC_ADDRESS_INTERFACE
200+
#define TILEDB_MAC_ADDRESS_INTERFACE eth0
201+
#endif
202+
#endif
203+
/**@}*/
172204

173205
#endif

0 commit comments

Comments
 (0)