Commit 0fcf5271 authored by Pablo's avatar Pablo
Browse files

Some fixes

Showing with 46 additions and 45 deletions
+46 -45
......@@ -25,9 +25,12 @@ endif (ENABLE_HDFS)
if(ENABLE_IMSS)
MESSAGE(STATUS "Added support for IMSS")
add_definitions(-DASPIDE_SUPPORT_IMSS)
add_subdirectory(vendors/lib-imss)
include(FindPkgConfig)
pkg_check_modules(GLIB glib-2.0 REQUIRED)
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/vendors/lib-imss/inc")
INCLUDE_DIRECTORIES( "${PROJECT_SOURCE_DIR}/include/imss")
INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/vendors/lib-imss/inc")
LINK_DIRECTORIES("${PROJECT_BINARY_DIR}/vendors/lib-imss/app")
add_subdirectory(vendors/lib-imss)
endif(ENABLE_IMSS)
......
......@@ -9,14 +9,8 @@ endif (ENABLE_HDFS)
if(ENABLE_IMSS)
include(FindPkgConfig)
pkg_check_modules(GLIB glib-2.0 REQUIRED)
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/vendors/lib-imss/inc")
LINK_DIRECTORIES("${PROJECT_BINARY_DIR}/vendors/lib-imss/app")
link_directories(${IMSS_BUILD_PATH})
file(GLOB cont_imss "imss/*.cpp")
list(APPEND base_link ${MPI_LIBRARIES} imss ${GLIB_LIBRARIES})
message (STATUS "IMSS enabled " ${IMSS_BUILD_PATH})
endif(ENABLE_IMSS)
#Base text container srcs
......
......@@ -6,14 +6,16 @@
#ifdef ASPIDE_SUPPORT_IMSS
#include "imss.h"
#include "hercules.h"
#endif
#include "mpi.h"
//Test IMSS deploy
void deploy_imss_test(char ** data, int dlen);
bool imss = false;
int32_t datasetd;
bool imss_ = false;
int32_t datasetd_;
int rank;
int main(int argc, char ** argv){
......@@ -65,11 +67,11 @@ int main(int argc, char ** argv){
std::cout << a_occ << '\n';
#ifdef ASPIDE_SUPPORT_IMSS
if(imss){
release_dataset(datasetd)
if(imss_){
release_dataset(datasetd_);
release_imss(argv[1], CLOSE_ATTACHED);
release_stat();
hercules_release();
stat_release();
hercules_release(rank);
MPI_Barrier(MPI_COMM_WORLD);
MPI_Finalize();
}
......@@ -86,18 +88,17 @@ int main(int argc, char ** argv){
void deploy_imss_test(char ** data, int dlen){
//Check args number
if(dlen != 4) exit(-1);
if(dlen != 3) exit(-1);
//Itit MPI
MPI_Init(NULL, NULL);
imss = true;
imss_ = true;
int rank;
//Get MPI rank
MPI_Comm_rank(MPI_COMM_WORLD, &rank)
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
//Hercules init -- Attached deploy
if (hercules_init(rank, 2048, 5555, 5569, 1024, "./metadata") == -1) return -1;
if (hercules_init(rank, 2048, 5555, 5569, 1024, "./metadata") == -1) exit(-1);
//Metadata server
if (stat_init(data[1], 5569, rank) == -1) exit(-1);
......@@ -106,7 +107,7 @@ void deploy_imss_test(char ** data, int dlen){
if (init_imss(data[0], data[2], 4, 5555, 1024, ATTACHED, NULL) == -1) exit(-1);
//Create dataset, 1 Block of 1 Kbyte
if ((datasetd = create_dataset(data[0], "RR", 3, 1, NONE)) < 0) exit(-1);
if ((datasetd_ = create_dataset(data[0], "RR", 3, 1, NONE)) < 0) exit(-1);
//Dump data -- Remark: DATA MUST BE IN DYNAMIC MEMORY
for(int i = 0; i < 3; ++i){
......@@ -118,7 +119,7 @@ void deploy_imss_test(char ** data, int dlen){
memcpy(buffer, testdata, strlen(testdata));
//Set the data in 2 Blocks
int32_t data_sent = set_data(datasetd, i, (unsigned char*)buffer);
int32_t data_sent = set_data(datasetd_, i, (unsigned char*)buffer);
}
}
......
#include "text_in_container.hpp"
#include <iostream>
#include <string.h>
#include "mpi.h"
#ifdef ASPIDE_SUPPORT_IMSS
#include "imss.h"
#include "mpi.h"
#include "hercules.h"
#endif
/*
......@@ -16,8 +17,9 @@
*/
void deploy_imss_test(char ** data, int dlen);
bool imss = false;
int32_t datasetd;
bool imss_ = false;
int32_t datasetd_;
int rank;
int main(int argc, char ** argv){
......@@ -70,11 +72,11 @@ int main(int argc, char ** argv){
for(auto line : mytest) std::cout << line << std::endl;
#ifdef ASPIDE_SUPPORT_IMSS
if(imss){
release_dataset(datasetd)
if(imss_){
release_dataset(datasetd_);
release_imss(argv[1], CLOSE_ATTACHED);
release_stat();
hercules_release();
stat_release();
hercules_release(rank);
MPI_Barrier(MPI_COMM_WORLD);
MPI_Finalize();
}
......@@ -91,27 +93,27 @@ int main(int argc, char ** argv){
void deploy_imss_test(char ** data, int dlen){
//Check args number
if(dlen != 4) exit(-1);
if(dlen != 3) exit(-1);
//Itit MPI
MPI_Init(NULL, NULL);
imss = true;
//MPI_Init(NULL, NULL);
imss_ = true;
int rank;
//Get MPI rank
MPI_Comm_rank(MPI_COMM_WORLD, &rank)
//MPI_Comm_rank(MPI_COMM_WORLD, &rank);
rank = 0;
//Hercules init -- Attached deploy
if (hercules_init(rank, 2048, 5555, 5569, 1024, "./metadata") == -1) return -1;
if (hercules_init(rank, 2048, 5555, 5569, 1024, "./metadata") == -1) exit(-1);
//Metadata server
if (stat_init(data[1], 5569, rank) == -1) exit(-1);
//Imss deploy
if (init_imss(data[0], data[2], 4, 5555, 1024, ATTACHED, NULL) == -1) exit(-1);
if (init_imss("imss://", data[2], 1, 5555, 1024, ATTACHED, NULL) == -1) exit(-1);
//Create dataset, 1 Block of 1 Kbyte
if ((datasetd = create_dataset(data[0], "RR", 3, 1, NONE)) < 0) exit(-1);
if ((datasetd_ = create_dataset(data[0], "RR", 3, 1, NONE)) < 0) exit(-1);
//Dump data -- Remark: DATA MUST BE IN DYNAMIC MEMORY
for(int i = 0; i < 3; ++i){
......@@ -123,8 +125,9 @@ void deploy_imss_test(char ** data, int dlen){
memcpy(buffer, testdata, strlen(testdata));
//Set the data in 2 Blocks
int32_t data_sent = set_data(datasetd, i, (unsigned char*)buffer);
int32_t data_sent = set_data(datasetd_, i, (unsigned char*)buffer);
}
release_dataset(datasetd_);
}
#endif
\ No newline at end of file
#endif
......@@ -14,7 +14,7 @@
void deploy_imss_test(char ** data, int dlen);
bool imss_ = false;
int32_t datasetd;
int32_t datasetd_;
int rank;
int main(int argc, char ** argv){
......@@ -54,7 +54,7 @@ int main(int argc, char ** argv){
#ifdef ASPIDE_SUPPORT_IMSS
if(imss_){
release_dataset(datasetd);
release_dataset(datasetd_);
release_imss(argv[1], CLOSE_ATTACHED);
stat_release();
hercules_release(rank);
......@@ -73,7 +73,7 @@ int main(int argc, char ** argv){
void deploy_imss_test(char ** data, int dlen){
//Check args number
if(dlen != 4) exit(-1);
if(dlen != 3) exit(-1);
//Itit MPI
MPI_Init(NULL, NULL);
......@@ -92,7 +92,7 @@ void deploy_imss_test(char ** data, int dlen){
if (init_imss(data[0], data[2], 4, 5555, 1024, ATTACHED, NULL) == -1) exit(-1);
//Create dataset, 1 Block of 1 Kbyte
if ((datasetd = create_dataset(data[0], "RR", 3, 1, NONE)) < 0) exit(-1);
if ((datasetd_ = create_dataset(data[0], "RR", 3, 1, NONE)) < 0) exit(-1);
//Dump data -- Remark: DATA MUST BE IN DYNAMIC MEMORY
for(int i = 0; i < 3; ++i){
......@@ -104,7 +104,7 @@ void deploy_imss_test(char ** data, int dlen){
memcpy(buffer, testdata, strlen(testdata));
//Set the data in 2 Blocks
int32_t data_sent = set_data(datasetd, i, (unsigned char*)buffer);
int32_t data_sent = set_data(datasetd_, i, (unsigned char*)buffer);
}
}
......
Subproject commit e454ea5a92b84ba3db8505f701d9bd1eb36f95ad
Subproject commit a71fb83ceb953afdb331f3ddb1e8715de0ae20f7
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment