Merge pull request #165 from amplab/sudo

Get rid of numbuf sudo command
This commit is contained in:
Robert Nishihara 2016-06-25 13:51:12 -07:00 committed by GitHub
commit 28747d3c5e
3 changed files with 4 additions and 7 deletions

View file

@ -47,6 +47,9 @@ def from_primitive(primitive_obj):
obj.deserialize(primitive_obj[1])
return obj
def is_arrow_serializable(value):
return type(value) == np.ndarray and value.dtype.name in ["int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "float32", "float64"]
def serialize(worker_capsule, obj):
primitive_obj = to_primitive(obj)
obj_capsule, contained_objrefs = ray.lib.serialize_object(worker_capsule, primitive_obj) # contained_objrefs is a list of the objrefs contained in obj

View file

@ -6,7 +6,6 @@ from types import ModuleType
import typing
import funcsigs
import numpy as np
import pynumbuf
import colorama
import ray
@ -46,7 +45,7 @@ class Worker(object):
def put_object(self, objref, value):
"""Put `value` in the local object store with objref `objref`. This assumes that the value for `objref` has not yet been placed in the local object store."""
if pynumbuf.serializable(value):
if serialization.is_arrow_serializable(value):
ray.lib.put_arrow(self.handle, objref, value)
else:
object_capsule, contained_objrefs = serialization.serialize(self.handle, value) # contained_objrefs is a list of the objrefs contained in object_capsule

View file

@ -41,9 +41,4 @@ fi
pushd "$ROOT_DIR/thirdparty"
./download_thirdparty.sh
./build_thirdparty.sh
pushd numbuf
pushd python
sudo python setup.py install
popd
popd
popd