Running ocean in another process from CIW

  • Thread starter Svenn Are Bjerkem
  • Start date
S

Svenn Are Bjerkem

Guest
Hi,

I find it very convenient to run ocean scripts from the CIW window
through the ocean menu provided in this group. As those ocean scripts
get longer, the time to finish get longer. In the mean time, my entire
icfb is locked up. I am looking for a way to spawn off an ocean
process that still has some connection to my CIW, but does not freeze
the user interface.

Will an ocean process fired off by ipc* calls work?

Any ideas?

--
Svenn
 
Hi Svenn,

I had the same problem when trying to run a complete simulation setup.
My solution follows:
1. Put all ocean code into a file, e.g. "run.ocn"
2. Create an .oceanrc in the working directory that contains the
lines
load("run.ocn")
exit(1)
3. Start your routine from the CIW with
pid=ipcBeginProcess("ocean" "" nil nil "finished" "oceanrun.log")
Ocean is called in your current working dir. Since it first reads
the .oceanrc file your routines in "run.ocn" will be executed.
4. Once the ocean script has finished (or terminated) the callback
"finished" will be called.
procedure(finished(childID exitState)
if(exitState==1
then ... successfully finished
else... quit for any other reason
)

I hope this helps.

Cheers
Gunnar
 
On Aug 9, 1:48 pm, gunnar.mun...@web.de wrote:
Hi Svenn,

I had the same problem when trying to run a complete simulation setup.
My solution follows:
1. Put all ocean code into a file, e.g. "run.ocn"
2. Create an .oceanrc in the working directory that contains the
lines
load("run.ocn")
exit(1)
3. Start your routine from the CIW with
pid=ipcBeginProcess("ocean" "" nil nil "finished" "oceanrun.log")
Ocean is called in your current working dir. Since it first reads
the .oceanrc file your routines in "run.ocn" will be executed.
4. Once the ocean script has finished (or terminated) the callback
"finished" will be called.
procedure(finished(childID exitState)
if(exitState==1
then ... successfully finished
else... quit for any other reason
)
This looks promising. I guess the ocean process is running in its own
world and cannot give signs of life back to the mother process. I was
thinking of being able to send back little messages like "worst 125C
0.9 ss finished" so that I can use the results->select menu item to
see what happened before the simulation has come to an end. Ocean has
stdin and stdout, but are these bound or how can they be bound to the
io-handles that the ipc set up for communication from process back to
mother. This is probably a bit complicated and has to be tested.
Thanks for the starting point.

--
Svenn
 
Hi Svenn,

there is a number of Parameters that you give to ipcBeginProcess. One
is the function for the dataHandler, another is the errorHandler.
These work on the stdout and stderr of the child process and are
called whenever the child writes into these pipes.

Otherwise you can info("logfile") in your ocean script. This opens you
an info windows that displays messages like "worst 125C 0.9 ss
finished".

Cheers
Gunnar
 

Welcome to EDABoard.com

Sponsor

Back
Top