Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates > by-pkgid > b9a6a1b9f2781444d2917afd8e4421ab > files > 832

ipython-doc-2.3.0-2.2.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Module: parallel.controller.scheduler &mdash; IPython 2.3.0 documentation</title>
    
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '2.3.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="IPython 2.3.0 documentation" href="../../index.html" />
    <link rel="up" title="The IPython API" href="../index.html" />
    <link rel="next" title="Module: parallel.controller.sqlitedb" href="IPython.parallel.controller.sqlitedb.html" />
    <link rel="prev" title="Module: parallel.controller.mongodb" href="IPython.parallel.controller.mongodb.html" /> 
  </head>
  <body>

<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="http://ipython.org/"><img src="../../_static/logo.png" border="0" alt="IPython Documentation"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="IPython.parallel.controller.sqlitedb.html" title="Module: parallel.controller.sqlitedb"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="IPython.parallel.controller.mongodb.html" title="Module: parallel.controller.mongodb"
             accesskey="P">previous</a> |</li>
        <li><a href="http://ipython.org">home</a>|&nbsp;</li>
        <li><a href="../../search.html">search</a>|&nbsp;</li>
       <li><a href="../../index.html">documentation </a> &raquo;</li>

          <li><a href="../index.html" accesskey="U">The IPython API</a> &raquo;</li> 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Module: <tt class="docutils literal"><span class="pre">parallel.controller.scheduler</span></tt></a><ul>
<li><a class="reference internal" href="#classes">2 Classes</a></li>
<li><a class="reference internal" href="#functions">7 Functions</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="IPython.parallel.controller.mongodb.html"
                        title="previous chapter">Module: <tt class="docutils literal"><span class="pre">parallel.controller.mongodb</span></tt></a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="IPython.parallel.controller.sqlitedb.html"
                        title="next chapter">Module: <tt class="docutils literal"><span class="pre">parallel.controller.sqlitedb</span></tt></a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/api/generated/IPython.parallel.controller.scheduler.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-IPython.parallel.controller.scheduler">
