[Thread Prev][Thread Next][Index]

Re: [ferret_users] spawn stops working



Al, Marco, and Ansley,

> I have sometimes experienced delayed or failed execution of sp commands.
> Just recently I was able to "fix" this by issuing a slight delay to allow my
> command to complete before continuing in my script:
>
> ...............
> sp my-linux-command
> sp sleep 1
> .............
>
> Is the intended default behavior of ferret to wait until the spawned command
> is completed before continuing in the script?

Ferret uses the "system" subroutine (as Ansley said), which (AFAIK)
waits until the command exits.  To see this, try

  yes? sp "sleep 5; echo hello"

What Fortran's "system" subroutine does is to pass the string to the
shell for the latter to execute.  So, it's basically the same as

  $ sh -c "sleep 5; echo hello"

on the command line.

So, I guess in your case,

> sp my-linux-command
> sp sleep 1

my-linux-command spawns subprocesses and exits without waiting for
them to complete.

I don't know what's causing Marco's problem, but if the SPAWN command
just hangs, that means the command it executes is hanging.  Do you see
some system messages (like /var/log/messages) that suggest some
problem like trying to mount an NFS filesystem . . . ?

Regards,

Ryo


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement