Permalink
Browse files

Merge branch 'release/0.11.4'

  • Loading branch information...
dan-blanchard committed Dec 11, 2013
2 parents c0d9510 + a890021 commit d35fbdc9c85de891acc817af113247d6681d04cc
Showing with 30 additions and 3 deletions.
  1. +1 −1 gridmap/runner.py
  2. +1 −1 gridmap/version.py
  3. +28 −1 tests/test_gridmap.py
View
@@ -106,7 +106,7 @@ def get_memory_usage(pid):
"""
p = Process(pid)
return float(p.get_memory_usage()[0]) / (1024.0 ** 2.0)
return float(p.get_memory_info()[0]) / (1024.0 ** 2.0)
def get_cpu_load(pid):
View
@@ -28,5 +28,5 @@
:organization: ETS
'''
__version__ = '0.11.3'
__version__ = '0.11.4'
VERSION = tuple(int(x) for x in __version__.split('.'))
View
@@ -23,8 +23,10 @@
from __future__ import print_function, unicode_literals
import logging
from time import sleep
from gridmap import Job, process_jobs, grid_map
import gridmap
from gridmap import Job, process_jobs, grid_map, HEARTBEAT_FREQUENCY
from nose.tools import eq_
@@ -33,6 +35,16 @@
logging.captureWarnings(True)
logging.basicConfig(format=('%(asctime)s - %(name)s - %(levelname)s - ' +
'%(message)s'), level=logging.DEBUG)
logger = logging.getLogger(__name__)
logger.debug('Path to gridmap: %s', gridmap)
def compute_factorial_slow(n):
sleep(HEARTBEAT_FREQUENCY + 1)
ret = 1
for i in range(n):
ret = ret * (i + 1)
return ret
def compute_factorial(n):
@@ -49,6 +61,13 @@ def test_map():
eq_(expected, outputs)
def test_map_slow():
inputs = [1, 2, 4, 8, 16]
expected = list(map(compute_factorial_slow, inputs))
outputs = grid_map(compute_factorial_slow, inputs, quiet=False)
eq_(expected, outputs)
def make_jobs(inputvec, function):
# create empty job vector
jobs = []
@@ -69,3 +88,11 @@ def test_process_jobs():
function_jobs = make_jobs(inputs, compute_factorial)
outputs = process_jobs(function_jobs, quiet=False)
eq_(expected, outputs)
def test_process_jobs_slow():
inputs = [1, 2, 4, 8, 16]
expected = list(map(compute_factorial_slow, inputs))
function_jobs = make_jobs(inputs, compute_factorial_slow)
outputs = process_jobs(function_jobs, quiet=False)
eq_(expected, outputs)

0 comments on commit d35fbdc

Please sign in to comment.