Closed dilawar closed 5 years ago
@surbhit21 Any comment?
@upibhalla review is needed.
This PR is now in good shape and can be merged for production testing by @surbhit21 @BhallaLab/findsim
I have added a server which can handle upto 100 clients. The server can be launched by
python -m moose.server
Job to this server can be submit by scripts/submit.py
script. It sends the required data to server, run the simulation and collects the artifacts generated by simulation. Artifacts are sent back in an archive file (tar.bz2 format). e.g.
./submit.py -s ghevar.ncbs.res.in:31417 chemDoseResponse.py
There are some rough edges to handle and more are likely to show up with integration with FindSim framework. But to get going, this merge is required.
@upibhalla @surbhit21 I am going to merge this into master today itself. This PR does not modify any existing code. Merging it required for further work on another PR which has a GUI for submitting jobs to moose server.
Have a look if you find time.
About
This PR implements a socket streamer and includes a couple of tests. Related to #342 . The socket streamer:
moose.start
and aftermoose.start
. Its the job developer to have sufficient decay. At least0.5
second is recommended.MOOSE_STREAMER_ADDRESS
is set e.g.MOOSE_STREAMER_ADDRESS=file:///tmp/MOOSE
. This would be useful for FindSim.Read the added test
tests/python/test_socket_streamer_uds.py
ortests/python/test_socket_streamer_tcp.py
on how to use it.This feature is meant for developers. It will be useful if simulation takes long time and one needs to update plots/data or some other visualization once in a while without waiting for moose to finish simulation. Another possibility is to use
moose.Streamer
which writes data to a csv file every 10 seconds and read this file to update the plots/UI periodically. Socket has the advantange of being on TCP and can be connected easily on network.Dependencies
None.
c++11
is required. Work in Linux and OSX.Build
This feature is enabled by default in
cmake
.To disable it, pass '-DWITH_TCP_STREAMER=OFF` to cmake.tests/python
directory. It tests for basic functionality.Documentation
Notes
The streamer works fine but has not been benchmarked for performance.
Below is a run of test script when moose was compiled in
DEBUG
mode.Addendum
I have added a server which can handle upto 100 clients. The server can be launched by
python -m moose.server
Job to this server can be submit by
scripts/submit.py
script. It sends the required data to server, run the simulation and collects the artifacts generated by simulation. Artifacts are sent back in an archive file (tar.bz2 format). e.g.There are some rough edges to handle and more are likely to show up with integration with FindSim framework. But to get going, this merge is required.
A GUI client is developed here https://github.com/dilawar/moose-client