[Gmsh] feature request: gmsh reads input from TCP port

Christophe Geuzaine cag32 at case.edu
Sat Mar 11 06:24:01 CET 2006


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.
> 

Al - If you're still interested in this stuff, give version 1.64 a try:

- select "Always listen to incoming connections" in Options->Solver

- compile utils/solver/c++/interactive.cpp (it's a small test program 
that shows off some of the new features of the solver interface in the 
form of a command-line "Gmsh remote-control")

(You can use a TCP/IP socket instead of a Unix socket by replacing 
".gmshsock" with e.g. "127.0.0.1:44122" in Solver->Options and in 
interactive.cpp.)

Take care,

Christophe



> I can provide demo client/server TCP code if there's a possibility
> that this request might be implemented.        -- Al
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh
> 
> 


-- 
Christophe Geuzaine
Assistant Professor, Case Western Reserve University, Mathematics
http://www.case.edu/artsci/math/geuzaine