Home Overview FAQ Documentation Download Mailing List Geomview For Windows? Support Users Development Bug Reporting Contributing Contact Us Sponsors
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Closed REQ 5808]: external modules
> hi, > can i run a fortran or c code (external module) in a different machine > on a different network and pipe the data to geomview running on my > workstation? > > i think the present version of geomview needs me to run the external > module through the geomview package. > > i am using a sunsparc machine running sunOS 4.1.3 for running the > geomview package. Yes, there are a couple of simple ways to do this even with the current version of geomview. If it's convenient to start the process from geomview, you can write an external-module definition like: (emodule-define MyProgram 'rsh othermachine myprogram') or (emodule-define MyProgram 'rsh othermachine "cd somedirectory; myprogram"') and let rsh (the remote-shell command) take care of connecting myprogram's standard input and output to geomview. If the program has, say, an X-window interface of its own, you'd presumably have to tell it which display you're on, as in (emodule-define MyProgram 'rsh othermachine "cd somedirectory; env DISPLAY=`hostname`:0 myprogram"') Note that the choice of quotes is important: the rsh othermachine " ... " must use double-quotes, so that `hostname` is expanded on the machine where geomview runs (where presumably the display is, too). Single-quotes would expand it on othermachine instead. On the other hand, you may find it easier to invoke your program and have it start a copy of geomview. If your program doesn't need to receive responses from geomview, you could have it open a pipe to rsh geomviewmachine "env DISPLAY=:0 togeomview -c" Here "togeomview" is a program which creates a named pipe, invokes a copy of geomview if none is already running (and already listening to that pipe), and sends its standard input to the same pipe. Use "togeomview -g" if you're sending geometric data directly, or "togeomview -c" if you send GCL commands. The "env DISPLAY=:0" above assumes that geomview should display on the machine where it's invoked, i.e. that you sit at geomviewmachine's console, use e.g. rlogin to invoke your program, which in turn rsh's back to the machine where you're sitting to invoke geomview. Graphics are much faster when geomview runs and displays on the same machine. If you're writing in C, you could do the above via the "popen()" library routine, as in FILE *togv; togv = popen("rsh geomviewmachine \"env DISPLAY=:0 togeomview -c\"", "w"); ... fprintf(togv, " ... ", ...); ... pclose(togv); Finally, if the program does need to read responses from geomview, and you don't want it to run as an external module initiated from geomview via rsh as above, you'll need to set up a pair of connections and use geomview's "command" command to read and write a pair of named pipes. This is more involved, and I won't try to explain it unless you need that arrangement.
|
||
Home | Overview | FAQ | Documentation | Support | Download | Mailing List Windows? | Development | Bug Reporting | Contributing | Contact Us | Sponsors |
|||
site hosted by |