The following steps describes how to add a new feature into remote-simgrid.
A service is an object which can be called by a client remotely (see rpc server). In remote simgrid, we use service to access to s4u features such as host or actor etc..
The following steps describes how to create new service.
- First define your service according to the thrift convention into the file
RsgService.thift
. - Now you can generate the service skeleton by running cmake command.
- Thrift create a skeleton class into build/gen-cpp/<>
- Now create the two files described bellow :
- The header :
src/rsg/services/<YourServiceName>.hpp
- The cpp source :
src/rsg/services/<YourServiceName>.cpp
- Once the file a created, you need to add it to the
src/CMakeLists.txt
among the other services. (cmake instruction at line 18).
Once the service is created and the project compile,if you have not implemented the service yet, you may need to modify some functions. Otherwise the project won't compile.
To use the service into the remote process, you need to add the service to the server processor in the file src/main_server.cpp
into the function rsg_representative
.
Once the service is added to the server, you will be able to get an instance thanks to the function template<class ServiceType> ServiceType* Client::serviceClientFactory(std::string name)
.
You can directly run remote process with valgring or gdb. In your deployment file you can define your remote process like :
<process host="host0" function="client">
<argument value="valgrind"/>
<argument value="/home/adfaure/projects/remote-simgrid/build/tests/basic/main_client"/>
</process>