Home > Archive > Fortran > October 2004 > systemqq command in a DO loop
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
systemqq command in a DO loop
|
|
| justabeginner 2004-10-11, 8:56 pm |
| Hi, sorry I forgot to include this question in my other post.
Basically, do processes called by systemqq need to be explicitly shut
down (sort of like deallocate for arrays) or do they keep running as
long as the DO loop which called it has not ended?
For example:
-------------------------
Program execute
logical(4) result
open (1, file='output.txt')
do i = 1, 100
result = systemqq('run.exe')
read (1,*) random_number
enddo
end program execute
--------------------------
---------------------------
Program run
iseed = 187252
open (1,file='output.txt')
rnd = ran(iseed)
write (1,*) rnd
end program run
-------------------------------
In the above example, is 'run.exe' executed 100 times before shutting
down?
Also, implementing something similar to the above caused what I think
is a sharing violation. How do I fix it? (see other thread for more
info)
Thanks.
| |
| Stig Kildegård Andersen 2004-10-12, 8:56 am |
|
"justabeginner" <nom_de_plume79@yahoo.co.uk> wrote in message
news:b7ff0972.0410111555.171719db@posting.google.com...
> Hi, sorry I forgot to include this question in my other post.
> Basically, do processes called by systemqq need to be explicitly shut
> down (sort of like deallocate for arrays) or do they keep running as
> long as the DO loop which called it has not ended?
<snip example>
The processes do not need to be shut down. But execution of the calling
program may or may not continue before each process has finished. Please
read the CVF documentation for "systemqq" or "system". The answer depends on
your OS.
Hope it helps,
Stig Kildegård Andersen
| |
| Richard E Maine 2004-10-12, 3:58 pm |
| "Stig Kildegård Andersen" <stigkildegaardatmaildotdk> writes:
> "justabeginner" <nom_de_plume79@yahoo.co.uk> wrote in message
> news:b7ff0972.0410111555.171719db@posting.google.com...
>
> <snip example>
>
> The processes do not need to be shut down. But execution of the calling
> program may or may not continue before each process has finished. Please
> read the CVF documentation for "systemqq" or "system". The answer depends on
> your OS.
An note that there is no concept of a DO loop calling anything.
Just because something is done in a DO loop doesn't mean that the
DO loop "owns" it in any sense. The code shown has 100 *SEPARATE*
calls to systemqq, presumably starting 100 separate processes.
I'm not familiar with the details of systemqq (I'm sure I could
research them, but no better than you can, so it doesn't seem
worth me doing). But I don't have to know anything much about systemqq
to note that it has no connection with any DO loop. It doesn't
even have to be called from a DO loop at all (and most often isn't).
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
| |
| justabeginner 2004-10-13, 3:56 am |
| Hi all, thanks for your replies. I found out the sharing violation was
because I can & should open/close the shared files as necessary. I
thought that opening files was sort of like a variable declaration...a
one-off thing. Turns out you're allowed to open/close as you please.
Once I incorporated open, close & rewind commands into my DO loop
everything worked like a charm :)
|
|
|
|
|