Next: Examples
Up: R. Clapp: Python and
Previous: Solvers
There are two required and three optional
functions available to the programmer.
The required functions go near the beginning
and ending of the program.
The first, sep_begin_prog, tells the
server that the program has started successfully.
It should be used when it is safe to start another
instance of the program on the same node.
This latter requirement is important when
sharing an output space (COPY) on a node.
If you are adding to the output space you need
insure that the output file has been created
by the first instance of the program.
The other required function is sep_end_prog.
This should be used after all of the output files
have been completely written to. The server interprets it
as a sign of completion for the job.
The sep_progress function enables
effective job restarting. The programmer can use
this function to signify a checkpoint in the code.
When restarting a job, both the restart flag and the
last progress message will be passed as arguments
for the restarting job. In the case when you are sharing
an output space, you should use this function whenever
you write to the shared file.
The final two functions are when you are sharing
an output space. The sep_open_lock(tag) locks
(if already locked waits for the file to become available)
a SEPlib tag. The sep_close_lock(tag) function
frees a tag so another process can safely read or write
to it. All of these commands perform no function
when they are not a portion of a parallel job.
Next: Examples
Up: R. Clapp: Python and
Previous: Solvers
Stanford Exploration Project
5/3/2005