/[escript]/branches/stage3.1/doc/user/execute.tex
ViewVC logotype

Diff of /branches/stage3.1/doc/user/execute.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2907 by jfenwick, Wed Jan 27 00:28:50 2010 UTC revision 2908 by jfenwick, Wed Feb 3 01:43:46 2010 UTC
# Line 182  dioes not handle exceptions. Line 182  dioes not handle exceptions.
182  However, \MPI will terminate the other processes but  However, \MPI will terminate the other processes but
183  may not inform the user of the reason in an obvious way. The user needs to inspect the  may not inform the user of the reason in an obvious way. The user needs to inspect the
184  error output files to identify the exception.  error output files to identify the exception.
185    
186    \section{Lazy Evaluation}
187    \label{sec:lazy}
188    Escript now supports lazy evaluation~\cite{lazyauspdc}.
189    Lazy evaluation is when expressions are not evaluated until it is actually needed.
190    When applied to suitable problems, it can reduce both the memory and cpu time required to
191    perform a simulation.
192    This implementation is designed to be as transparent as possible; so significant
193    alterations to scripts are not required.
194    
195    \subsection*{How to use it}
196    To have lazy evaluation applied automatically, put the following command in your script
197    after the imports.
198    
199    \begin{python}
200    from esys.escript import setEscriptParamInt
201    setEscriptParamInt('AUTOLAZY',1)
202    \end{python}
203    
204    To get greater benefit, some fine tuning may be required.
205    If your simulation involves iterating for a number of timesteps,
206    you will probably have some state variables which are updated in
207    each iteration based on their value in the previous iteration.
208    For example:
209    
210    \begin{python}
211    x=f(x_previous)
212    y=g(x)
213    z=h(y,x, ...)
214    \end{python}
215    
216    Could be modified to:
217    
218    \begin{python}
219    x=f(x_previous)
220    resolve(x)
221    y=g(x)
222    z=h(y,x, ...)
223    \end{python}
224    
225    The resolve command forces x to be evaluated immediately.
226    
227    \subsection*{When to use it}
228    We believe that problems involving large domains and complicated expressions
229    will benefit most from lazy evaluation.
230    In cases where lazy does provide a benefit, larger domains should provide
231    larger benefit.
232    If you are uncertain, try running a test on a smaller domain.
233    
234    

Legend:
Removed from v.2907  
changed lines
  Added in v.2908

  ViewVC Help
Powered by ViewVC 1.1.26