diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..f14e8f9
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,58 @@
+cmake_minimum_required(VERSION 3.18)
+project(ARC VERSION 0.0.2 LANGUAGES C)
+
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+option(BUILD_SHARED_LIBS "prefer shared libraries" ON)
+
+#correct was to set a default build type
+# https://blog.kitware.com/cmake-and-the-default-build-type/
+set(default_build_type "Release")
+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ message(STATUS "No build type was set. Setting build type to ${default_build_type}.")
+ set(CMAKE_BUILD_TYPE ${default_build_type} CACHE
+ STRING "Choose the type to build" FORCE)
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
+ "MinSizeRel" "RelWithDebInfo")
+endif()
+
+
+include(GNUInstallDirs)
+include(CTest)
+
+find_package(OpenMP REQUIRED)
+
+
+add_library(arc
+ src/arc.c
+ src/galois.c
+ src/jerasure.c
+ src/reed_sol.c
+ )
+target_link_libraries(
+ arc
+ PUBLIC
+ OpenMP::OpenMP_C
+ m
+ )
+target_include_directories(
+ arc
+ PUBLIC
+ $
+ $
+ )
+
+install(TARGETS arc EXPORT ARCConfig
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ )
+install(EXPORT ARCConfig NAMESPACE ARC:: DESTINATION ${CMAKE_INSTALL_DATADIR}/ARC/cmake)
+install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ARC)
+
+if(BUILD_TESTING)
+ add_subdirectory(test)
+endif()
+option(BUILD_EXAMPLES "build example codes" OFF)
+if(BUILD_EXAMPLES)
+ add_subdirectory(examples)
+endif()
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 2c00cfa..0000000
--- a/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-## ************************************************************************
-## Makefile for the ARC: Automatic Reliability for Compression library.
-
-## COMPILER
-CC = gcc
-CFLAGS = -O2
-
-## TARGETS
-all: arc_lib.o
-
-arc.h: include/arc.h
- rm -f src/arc.h ; cp include/arc.h src/. ; chmod 0444 src/arc.h
-
-galois.h: include/galois.h
- rm -f src/galois.h ; cp include/galois.h src/. ; chmod 0444 src/galois.h
-
-jerasure.h: include/jerasure.h
- rm -f src/jerasure.h ; cp include/jerasure.h src/. ; chmod 0444 src/jerasure.h
-
-reed_sol.h: include/reed_sol.h
- rm -f src/reed_sol.h ; cp include/reed_sol.h src/. ; chmod 0444 src/reed_sol.h
-
-galois.o: galois.h
- $(CC) -c src/galois.c
-
-jerasure.o: jerasure.h galois.h
- $(CC) -c src/jerasure.c
-
-reed_sol.o: reed_sol.h jerasure.h galois.h
- $(CC) -c src/reed_sol.c
-
-arc.o: arc.h jerasure.h reed_sol.h galois.h
- $(CC) -c src/arc.c -fopenmp
-
-arc_lib.o: arc.o galois.o jerasure.o reed_sol.o
- ar -rc lib64/libarc.a arc.o galois.o jerasure.o reed_sol.o
- rm arc.o galois.o jerasure.o reed_sol.o
-
-clean:
- rm -f src/arc.h src/galois.h src/jerasure.h src/reed_sol.h
- rm lib64/libarc.a
\ No newline at end of file
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 0000000..092633f
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1,17 @@
+
+find_package(LibPressio REQUIRED)
+find_package(std_compat REQUIRED)
+find_package(SZ REQUIRED)
+find_package(PkgConfig REQUIRED)
+find_package(ZLIB REQUIRED)
+pkg_search_module(ZSTD IMPORTED_TARGET GLOBAL libzstd)
+pkg_search_module(FFTW3 QUIET IMPORTED_TARGET GLOBAL fftw3)
+
+add_executable(arc_pressio_example arc_pressio_example.c)
+target_link_libraries(arc_pressio_example PRIVATE arc LibPressio::libpressio SZ)
+
+add_executable(libpressio_example_sz libpressio_example_sz.c)
+target_link_libraries(libpressio_example_sz PRIVATE arc LibPressio::libpressio SZ)
+
+add_executable(libpressio_example_zfp libpressio_example_zfp.c)
+target_link_libraries(libpressio_example_zfp PRIVATE arc LibPressio::libpressio SZ)
diff --git a/examples/Makefile b/examples/Makefile
deleted file mode 100644
index 264bd06..0000000
--- a/examples/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-## ************************************************************************
-## Makefile for arc_sz_example that demonstrates the use case of arc in
-## conjunction with libPressio.
-
-## PLEASE UPDATE THESE VARIABLES BEFORE COMPILING
-
-## COMPILER
-CC = gcc
-
-## Libpressio flags
-LIBPRESSIO_INCLUDE_ol7_sandybridge = /zfs/ftdice/spack/opt/spack/linux-ol7-sandybridge/gcc-8.2.0/libpressio-0.38.1-6bphbkmsnbfp4zxvgxn3a6al6cmmk4jl
-LIBPRESSIO_SO_PATH_ol7_sandybridge = /zfs/ftdice/spack/opt/spack/linux-ol7-sandybridge/gcc-8.2.0/libpressio-0.38.1-6bphbkmsnbfp4zxvgxn3a6al6cmmk4jl/lib64
-## SZ flags
-SZ_INCLUDE_ol7_sandybridge = /zfs/ftdice/spack/opt/spack/linux-ol7-sandybridge/gcc-8.2.0/sz-2.1.8.1-hnjxctv4winw52xm2eeyucatpizag4cl
-SZ_SO_PATH_ol7_sandybridge = /zfs/ftdice/spack/opt/spack/linux-ol7-sandybridge/gcc-8.2.0/sz-2.1.8.1-hnjxctv4winw52xm2eeyucatpizag4cl/lib64
-## ZFP flags
-ZFP_INCLUDE_ol7_sandybridge = /zfs/ftdice/spack/opt/spack/linux-ol7-sandybridge/gcc-8.2.0/zfp-0.5.5-dycqslvmlpomptwjg52nt4zeoiqtcmun
-ZFP_SO_PATH_ol7_sandybridge = /zfs/ftdice/spack/opt/spack/linux-ol7-sandybridge/gcc-8.2.0/zfp-0.5.5-dycqslvmlpomptwjg52nt4zeoiqtcmun/lib64
-## FPZIP flags
-FPZIP_INCLUDE_ol7_sandybridge = /zfs/ftdice/spack/opt/spack/linux-ol7-sandybridge/gcc-8.2.0/fpzip-1.3.0-hzhhfannwjcokyjokrs4q7oojxphwya6
-FPZIP_SO_PATH_ol7_sandybridge = /zfs/ftdice/spack/opt/spack/linux-ol7-sandybridge/gcc-8.2.0/fpzip-1.3.0-hzhhfannwjcokyjokrs4q7oojxphwya6/lib64
-## ARC flags
-ARC_INCLUDE = /home/dakotaf/ARC/include
-ARC_SO_PATH = /home/dakotaf/ARC/lib64
-
-## Compilation Includes
-FLAGS_ol7_sandybridge = -I $(LIBPRESSIO_INCLUDE_ol7_sandybridge)/include/libpressio -I $(SZ_INCLUDE_ol7_sandybridge)/include/sz -I $(ZFP_INCLUDE_ol7_sandybridge)/include -I $(FPZIP_INCLUDE_ol7_sandybridge)/include -I $(ARC_INCLUDE) -L $(LIBPRESSIO_SO_PATH_ol7_sandybridge) -L $(SZ_SO_PATH_ol7_sandybridge) -L $(ZFP_SO_PATH_ol7_sandybridge) -L $(FPZIP_SO_PATH_ol7_sandybridge) -L $(ARC_SO_PATH) -llibpressio -lSZ -lzfp -lfpzip -larc -lm
-
-## TARGETS
-all: arc_pressio_example
-
-arc_pressio_example: arc_pressio_example.c
- $(CC) -Wall -g -rdynamic -o arc_pressio_example arc_pressio_example.c $(FLAGS_ol7_sandybridge)
-clean:
- rm arc_pressio_example
-
diff --git a/examples/arc_pressio_example.c b/examples/arc_pressio_example.c
index d4d0f07..1baea70 100644
--- a/examples/arc_pressio_example.c
+++ b/examples/arc_pressio_example.c
@@ -83,7 +83,7 @@ int main(int argc, char* argv[]) {
}
// Utilize ARC library
- arc_init_w_timing(1);
+ arc_init(1);
// Get a pointer to uint8_t data from libPressio
size_t compressed_size;
@@ -98,8 +98,10 @@ int main(int argc, char* argv[]) {
double time_constraint = atof(argv[2]);
uint8_t * arc_encoded_data;
uint32_t arc_encoded_data_size;
+ int num_choices = 1;
+ int ecc_choices[] = {ARC_ANY_ECC};
gettimeofday(&start, NULL);
- ret = arc_encode(data, (uint32_t)compressed_size, memory_constraint, time_constraint, &arc_encoded_data, &arc_encoded_data_size);
+ ret = arc_encode(data, (uint32_t)compressed_size, memory_constraint, time_constraint, ecc_choices, num_choices, &arc_encoded_data, &arc_encoded_data_size);
gettimeofday(&stop, NULL);
encode_time_taken = (double)(stop.tv_usec - start.tv_usec) / 1000000 + (double)(stop.tv_sec - start.tv_sec);
if (ret == 0){
diff --git a/include/arc.h b/include/arc.h
index 33e4ca0..dbe54ff 100644
--- a/include/arc.h
+++ b/include/arc.h
@@ -1,3 +1,7 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include
#include
#include
@@ -53,4 +57,8 @@ uint8_t arc_calculate_secded_uint8 (uint8_t byte);
int arc_secded_encode(uint8_t* data, uint32_t data_size, uint32_t block_size, uint32_t threads, uint8_t** encoded_data, uint32_t* encoded_data_size);
int arc_secded_decode(uint8_t* encoded_data, uint32_t encoded_data_size, uint8_t** data, uint32_t* data_size);
int arc_reed_solomon_encode(uint8_t* data, uint32_t data_size, uint32_t data_devices, uint32_t code_devices, uint32_t threads, uint8_t** encoded_data, uint32_t* encoded_data_size);
-int arc_reed_solomon_decode(uint8_t* encoded_data, uint32_t encoded_data_size, uint8_t** data, uint32_t *data_size);
\ No newline at end of file
+int arc_reed_solomon_decode(uint8_t* encoded_data, uint32_t encoded_data_size, uint8_t** data, uint32_t *data_size);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/include/galois.h b/include/galois.h
index b08fd94..cf165a1 100755
--- a/include/galois.h
+++ b/include/galois.h
@@ -1,3 +1,6 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Galois.h
* James S. Plank
@@ -109,3 +112,6 @@ void galois_w32_region_multiply(char *region, /* Region to multiply */
int add); /* If (r2 != NULL && add) the produce is XOR'd with r2 */
#endif
+#ifdef __cplusplus
+}
+#endif
diff --git a/include/jerasure.h b/include/jerasure.h
index 8cc25ca..e3f5b8c 100755
--- a/include/jerasure.h
+++ b/include/jerasure.h
@@ -1,3 +1,6 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
/* jerasure.h - header of kernel procedures
* James S. Plank
@@ -298,3 +301,6 @@ int *jerasure_matrix_multiply(int *m1, int *m2, int r1, int c1, int r2, int c2,
void jerasure_get_stats(double *fill_in);
#endif
+#ifdef __cplusplus
+}
+#endif
diff --git a/include/reed_sol.h b/include/reed_sol.h
index 741c317..f0371c4 100755
--- a/include/reed_sol.h
+++ b/include/reed_sol.h
@@ -1,3 +1,6 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
/* reed_sol.h
* James S. Plank
@@ -57,3 +60,6 @@ extern int *reed_sol_r6_coding_matrix(int k, int w);
extern void reed_sol_galois_w08_region_multby_2(char *region, int nbytes);
extern void reed_sol_galois_w16_region_multby_2(char *region, int nbytes);
extern void reed_sol_galois_w32_region_multby_2(char *region, int nbytes);
+#ifdef __cplusplus
+}
+#endif
diff --git a/lib64/libarc.a b/lib64/libarc.a
deleted file mode 100644
index 4e41e7f..0000000
Binary files a/lib64/libarc.a and /dev/null differ
diff --git a/src/arc.c b/src/arc.c
index 5be0a64..9e6d533 100644
--- a/src/arc.c
+++ b/src/arc.c
@@ -1,4 +1,6 @@
// Libraries
+#include
+#include
#include "arc.h"
#include "jerasure.h"
#include "reed_sol.h"
@@ -49,18 +51,57 @@ int RS_ID = 4;
// Resource Variables Section
// ###########################
// Resource Folder Location
-char *resource_location = "/home/dakotaf/ARC/src/res/";
-// Cache Resource Folder Location
-char *cache_resource_location = "/home/dakotaf/ARC/src/res/cache/";
+
+// path to cache directories
+char *cache_resource_location = NULL;
// Set configuration information cache string
char *thread_resource_file = "_information_cache.csv";
// Hamming & SECDED Resource Variables
-uint8_t H_S_1_Parity_Matrix[4];
-uint64_t H_S_8_Parity_Matrix[7];
-uint8_t H_1_Syndrome_Table[16];
-uint8_t H_8_Syndrome_Table[72];
-uint8_t S_1_Syndrome_Table[16];
-uint8_t S_8_Syndrome_Table[72];
+const uint8_t H_S_1_Parity_Matrix[4] = {
+ 0x5B,
+ 0x6D,
+ 0x8E,
+ 0xF0
+};
+const uint64_t H_S_8_Parity_Matrix[7] = {
+ 0xAB55555556AAAD5B,
+ 0xCD9999999B33366D,
+ 0xF1E1E1E1E3C3C78E,
+ 0x01FE01FE03FC07F0,
+ 0x01FFFE0003FFF800,
+ 0x01FFFFFFFC000000,
+ 0xFE00000000000000
+};
+const uint8_t H_1_Syndrome_Table[16] = {
+ 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x0B, 0x0C,
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
+};
+const uint8_t H_8_Syndrome_Table[72] = {
+ 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x0B, 0x0C,
+ 0x0D, 0x0E, 0x0F, 0x11, 0x12, 0x13, 0x14, 0x15,
+ 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,
+ 0x1E, 0x1F, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
+ 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E,
+ 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
+ 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E,
+ 0x3F, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
+};
+const uint8_t S_1_Syndrome_Table[16] = {
+ 0x13, 0x15, 0x16, 0x07, 0x19, 0x1A, 0x0B, 0x1C,
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
+};
+const uint8_t S_8_Syndrome_Table[72] = {
+ 0x83, 0x85, 0x86, 0x07, 0x89, 0x8A, 0x0B, 0x8C,
+ 0x0D, 0x0E, 0x8F, 0x91, 0x92, 0x13, 0x94, 0x15,
+ 0x16, 0x97, 0x98, 0x19, 0x1A, 0x9B, 0x1C, 0x9D,
+ 0x9E, 0x1F, 0xA1, 0xA2, 0x23, 0xA4, 0x25, 0x26,
+ 0xA7, 0xA8, 0x29, 0x2A, 0xAB, 0x2C, 0xAD, 0xAE,
+ 0x2F, 0xB0, 0x31, 0x32, 0xB3, 0x34, 0xB5, 0xB6,
+ 0x37, 0x38, 0xB9, 0xBA, 0x3B, 0xBC, 0x3D, 0x3E,
+ 0xBF, 0xC1, 0xC2, 0x43, 0xC4, 0x45, 0x46, 0xC7,
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
+};
// ARC Decision Variables Section
// ###############################
@@ -138,103 +179,6 @@ void arc_help(){
// return:
// x - Success=1, Failure=0
int arc_resource_init(){
- FILE *fp;
- int i;
- char * resource_file = "Hamming_SECDED_1_Parity_Matrix";
- // Setup H_S_1_Parity_Matrix with resources file
- char * file_location = concat(resource_location, resource_file);
- fp = fopen(file_location, "r");
- if(fp == NULL){
- printf("Error opening res/Hamming_SECDED_1_Parity_Matrix\n");
- return 0;
- }
- uint8_t Parity_1;
- for (i = 0; i < 4; i++){
- fscanf(fp, "%hhX", &Parity_1);
- H_S_1_Parity_Matrix[i] = Parity_1;
- }
- fclose(fp);
- free(file_location);
-
- // Setup H_1_Syndrome_Table with resources file
- resource_file = "Hamming_1_Syndrome_Table";
- file_location = concat(resource_location, resource_file);
- fp = fopen(file_location, "r");
- if(fp == NULL){
- printf("Error opening res/Hamming_1_Syndrome_Table\n");
- return 0;
- }
- uint8_t Snydrome_1;
- for (i = 0; i < 16; i++){
- fscanf(fp, "%hhX", &Snydrome_1);
- H_1_Syndrome_Table[i] = Snydrome_1;
- }
- fclose(fp);
- free(file_location);
-
- // Setup S_1_Syndrome_Table with resources file
- resource_file = "SECDED_1_Syndrome_Table";
- file_location = concat(resource_location, resource_file);
- fp = fopen(file_location, "r");
- if(fp == NULL){
- printf("Error opening res/SECDED_1_Syndrome_Table\n");
- return 0;
- }
- for (i = 0; i < 16; i++){
- fscanf(fp, "%hhX", &Snydrome_1);
- S_1_Syndrome_Table[i] = Snydrome_1;
- }
- fclose(fp);
- free(file_location);
-
- // Setup H_S_8_Parity_Matrix with resources file
- resource_file = "Hamming_SECDED_8_Parity_Matrix";
- file_location = concat(resource_location, resource_file);
- fp = fopen(file_location, "r");
- if(fp == NULL){
- printf("Error opening res/Hamming_SECDED_8_Parity_Matrix\n");
- return 0;
- }
- uint64_t Parity_8;
- for (i = 0; i < 7; i++){
- fscanf(fp, "%"PRIx64, &Parity_8);
- H_S_8_Parity_Matrix[i] = Parity_8;
- }
- fclose(fp);
- free(file_location);
-
- // Setup H_8_Syndrome_Table with resources file
- resource_file = "Hamming_8_Syndrome_Table";
- file_location = concat(resource_location, resource_file);
- fp = fopen(file_location, "r");
- if(fp == NULL){
- printf("Error opening res/Hamming_8_Syndrome_Table\n");
- return 0;
- }
- uint8_t Snydrome_8;
- for (i = 0; i < 72; i++){
- fscanf(fp, "%hhX", &Snydrome_8);
- H_8_Syndrome_Table[i] = Snydrome_8;
- }
- fclose(fp);
- free(file_location);
-
- // Setup S_8_Syndrome_Table with resources file
- resource_file = "SECDED_8_Syndrome_Table";
- file_location = concat(resource_location, resource_file);
- fp = fopen(file_location, "r");
- if(fp == NULL){
- printf("Error opening res/SECDED_8_Syndrome_Table\n");
- return 0;
- }
- for (i = 0; i < 72; i++){
- fscanf(fp, "%hhX", &Snydrome_8);
- S_8_Syndrome_Table[i] = Snydrome_8;
- }
- fclose(fp);
- free(file_location);
-
- // Set INIT to True
printf("ARC Resource Files Initialized\n");
INIT = 1;
return 1;
@@ -253,6 +197,22 @@ int arc_init(uint32_t max_threads){
if(err == 0){
return 0;
}
+ const char* base;
+ const char* xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
+ if( xdg_runtime_dir == NULL) {
+ const char* tmp_dir = getenv("TMPDIR");
+ if(tmp_dir == NULL) {
+ base = tmp_dir;
+ } else {
+ base = "/tmp";
+ }
+ } else {
+ base = xdg_runtime_dir;
+ }
+ cache_resource_location = concat(base, "/arc");
+ if(mkdir(cache_resource_location, S_IRWXU | S_IRWXG) && errno != EEXIST) {
+ return 0;
+ }
// Turn off print outs
PRINT = 0;
@@ -2812,7 +2772,7 @@ int arc_reed_solomon_encode(uint8_t* data, uint32_t data_size, uint32_t data_dev
int remainder_block;
int longs_processed = 0;
int current_blocks_longs;
- long temp_l;
+ uint64_t temp_l;
uint32_t current_block_data_devices;
// Set current block size (data devices for this block)
@@ -2842,14 +2802,14 @@ int arc_reed_solomon_encode(uint8_t* data, uint32_t data_size, uint32_t data_dev
(longs_processed == current_blocks_longs-1 && blocks_processed == block_count-1 && remainder_long_in_data == 0)){
temp_l = 0;
for (j = 0; j < 8; j++){
- temp_l = temp_l | ((long)data[current_block_data_index] << (64-(8*(j+1))));
+ temp_l = temp_l | ((uint64_t)data[current_block_data_index] << (64-(8*(j+1))));
current_block_data_index++;
}
longs_processed++;
} else {
temp_l = 0;
for (j = 0; j < remainder_long_in_data; j++){
- temp_l = temp_l | ((long)data[current_block_data_index] << (64-(8*(j+1))));
+ temp_l = temp_l | ((uint64_t)data[current_block_data_index] << (64-(8*(j+1))));
current_block_data_index++;
}
longs_processed++;
@@ -3275,5 +3235,3 @@ int arc_reed_solomon_decode(uint8_t* encoded_data, uint32_t encoded_data_size, u
// Return resulting array and decode success value
return decode_success;
}
-
-
diff --git a/src/res/.gitignore b/src/res/.gitignore
new file mode 100644
index 0000000..afed073
--- /dev/null
+++ b/src/res/.gitignore
@@ -0,0 +1 @@
+*.csv
diff --git a/src/res/Hamming_1_Syndrome_Table b/src/res/Hamming_1_Syndrome_Table
deleted file mode 100644
index 460d509..0000000
--- a/src/res/Hamming_1_Syndrome_Table
+++ /dev/null
@@ -1,16 +0,0 @@
-03
-05
-06
-07
-09
-0A
-0B
-0C
-01
-02
-04
-08
-10
-20
-40
-80
diff --git a/src/res/Hamming_8_Syndrome_Table b/src/res/Hamming_8_Syndrome_Table
deleted file mode 100644
index 8079a2d..0000000
--- a/src/res/Hamming_8_Syndrome_Table
+++ /dev/null
@@ -1,72 +0,0 @@
-03
-05
-06
-07
-09
-0A
-0B
-0C
-0D
-0E
-0F
-11
-12
-13
-14
-15
-16
-17
-18
-19
-1A
-1B
-1C
-1D
-1E
-1F
-21
-22
-23
-24
-25
-26
-27
-28
-29
-2A
-2B
-2C
-2D
-2E
-2F
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-3A
-3B
-3C
-3D
-3E
-3F
-41
-42
-43
-44
-45
-46
-47
-01
-02
-04
-08
-10
-20
-40
-80
diff --git a/src/res/Hamming_SECDED_1_Parity_Matrix b/src/res/Hamming_SECDED_1_Parity_Matrix
deleted file mode 100644
index 53aac01..0000000
--- a/src/res/Hamming_SECDED_1_Parity_Matrix
+++ /dev/null
@@ -1,4 +0,0 @@
-5B
-6D
-8E
-F0
\ No newline at end of file
diff --git a/src/res/Hamming_SECDED_8_Parity_Matrix b/src/res/Hamming_SECDED_8_Parity_Matrix
deleted file mode 100644
index 38b1359..0000000
--- a/src/res/Hamming_SECDED_8_Parity_Matrix
+++ /dev/null
@@ -1,7 +0,0 @@
-AB55555556AAAD5B
-CD9999999B33366D
-F1E1E1E1E3C3C78E
-01FE01FE03FC07F0
-01FFFE0003FFF800
-01FFFFFFFC000000
-FE00000000000000
\ No newline at end of file
diff --git a/src/res/README.md b/src/res/README.md
deleted file mode 100644
index e69de29..0000000
diff --git a/src/res/SECDED_1_Syndrome_Table b/src/res/SECDED_1_Syndrome_Table
deleted file mode 100644
index 5f836ac..0000000
--- a/src/res/SECDED_1_Syndrome_Table
+++ /dev/null
@@ -1,16 +0,0 @@
-13
-15
-16
-07
-19
-1A
-0B
-1C
-01
-02
-04
-08
-10
-20
-40
-80
diff --git a/src/res/SECDED_8_Syndrome_Table b/src/res/SECDED_8_Syndrome_Table
deleted file mode 100644
index a3e0396..0000000
--- a/src/res/SECDED_8_Syndrome_Table
+++ /dev/null
@@ -1,72 +0,0 @@
-83
-85
-86
-07
-89
-8A
-0B
-8C
-0D
-0E
-8F
-91
-92
-13
-94
-15
-16
-97
-98
-19
-1A
-9B
-1C
-9D
-9E
-1F
-A1
-A2
-23
-A4
-25
-26
-A7
-A8
-29
-2A
-AB
-2C
-AD
-AE
-2F
-B0
-31
-32
-B3
-34
-B5
-B6
-37
-38
-B9
-BA
-3B
-BC
-3D
-3E
-BF
-C1
-C2
-43
-C4
-45
-46
-C7
-01
-02
-04
-08
-10
-20
-40
-80
diff --git a/src/res/cache/README.md b/src/res/cache/README.md
deleted file mode 100644
index 02c4f43..0000000
--- a/src/res/cache/README.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# ARC Training Cache
-
-For ARC to be able to accurately determine which error-correcting code approach to use, ARC uses stored training data that is collected during the first run of the arc_init function. These results are stored within this folder using the following file format:
-```
-{#_of_threads}_information_cache.csv
-```
-The contents of these files are stuctured as follows:
-```
-ecc_algorithm,ecc_parameter_a,ecc_parameter_b,num_threads,memory_overhead,throughput_overhead
-```
-Such that,
-```
-ecc_algorithm : 1 - 4 (1=Parity,2=Hamming,3=SECDED,4=RS)
-ecc_parameter_a : The first parameter for the desired ecc algorithm. Ususally in the form of block size
-ecc_parameter_b : The second parameter for the desired ecc algorithm. Used primarily with RS encoding and holds the number of code devices in this case.
-num_threads : number of threads used, same as #_of_threads in file name
-memory_overhead : The amount of memory overhead introduced from using this ECC configuration.
-throughput_overhead : The average bandwidth achieved when using this ECC configuration.
-```
-By seperating the training data based on the number of threads used, ARC is able to reuse the data obtained when training on a lower number of threads when using a higher number of threads at a later instance. For example, if training was done initially with a maximum of 4 threads but later was changed to a maximum of 8 threads, the training results from threads 1-4 would be reused and only training on threads 5-8 would be done, therefore saving training time.
-
-### Note:
-
-In order to fully retrain on a system, all results within this folder must be deleted.
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..c28aa2a
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,12 @@
+
+add_executable(arc_test arc_test.c)
+add_executable(interactive_arc_test interactive_arc_test.c)
+add_executable(interactive_arc_front_test interactive_arc_front_test.c)
+add_executable(openmp_test openmp_test.c)
+target_link_libraries(arc_test PRIVATE arc)
+target_link_libraries(interactive_arc_test PRIVATE arc)
+target_link_libraries(interactive_arc_front_test PRIVATE arc)
+target_link_libraries(openmp_test PRIVATE arc)
+
+add_test(arc_test arc_test)
+add_test(openmp_test openmp_test)
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644
index 5bde9db..0000000
--- a/test/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-## ************************************************************************
-## Makefile for arc_sz_example that demonstrates the use case of arc in
-## conjunction with libPressio.
-
-## PLEASE UPDATE THESE VARIABLES BEFORE COMPILING
-
-## COMPILER
-CC = gcc
-
-## ARC flags
-ARC_INCLUDE = ../include
-ARC_LIB_PATH = ../lib64
-
-## TARGETS
-all: arc_test interactive_arc_test interactive_arc_front_test #openmp_test
-
-arc_test: arc_test.c
- $(CC) -Wall -g -o arc_test arc_test.c -I $(ARC_INCLUDE) -L $(ARC_LIB_PATH) -larc -lm -fopenmp
-
-interactive_arc_test: interactive_arc_test.c
- $(CC) -Wall -g -o interactive_arc_test interactive_arc_test.c -I $(ARC_INCLUDE) -L $(ARC_LIB_PATH) -larc -lm -fopenmp
-
-interactive_arc_front_test: interactive_arc_front_test.c
- $(CC) -Wall -g -o interactive_arc_front_test interactive_arc_front_test.c -I $(ARC_INCLUDE) -L $(ARC_LIB_PATH) -larc -lm -fopenmp
-
-openmp_test: openmp_test.c
- $(CC) -Wall -g -o openmp_test openmp_test.c -I $(ARC_INCLUDE) -L $(ARC_LIB_PATH) -larc -lm -fopenmp
-
-clean:
- rm arc_test
- rm interactive_arc_test
- rm interactive_arc_front_test
- #rm openmp_test
-