Commit de4b8916 authored by Dmitry I. Lyakh's avatar Dmitry I. Lyakh

Ressurected driver-rpc. Test is failing because HamiltonianTest service is not found.

parent 50042a8a
Pipeline #91148 passed with stage
in 4 minutes and 39 seconds
......@@ -16,7 +16,7 @@ set(CMAKE_SKIP_RPATH OFF)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPATH_MAX=4096 -Wno-attributes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPATH_MAX=4096 -Wno-attributes")
project(exatn LANGUAGES CXX Fortran)
......@@ -186,5 +186,3 @@ add_subdirectory(src)
if(PYTHON_INCLUDE_DIR)
add_subdirectory(python)
endif()
......@@ -6,4 +6,4 @@ endif()
file (GLOB HEADERS *.hpp)
install(FILES ${HEADERS} DESTINATION include/exatn)
\ No newline at end of file
install(FILES ${HEADERS} DESTINATION include/exatn)
......@@ -2,10 +2,11 @@
#define EXATN_DRIVER_CLIENT_HPP_
#include "Identifiable.hpp"
#include "tensor_method.hpp"
#include <string>
#include <vector>
#include <complex>
#include "tensor_method.hpp"
namespace exatn {
namespace rpc {
......
......@@ -2,10 +2,11 @@
#define EXATN_DRIVER_SERVER_HPP_
#include "Identifiable.hpp"
#include <string>
#include "tensor_method.hpp"
#include "TAProLInterpreter.hpp"
#include <string>
namespace exatn {
namespace rpc {
......@@ -16,7 +17,8 @@ protected:
std::shared_ptr<exatn::parser::TAProLInterpreter> parser;
public:
DriverServer() {}
DriverServer() = default;
virtual void start() = 0;
virtual void stop() = 0;
};
......
......@@ -37,7 +37,7 @@ usfunctionembedresources(TARGET
exatn_configure_plugin_rpath(${LIBRARY_NAME})
if(EXATN_BUILD_TESTS)
#add_subdirectory(tests)
add_subdirectory(tests)
endif()
file(GLOB HEADERS *.hpp)
......
......@@ -2,14 +2,13 @@
#define EXATN_MPICLIENT_HPP_
#include "DriverClient.hpp"
#include "DriverServer.hpp"
#include "mpi.h"
#include <algorithm>
#include <functional>
#include <map>
#include <iostream>
namespace exatn {
namespace rpc {
namespace mpi {
......@@ -79,4 +78,4 @@ public:
} // namespace mpi
} // namespace rpc
} // namespace exatn
#endif
\ No newline at end of file
#endif
#include "MPIServer.hpp"
#include "exatn.hpp"
#include "num_server.hpp"
#include <future>
......
......@@ -2,7 +2,6 @@
#define EXATN_DRIVER_MPISERVER_HPP_
#include "DriverServer.hpp"
#include "mpi.h"
#include <string>
......@@ -37,4 +36,4 @@ public:
} // namespace mpi
} // namespace rpc
} // namespace exatn
#endif
\ No newline at end of file
#endif
add_subdirectory(example-tensor-method)
add_executable(client_test client.cpp)
add_executable(server_test server.cpp)
target_include_directories(client_test
PRIVATE ${CUDA_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/tpls/ExaTensor/include
${CMAKE_SOURCE_DIR}/tpls/antlr/runtime/src
${MPI_CXX_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src/driver-rpc
${CMAKE_SOURCE_DIR}/src/parser
${CMAKE_SOURCE_DIR}/src)
target_include_directories(server_test
PRIVATE ${CUDA_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/tpls/ExaTensor/include
${CMAKE_SOURCE_DIR}/tpls/antlr/runtime/src
${MPI_CXX_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src/driver-rpc
${CMAKE_SOURCE_DIR}/src/parser
${CMAKE_SOURCE_DIR}/src)
target_link_libraries(client_test PUBLIC exatn ${MPI_CXX_LIBRARIES})
set_target_properties(client_test PROPERTIES FOLDER tests)
target_link_libraries(client_test PRIVATE gtest gmock gtest_main)
target_link_libraries(server_test PUBLIC exatn ${MPI_CXX_LIBRARIES})
set_target_properties(server_test PROPERTIES FOLDER tests)
target_link_libraries(server_test PRIVATE gtest gmock gtest_main)
if(NOT APPLE)
get_filename_component(MPI_BIN_PATH ${MPI_CXX_COMPILER} DIRECTORY)
......
......@@ -2,4 +2,4 @@ Run the client server prototype with the following command
```bash
$ mpirun -np 1 server_test : -np 1 client_test
```
\ No newline at end of file
```
#include "DriverClient.hpp"
#include <gtest/gtest.h>
#include "exatn.hpp"
#include <gtest/gtest.h>
#include "mpi.h"
using namespace exatn::rpc;
const std::string src = R"src(entry: main
const std::string src = R"src(
entry: main
scope main group()
subspace(): s0=[0:127]
index(s0): a,b,c,d,i,j,k,l
......@@ -20,7 +21,8 @@ scope main group()
~Z2
~T2
~H2
end scope main)src";
end scope main
)src";
TEST(client_test, checkSimple) {
......
#include "ExampleTensorMethod.hpp"
#include "talshxx.hpp"
#include <iostream>
......
#include "tensor_method.hpp"
#include "Identifiable.hpp"
#include "tensor_method.hpp"
namespace exatn {
namespace test {
......
#include "DriverServer.hpp"
#include "exatn.hpp"
#include <gtest/gtest.h>
#include "mpi.h"
using namespace exatn::rpc;
......@@ -9,21 +10,16 @@ int main(int argc, char** argv) {
MPI_Init(&argc,&argv);
exatn::initialize();
// Create the server and
// start it up, this kicks off the
// event loop
// Create the server and start it up,
// this kicks off the event loop
auto server = exatn::getService<DriverServer>("mpi");
server->start();
// If we make it here, then the
// client has shutdown the server
std::cout << "[server] Exiting server.cpp\n";
// If we make it here, then the client has shutdown the server
std::cout << "[server.cpp] exited server\n";
exatn::finalize();
MPI_Finalize();
return 0;
}
add_subdirectory(testplugin)
exatn_add_test(ServiceRegistryTester ServiceRegistryTester.cpp)
target_include_directories(ServiceRegistryTester PRIVATE testplugin ${CMAKE_SOURCE_DIR}/src/exatn ${CMAKE_BINARY_DIR})
target_link_libraries(ServiceRegistryTester PRIVATE
exatn CppMicroServices)
target_link_libraries(ServiceRegistryTester PRIVATE exatn CppMicroServices)
exatn_add_test(NumServerTester NumServerTester.cpp)
#target_include_directories(NumServerTester PRIVATE testplugin ${CMAKE_SOURCE_DIR}/src/exatn ${CMAKE_BINARY_DIR})
target_link_libraries(NumServerTester PRIVATE
exatn)
\ No newline at end of file
target_link_libraries(NumServerTester PRIVATE exatn)
......@@ -19,7 +19,7 @@ target_include_directories(${LIBRARY_NAME}
PUBLIC . graph optimizer executor ${CMAKE_SOURCE_DIR}/src/exatn)
target_link_libraries(${LIBRARY_NAME}
PUBLIC CppMicroServices exatn-numerics exatn-runtime-graph
PUBLIC CppMicroServices exatn-numerics exatn-runtime-graph
PRIVATE Boost::graph)
exatn_configure_library_rpath(${LIBRARY_NAME})
......
Markdown is supported
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