[Gmsh] feature request: gmsh reads input from TCP port
Christophe Geuzaine
c.geuzaine at ulg.ac.be
Sat Aug 6 22:09:15 CEST 2005
Al Danial wrote:
> The examples in utils/solvers/* show how one might tie an external
> solver to gmsh. From what I can tell, this scheme means gmsh and
> the external solver need to run on the same machine for the socket
> communication to work.
>
> What would be really nice is the capability to run gmsh on another
> computer on a network then send it commands over TCP. You'd start
> gmsh on Machine_A with something like
>
> gmsh -p 19000
>
> which says "wait for commands on port 19000", then from another
> computer, Machine_B, you'd connect to Machine_A's port 19000 and
> send it strings like
>
> "lc = 0.009;"
> "Point(1) = {0, 0, 0, 9.e-1 * lc};"
> "Point(2) = {.1, 0, 0, lc} ;"
> "Point(3) = {.1, .3, 0, lc} ;"
> "Point(4) = {0, .3, 0, lc} ;"
> "Line(1) = {1,2} ;"
> "Line(2) = {3,2} ;"
> "Line(3) = {3,4} ;"
> "Line(4) = {4,1} ;"
>
> (lines from t1.geo for example). In other words, rather than reading
> input from a .geo file, in server mode gmsh would read input from a
> port. The two machines merely need to be on the same network; don't
> need to share a file system (or operating system for that matter).
>
> The primary benefit is that you could run gmsh on a computer that has
> optimal graphics hardware--and tied to a massive screen in a conference
> room perhaps--while running the solver on a cluster or some other
> computer with beefy CPU's but little in the way of graphics.
>
> I can provide demo client/server TCP code if there's a possibility
> that this request might be implemented. -- Al
>
Hi Al - This is a really great idea! I think it should even be possible
to implement it quite easily by using the current GmshServer.h code
(which already allows to send/receive messages from remote hosts using
TCP sockets).
We could for example add an option to always listen on a given port
(instead of only listening when a user clicks "Run" in a solver dialog),
and add new message headers to allow the transfer of actual data over
the socket instead of just the transfer of short messages (now we only
have "CLIENT_INFO", "CLIENT_OPTION", etc.).
Let me know what do you think.
Christophe
--
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org