# Diff of /trunk/doc/user/execute.tex

revision 2484 by gross, Mon Jun 22 04:22:19 2009 UTC revision 2736 by caltinay, Mon Nov 2 04:15:27 2009 UTC
# Line 91  hosts defined in \var{hostfile} must be Line 91  hosts defined in \var{hostfile} must be
91   \item[\programopt{-c}] prints the information about the settings used to compile {\it escript} and stops execution..   \item[\programopt{-c}] prints the information about the settings used to compile {\it escript} and stops execution..
92   \item[\programopt{-V}] prints the version of {\it escript} and stops execution.   \item[\programopt{-V}] prints the version of {\it escript} and stops execution.
93   \item[\programopt{-h}] prints a help message and stops execution.   \item[\programopt{-h}] prints a help message and stops execution.
94   \item[\programopt{-i}] executes the script \var{file} and switches to interactive mode after the execution is finished or an exception has occurred. This option is useful for debugging a script. The option cannot be used if more then one process ($\var{nn} \cdot \var{np}>1$) is used.   \item[\programopt{-i}] executes the script \var{file} and switches to interactive mode after the execution is finished or an exception has occurred. This option is useful for debugging a script. The option cannot be used if more than one process ($\var{nn} \cdot \var{np}>1$) is used.
95  \item[\programopt{-b}] do not invoke python. This is used to run non-python programs.  \item[\programopt{-b}] do not invoke python. This is used to run non-python programs.
96
97   \item[\programopt{-e}] shows additional environment variables and commands used during \program{escript} execution. This option is useful if users wish to execute scripts without using the \program{escript} command.   \item[\programopt{-e}] shows additional environment variables and commands used during \program{escript} execution. This option is useful if users wish to execute scripts without using the \program{escript} command.
# Line 111  hosts defined in \var{hostfile} must be Line 111  hosts defined in \var{hostfile} must be
111  \end{itemize}  \end{itemize}
112
113  \section{Input and Output}  \section{Input and Output}
114  When \MPI is used on more than one process ($\var{nn} \cdot \var{np} >1$) no input from the standard input is accepted. Standard output on any process other the the master process (\var{rank}=0) will not be available.  When \MPI is used on more than one process ($\var{nn} \cdot \var{np} >1$) no input from the standard input is accepted. Standard output on any process other than the master process (\var{rank}=0) will not be available.
115  Error output from any processor will be redirected to the node where \program{escript} has been invoked.  Error output from any processor will be redirected to the node where \program{escript} has been invoked.
116  If the \programopt{-o} or \env{ESCRIPT_STDFILES} is set\footnote{That is, it has a non-empty value.}, then the standard and error output from any process other than the master process will be written to files of the names \file{stdout_\var{r}.out} and \file{stderr_\var{r}.out} (where  If the \programopt{-o} or \env{ESCRIPT_STDFILES} is set\footnote{That is, it has a non-empty value.}, then the standard and error output from any process other than the master process will be written to files of the names \file{stdout_\var{r}.out} and \file{stderr_\var{r}.out} (where
117  \var{r} is the rank of the process).  \var{r} is the rank of the process).
118
119  If files are created or read by individual \MPI processes with information local to the process (e.g in the \function{dump} function)  and more than one process is used ($\var{nn} \cdot \var{np} >1$), the \MPI process rank is appended to the file names.  If files are created or read by individual \MPI processes with information local to the process (e.g in the \function{dump} function)  and more than one process is used ($\var{nn} \cdot \var{np} >1$), the \MPI process rank is appended to the file names.
120  This will avoid problems if processes are using a shared file system.  This will avoid problems if processes are using a shared file system.
121  Files which collect data which are global for all \MPI processors will created by the process with \MPI rank 0 only.  Files which collect data which are global for all \MPI processors will be created by the process with \MPI rank 0 only.
122  Users should keep in mind that if the file system is not shared, then a file containing global information  Users should keep in mind that if the file system is not shared, then a file containing global information
123  which is read by all processors needs to be copied to the local file system before \program{escript} is invoked.  which is read by all processors needs to be copied to the local file system before \program{escript} is invoked.
124
# Line 133  and \numpy has an identical value across Line 133  and \numpy has an identical value across
133  values of these types returned by \escript have the same value on all processors.  values of these types returned by \escript have the same value on all processors.
134  If values produced by other modules are used as arguments the user has to make sure that the argument values are identical on all processors. For instance, the usage of a random number generator to create argument values bears the risk that the value may depend on the processor.  If values produced by other modules are used as arguments the user has to make sure that the argument values are identical on all processors. For instance, the usage of a random number generator to create argument values bears the risk that the value may depend on the processor.
135
136  Special attention is required when using files on more then one processor as  Special attention is required when using files on more than one processor as
137  several processors access the file at the same time. Open a file for  several processors access the file at the same time. Opening a file for
138  reading is safe, however the user has to make sure that the variables which are  reading is safe, however the user has to make sure that the variables which are
139  set from reading data from files are identical on all processors.  set from reading data from files are identical on all processors.
140
# Line 150  f = FileWriter('test.txt') Line 150  f = FileWriter('test.txt')
150  f.write('test message')  f.write('test message')
151  f.close()  f.close()
152  \end{python}  \end{python}
153  It is highly recommendable to use this class rather than the build \function{open}  It is highly recommendable to use this class rather than the built-in \function{open}
154  function as it will guarantee a script which will run in single processor mode as well as under \MPI.  function as it will guarantee a script which will run in single processor mode as well as under \MPI.
155
156  If there is the situation that on one of the processors is throwing an exception,  If there is the situation that one of the processors is throwing an exception,
157  for instance as opening a file for writing fails, the other processors  for instance as opening a file for writing fails, the other processors
158  are not automatically made aware of this as \MPI  are not automatically made aware of this as \MPI
159  is not handling exceptions. However, \MPI will terminate the other processes but  is not handling exceptions. However, \MPI will terminate the other processes but

Legend:
 Removed from v.2484 changed lines Added in v.2736