<span id="module-parallel-controller-scheduler"></span><h1>Module: <tt class="xref py py-mod docutils literal"><span class="pre">parallel.controller.scheduler</span></tt><a class="headerlink" href="#module-IPython.parallel.controller.scheduler" title="Permalink to this headline">¶</a></h1>
<p>The Python scheduler for rich scheduling.</p>
<p>The Pure ZMQ scheduler does not allow routing schemes other than LRU,
nor does it check msg_id DAG dependencies. For those, a slightly slower
Python Scheduler exists.</p>
<p>Authors:</p>
<ul class="simple">
<li>Min RK</li>
</ul>
<div class="section" id="classes">
<h2>2 Classes<a class="headerlink" href="#classes" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="IPython.parallel.controller.scheduler.Job">
<em class="property">class </em><tt class="descclassname">IPython.parallel.controller.scheduler.</tt><tt class="descname">Job</tt><big>(</big><em>msg_id</em>, <em>raw_msg</em>, <em>idents</em>, <em>msg</em>, <em>header</em>, <em>metadata</em>, <em>targets</em>, <em>after</em>, <em>follow</em>, <em>timeout</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.Job" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="http://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p>
<p>Simple container for a job</p>
<dl class="method">
<dt id="IPython.parallel.controller.scheduler.Job.__init__">
<tt class="descname">__init__</tt><big>(</big><em>msg_id</em>, <em>raw_msg</em>, <em>idents</em>, <em>msg</em>, <em>header</em>, <em>metadata</em>, <em>targets</em>, <em>after</em>, <em>follow</em>, <em>timeout</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.Job.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler">
<em class="property">class </em><tt class="descclassname">IPython.parallel.controller.scheduler.</tt><tt class="descname">TaskScheduler</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="IPython.kernel.zmq.session.html#IPython.kernel.zmq.session.SessionFactory" title="IPython.kernel.zmq.session.SessionFactory"><tt class="xref py py-class docutils literal"><span class="pre">IPython.kernel.zmq.session.SessionFactory</span></tt></a></p>
<p>Python TaskScheduler object.</p>
<p>This is the simplest object that supports msg_id based
DAG dependencies. <em>Only</em> task msg_ids are checked, not
msg_ids of jobs submitted via the MUX queue.</p>
<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.add_job">
<tt class="descname">add_job</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.add_job" title="Permalink to this definition">¶</a></dt>
<dd><p>Called after self.targets[idx] just got the job with header.
Override with subclasses.  The default ordering is simple LRU.
The default loads are the number of outstanding jobs.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.available_engines">
<tt class="descname">available_engines</tt><big>(</big><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.available_engines" title="Permalink to this definition">¶</a></dt>
<dd><p>return a list of available engine indices based on HWM</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.dispatch_notification">
<tt class="descname">dispatch_notification</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.dispatch_notification" title="Permalink to this definition">¶</a></dt>
<dd><p>dispatch register/unregister events.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.dispatch_query_reply">
<tt class="descname">dispatch_query_reply</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.dispatch_query_reply" title="Permalink to this definition">¶</a></dt>
<dd><p>handle reply to our initial connection request</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.dispatch_result">
<tt class="descname">dispatch_result</tt><big>(</big><em>raw_msg</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.dispatch_result" title="Permalink to this definition">¶</a></dt>
<dd><p>dispatch method for result replies</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.dispatch_submission">
<tt class="descname">dispatch_submission</tt><big>(</big><em>raw_msg</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.dispatch_submission" title="Permalink to this definition">¶</a></dt>
<dd><p>Dispatch job submission to appropriate handlers.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.fail_unreachable">
<tt class="descname">fail_unreachable</tt><big>(</big><em>msg_id</em>, <em>why=&lt;class 'IPython.parallel.error.ImpossibleDependency'&gt;</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.fail_unreachable" title="Permalink to this definition">¶</a></dt>
<dd><p>a task has become unreachable, send a reply with an ImpossibleDependency
error.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.finish_job">
<tt class="descname">finish_job</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.finish_job" title="Permalink to this definition">¶</a></dt>
<dd><p>Called after self.targets[idx] just finished a job.
Override with subclasses.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.handle_result">
<tt class="descname">handle_result</tt><big>(</big><em>idents</em>, <em>parent</em>, <em>raw_msg</em>, <em>success=True</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.handle_result" title="Permalink to this definition">¶</a></dt>
<dd><p>handle a real task result, either success or failure</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.handle_stranded_tasks">
<tt class="descname">handle_stranded_tasks</tt><big>(</big><em>engine</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.handle_stranded_tasks" title="Permalink to this definition">¶</a></dt>
<dd><p>Deal with jobs resident in an engine that died.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.handle_unmet_dependency">
<tt class="descname">handle_unmet_dependency</tt><big>(</big><em>idents</em>, <em>parent</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.handle_unmet_dependency" title="Permalink to this definition">¶</a></dt>
<dd><p>handle an unmet dependency</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.job_timeout">
<tt class="descname">job_timeout</tt><big>(</big><em>job</em>, <em>timeout_id</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.job_timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>callback for a job&#8217;s timeout.</p>
<p>The job may or may not have been run at this point.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.maybe_run">
<tt class="descname">maybe_run</tt><big>(</big><em>job</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.maybe_run" title="Permalink to this definition">¶</a></dt>
<dd><p>check location dependencies, and run if they are met.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.resume_receiving">
<tt class="descname">resume_receiving</tt><big>(</big><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.resume_receiving" title="Permalink to this definition">¶</a></dt>
<dd><p>Resume accepting jobs.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.save_unmet">
<tt class="descname">save_unmet</tt><big>(</big><em>job</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.save_unmet" title="Permalink to this definition">¶</a></dt>
<dd><p>Save a message for later submission when its dependencies are met.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.stop_receiving">
<tt class="descname">stop_receiving</tt><big>(</big><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.stop_receiving" title="Permalink to this definition">¶</a></dt>
<dd><p>Stop accepting jobs while there are no engines.
Leave them in the ZMQ queue.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.submit_task">
<tt class="descname">submit_task</tt><big>(</big><em>job</em>, <em>indices=None</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.submit_task" title="Permalink to this definition">¶</a></dt>
<dd><p>Submit a task to any of a subset of our targets.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.scheduler.TaskScheduler.update_graph">
<tt class="descname">update_graph</tt><big>(</big><em>dep_id=None</em>, <em>success=True</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.TaskScheduler.update_graph" title="Permalink to this definition">¶</a></dt>
<dd><p>dep_id just finished. Update our dependency
graph and submit any jobs that just became runnable.</p>
<p>Called with dep_id=None to update entire graph for hwm, but without finishing a task.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="functions">
<h2>7 Functions<a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="IPython.parallel.controller.scheduler.logged">
<tt class="descclassname">IPython.parallel.controller.scheduler.</tt><tt class="descname">logged</tt><big>(</big><em>f</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.logged" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="IPython.parallel.controller.scheduler.plainrandom">
<tt class="descclassname">IPython.parallel.controller.scheduler.</tt><tt class="descname">plainrandom</tt><big>(</big><em>loads</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.plainrandom" title="Permalink to this definition">¶</a></dt>
<dd><p>Plain random pick.</p>
</dd></dl>

<dl class="function">
<dt id="IPython.parallel.controller.scheduler.lru">
<tt class="descclassname">IPython.parallel.controller.scheduler.</tt><tt class="descname">lru</tt><big>(</big><em>loads</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.lru" title="Permalink to this definition">¶</a></dt>
<dd><p>Always pick the front of the line.</p>
<p>The content of <cite>loads</cite> is ignored.</p>
<p>Assumes LRU ordering of loads, with oldest first.</p>
</dd></dl>

<dl class="function">
<dt id="IPython.parallel.controller.scheduler.twobin">
<tt class="descclassname">IPython.parallel.controller.scheduler.</tt><tt class="descname">twobin</tt><big>(</big><em>loads</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.twobin" title="Permalink to this definition">¶</a></dt>
<dd><p>Pick two at random, use the LRU of the two.</p>
<p>The content of loads is ignored.</p>
<p>Assumes LRU ordering of loads, with oldest first.</p>
</dd></dl>

<dl class="function">
<dt id="IPython.parallel.controller.scheduler.weighted">
<tt class="descclassname">IPython.parallel.controller.scheduler.</tt><tt class="descname">weighted</tt><big>(</big><em>loads</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.weighted" title="Permalink to this definition">¶</a></dt>
<dd><p>Pick two at random using inverse load as weight.</p>
<p>Return the less loaded of the two.</p>
</dd></dl>

<dl class="function">
<dt id="IPython.parallel.controller.scheduler.leastload">
<tt class="descclassname">IPython.parallel.controller.scheduler.</tt><tt class="descname">leastload</tt><big>(</big><em>loads</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.leastload" title="Permalink to this definition">¶</a></dt>
<dd><p>Always choose the lowest load.</p>
<p>If the lowest load occurs more than once, the first
occurance will be used.  If loads has LRU ordering, this means
the LRU of those with the lowest load is chosen.</p>
</dd></dl>

<dl class="function">
<dt id="IPython.parallel.controller.scheduler.launch_scheduler">
<tt class="descclassname">IPython.parallel.controller.scheduler.</tt><tt class="descname">launch_scheduler</tt><big>(</big><em>in_addr</em>, <em>out_addr</em>, <em>mon_addr</em>, <em>not_addr</em>, <em>reg_addr</em>, <em>config=None</em>, <em>logname='root'</em>, <em>log_url=None</em>, <em>loglevel=10</em>, <em>identity='task'</em>, <em>in_thread=False</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.scheduler.launch_scheduler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="IPython.parallel.controller.sqlitedb.html" title="Module: parallel.controller.sqlitedb"
             >next</a> |</li>
        <li class="right" >
          <a href="IPython.parallel.controller.mongodb.html" title="Module: parallel.controller.mongodb"
             >previous</a> |</li>
        <li><a href="http://ipython.org">home</a>|&nbsp;</li>
        <li><a href="../../search.html">search</a>|&nbsp;</li>
       <li><a href="../../index.html">documentation </a> &raquo;</li>

          <li><a href="../index.html" >The IPython API</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright The IPython Development Team.
      Last updated on Jul 14, 2015.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>