Re: synchronisation between two executable



On Thu, 05 Mar 2009 10:35:16 -0700, Dave Allured <nospom@xxxxxxxxxx>
wrote:

rudra wrote:

On Mar 5, 7:30 pm, Luka Djigas <ldigas@@gmail.com> wrote:


Why not use a batch file for just putting them in a loop ? What is the
stopping condition ?

Luka's suggestion is good, except I would call it a shell script rather
than a batch file. (Are we talking about the same thing? What kind of
system?)

The shell script guarantees the the output file(a) from a.out are
completely written and closed properly, before b.out tries to start
reading them, and vice versa. This seems like a trivial thing, except
that if programs A and B are running simultaneously, the file completion
and signalling issues might get messy in Fortran. The shell script
treats you "nice". Mainly because it was designed for things like this!

Concur so far.

The stopping condition would be detected by one of the Fortran programs,
right? So you need a method for that program to signal the shell script
to terminate the loop. I can think of several: special keyword to
standard out; completion file made only upon convergence; grep for
completion keyword in normal output file; set an environment variable;
set the exit code, if available.

Concur except for #4. At least on mainstream systems, environment
variables flow only down (from a parent process to child, i.e. from a
shell/exec/cmdproc to the programs it runs) not up.

.



Relevant Pages

  • Re: synchronisation between two executable
    ... Why not use a batch file for just putting them in a loop? ... The shell script guarantees the the output filefrom a.out are ... special keyword to ...
    (comp.lang.fortran)
  • Re: synchronisation between two executable
    ... Why not use a batch file for just putting them in a loop? ... except I would call it a shell script rather ... special keyword to ...
    (comp.lang.fortran)
  • Re: Startup Script but wait for SQL to start
    ... Main batch file: ... @echo off ... if Errorlevel 1 goto Loop ... And it sucessfully starts up the Indexer. ...
    (microsoft.public.windows.server.general)
  • Re: Scheduled task does not run
    ... Depends a lot on what the shell script does. ... | can run the batch file interactively. ... | scheduled task still can not start if the user is not ... | logged onto the console. ...
    (microsoft.public.windows.server.general)
  • Re: SHELLing
    ... batch file which first copies a file to the c:\temp directory and my VB ... loop until the file exists in c:\temp and then loop until ... >> user using a form and then SHELL out to run a compression program ... >> Kansas City Regional Office ...
    (microsoft.public.vb.general.discussion)