Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
The cpu count defaults to the number of physical cpu cores
but can be set with OMP_NUM_THREADS environment variable.
OMP_NUM_THREADS is used because if you hybrid sharedmem with
some openMP extenstions one environment will do it all.

On PBS/torque systems if OMP_NUM_THREADS is empty, we try to
use the value of PBS_NUM_PPN variable.

on some machines the physical number of cores does not equal
the number of cpus shall be used. PSC Blacklight for example.(more...)

        def cpu_count():
  """ The cpu count defaults to the number of physical cpu cores
      but can be set with OMP_NUM_THREADS environment variable.
      OMP_NUM_THREADS is used because if you hybrid sharedmem with
      some openMP extenstions one environment will do it all.

      On PBS/torque systems if OMP_NUM_THREADS is empty, we try to
      use the value of PBS_NUM_PPN variable.

      on some machines the physical number of cores does not equal
      the number of cpus shall be used. PSC Blacklight for example.

      Pool defaults to use cpu_count() slaves. however it can be overridden
      in Pool.
  """
  num = os.getenv("OMP_NUM_THREADS")
  if num is None:
      num = os.getenv("PBS_NUM_PPN")
  try:
    return int(num)
  except:
    return multiprocessing.cpu_count()
        


src/s/h/sharedmem-HEAD/src/core/mapreduce.py   sharedmem(Download)
    def __init__(self, backend=backends.ProcessBackend, np=None):
        """ if np is 0, run in serial """
        self.backend = backend
        if np is None:
            self.np = backends.cpu_count()

src/s/h/sharedmem-HEAD/src/core/parallel.py   sharedmem(Download)
    def __init__(self, *args, **kwargs):
        self.num_threads = kwargs.get('num_threads', backends.cpu_count())
        self.var = Var()
        self.rank = 0
        self.master = True