Skip to content

Commit d4acf9c

Browse files
committed
Added capio-cl as external project
1 parent c0a4a49 commit d4acf9c

27 files changed

Lines changed: 132 additions & 1099 deletions

File tree

capio-posix/handlers/posix_readdir.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,13 @@ DIR *opendir(const char *name) {
203203
LOG("Commit token path was not found for path %s", absolute_path.c_str());
204204
auto token_path = new char[PATH_MAX]{0};
205205
posix_directory_committed_request(capio_syscall(SYS_gettid), absolute_path, token_path);
206+
// FIXME: This is a flying patch to implement the exclude with little to no overhead.
207+
// If the commit token is <NONE>, then the file is excluded and hence the directory
208+
// should not be handled by CAPIO...
209+
// TODO: Find a better solution
210+
if (strcmp(token_path, "<NONE>") == 0) {
211+
return dir;
212+
}
206213
LOG("Inserting token path %s", token_path);
207214
directory_commit_token_path.insert({absolute_path, token_path});
208215
}

capio-server/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ FetchContent_Declare(
3636
GIT_TAG v0.26.0
3737
)
3838

39+
FetchContent_Declare(
40+
capio_cl
41+
GIT_REPOSITORY https://github.com/High-Performance-IO/CAPIO-CL.git
42+
GIT_TAG main
43+
)
44+
3945

40-
FetchContent_MakeAvailable(args simdjson mtcl httplib)
46+
FetchContent_MakeAvailable(args simdjson mtcl httplib capio_cl)
4147

4248
#####################################
4349
# Target definition
@@ -59,12 +65,14 @@ target_include_directories(${TARGET_NAME} PRIVATE
5965
${simdjson_SOURCE_DIR}
6066
${mtcl_SOURCE_DIR}/include
6167
${httplib_SOURCE_DIR}
68+
${capio_cl_SOURCE_DIR}
69+
${capio_cl_SOURCE_DIR}/include
6270
)
6371

6472
#####################################
6573
# Link libraries
6674
#####################################
67-
target_link_libraries(${TARGET_NAME} PRIVATE ${MPI_LIBRARIES} pthread rt stdc++fs)
75+
target_link_libraries(${TARGET_NAME} PRIVATE ${MPI_LIBRARIES} pthread rt stdc++fs libcapio_cl)
6876

6977
#####################################
7078
# Install rules

capio-server/capio_server.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,25 @@
1313
#include <unistd.h>
1414
#include <unordered_set>
1515

16+
#include <capiocl.hpp>
17+
#include <engine.h>
18+
#include <parser.h>
19+
capiocl::engine::Engine *capio_cl_engine;
20+
21+
#include <include/utils/configuration.hpp>
22+
CapioGlobalConfiguration *capio_global_configuration;
23+
1624
#include "capio/env.hpp"
1725
#include "capio/logger.hpp"
1826
#include "capio/semaphore.hpp"
1927
#include "include/api-server/api-server.hpp"
2028

21-
#include <include/capio-cl-engine/capio_cl_engine.hpp>
22-
#include <include/capio-cl-engine/json_parser.hpp>
2329
#include <include/client-manager/client_manager.hpp>
2430
#include <include/client-manager/request_handler_engine.hpp>
2531
#include <include/file-manager/file_manager.hpp>
2632
#include <include/file-manager/fs_monitor.hpp>
2733
#include <include/storage-service/capio_storage_service.hpp>
2834
#include <include/utils/command_line_parser.hpp>
29-
#include <include/utils/configuration.hpp>
3035
#include <include/utils/signals.hpp>
3136

3237
int main(int argc, char **argv) {
@@ -41,8 +46,12 @@ int main(int argc, char **argv) {
4146

4247
START_LOG(gettid(), "call()");
4348
setup_signal_handlers();
49+
capio_global_configuration = new CapioGlobalConfiguration();
50+
capio_cl_engine =
51+
capiocl::parser::Parser::parse(config_path, std::filesystem::path(resolve_prefix));
4452

45-
capio_cl_engine = JsonParser::parse(config_path, std::filesystem::path(resolve_prefix));
53+
capio_global_configuration->workflow_name = capio_cl_engine->getWorkflowName();
54+
capio_global_configuration->CAPIO_SERVER_MAIN_PID = gettid();
4655
shm_canary = new CapioShmCanary(capio_global_configuration->workflow_name);
4756
api_server = new CapioAPIServer(6666);
4857
file_manager = new CapioFileManager();

capio-server/include/capio-cl-engine/capio_cl_engine.hpp

Lines changed: 0 additions & 93 deletions
This file was deleted.

capio-server/include/capio-cl-engine/json_parser.hpp

Lines changed: 0 additions & 44 deletions
This file was deleted.

capio-server/include/storage-service/capio_storage_service.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define CAPIO_STORAGE_SERVICE_H
33

44
#include <capio/env.hpp>
5-
#include <include/capio-cl-engine/capio_cl_engine.hpp>
5+
#include <unordered_map>
66
#include <include/storage-service/capio_file.hpp>
77

88
class CapioStorageService {

capio-server/include/utils/configuration.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <limits.h>
88
#include <string>
99
#include <unistd.h>
10+
#include <sys/types.h>
1011

1112
/*
1213
* Variables required to be globally available
@@ -23,12 +24,12 @@ class CapioGlobalConfiguration {
2324
gethostname(node_name, HOST_NAME_MAX);
2425
termination_phase = false;
2526
StoreOnlyInMemory = false;
26-
CAPIO_SERVER_MAIN_PID = gettid();
27+
CAPIO_SERVER_MAIN_PID = -1;
2728
workflow_name = CAPIO_DEFAULT_WORKFLOW_NAME;
2829
}
2930
};
3031

31-
inline auto capio_global_configuration = new CapioGlobalConfiguration();
32+
extern CapioGlobalConfiguration* capio_global_configuration;
3233

3334
inline void server_println(const std::string &message_type = "",
3435
const std::string &message_line = "") {

0 commit comments

Comments
 (0)