Skip to content

Serialization failures #15

@ahellander

Description

@ahellander

For some models, I have been getting these kind of errors. It is annoying, because it does not happen with the StrongWeakScaling notebook.

Generating 10 realizations of the model (chunk size=2)

---------------------------------------------------------------------------ImportError Traceback (most recent call last) in ()
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molnsutil.pyc in run_ensemble(model_class, parameters, param_set_id, seed_base, number_of_trajectories, storage_mode)
474 result = solver.run(seed=seed_base+i)
475 filename = str(uuid.uuid1())
--> 476 storage.put(filename, result)
477 filenames.append(filename)
478 except:
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molnsutil.pyc in put(self, filename, data)
94 with open(self.folder_name+"/"+filename,'wb') as fh:
95 if self.serialization_method == "cloudpickle":
---> 96 cloudpickle.dump(data,fh)
97 elif self.serialization_method == "json":
98 json.dump(data,fh)
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in dump(obj, file, protocol)
841
842 def dump(obj, file, protocol=2):
--> 843 CloudPickler(file, protocol).dump(obj)
844
845 def dumps(obj, protocol=2):
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in dump(self, obj)
129 self.inject_addons()
130 try:
--> 131 return pickle.Pickler.dump(self, obj)
132 except RuntimeError, e:
133 if 'recursion' in e.args[0]:
/usr/lib/python2.7/pickle.pyc in dump(self, obj)
222 if self.proto >= 2:
223 self.write(PROTO + chr(self.proto))
--> 224 self.save(obj)
225 self.write(STOP)
226
/usr/lib/python2.7/pickle.pyc in save(self, obj)
329
330 # Save the reduce() output and finally memoize the object
--> 331 self.save_reduce(obj=obj, *rv)
332
333 def persistent_id(self, obj):
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_reduce(self, func, args, state, listitems, dictitems, obj)
673
674 if dictitems is not None:
--> 675 self._batch_setitems(dictitems)
676
677 if state is not None:
/usr/lib/python2.7/pickle.pyc in _batch_setitems(self, items)
679 for k, v in tmp:
680 save(k)
--> 681 save(v)
682 write(SETITEMS)
683 elif n:
/usr/lib/python2.7/pickle.pyc in save(self, obj)
284 f = self.dispatch.get(t)
285 if f:
--> 286 f(self, obj) # Call unbound method with explicit self
287 return
288
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_inst(self, obj)
591 self.save_image(obj)
592 else:
--> 593 self.save_inst_logic(obj)
594 dispatch[types.InstanceType] = save_inst
595
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_inst_logic(self, obj)
556
557 if self.bin:
--> 558 save(cls)
559 for arg in args:
560 save(arg)
/usr/lib/python2.7/pickle.pyc in save(self, obj)
284 f = self.dispatch.get(t)
285 if f:
--> 286 f(self, obj) # Call unbound method with explicit self
287 return
288
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_global(self, obj, name, pack)
511 sendRef = False
512 if not sendRef:
--> 513 self.save_class_obj(obj, name, pack)
514 return
515
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_class_obj(self, cobj, name, pack)
452 #print 'save %s' % d['dict']
453 # save dct needed
--> 454 self.save(d)
455 self.write(pickle.TUPLE)
456 self.write(pickle.REDUCE) # apply _fill_class on tuple
/usr/lib/python2.7/pickle.pyc in save(self, obj)
284 f = self.dispatch.get(t)
285 if f:
--> 286 f(self, obj) # Call unbound method with explicit self
287 return
288
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_dict(self, obj)
171 self.save_reduce(_get_module_builtins, (), obj=obj)
172 else:
--> 173 pickle.Pickler.save_dict(self, obj)
174 dispatch[pickle.DictionaryType] = save_dict
175
/usr/lib/python2.7/pickle.pyc in save_dict(self, obj)
647
648 self.memoize(obj)
--> 649 self._batch_setitems(obj.iteritems())
650
651 dispatch[DictionaryType] = save_dict
/usr/lib/python2.7/pickle.pyc in _batch_setitems(self, items)
679 for k, v in tmp:
680 save(k)
--> 681 save(v)
682 write(SETITEMS)
683 elif n:
/usr/lib/python2.7/pickle.pyc in save(self, obj)
284 f = self.dispatch.get(t)
285 if f:
--> 286 f(self, obj) # Call unbound method with explicit self
287 return
288
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_function(self, obj, name, pack)
273 modList = list(mainmod._pyc_forcedImports)
274 self.savedForceImports = True
--> 275 self.save_function_tuple(obj, modList)
276 return
277 else: # func is nested
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_function_tuple(self, func, forced_imports)
334
335 # save the rest of the func data needed by _fill_function
--> 336 save(f_globals)
337 save(defaults)
338 save(closure)
/usr/lib/python2.7/pickle.pyc in save(self, obj)
284 f = self.dispatch.get(t)
285 if f:
--> 286 f(self, obj) # Call unbound method with explicit self
287 return
288
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_dict(self, obj)
171 self.save_reduce(_get_module_builtins, (), obj=obj)
172 else:
--> 173 pickle.Pickler.save_dict(self, obj)
174 dispatch[pickle.DictionaryType] = save_dict
175
/usr/lib/python2.7/pickle.pyc in save_dict(self, obj)
647
648 self.memoize(obj)
--> 649 self._batch_setitems(obj.iteritems())
650
651 dispatch[DictionaryType] = save_dict
/usr/lib/python2.7/pickle.pyc in _batch_setitems(self, items)
679 for k, v in tmp:
680 save(k)
--> 681 save(v)
682 write(SETITEMS)
683 elif n:
/usr/lib/python2.7/pickle.pyc in save(self, obj)
284 f = self.dispatch.get(t)
285 if f:
--> 286 f(self, obj) # Call unbound method with explicit self
287 return
288
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_global(self, obj, name, pack)
511 sendRef = False
512 if not sendRef:
--> 513 self.save_class_obj(obj, name, pack)
514 return
515
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_class_obj(self, cobj, name, pack)
452 #print 'save %s' % d['dict']
453 # save dct needed
--> 454 self.save(d)
455 self.write(pickle.TUPLE)
456 self.write(pickle.REDUCE) # apply _fill_class on tuple
/usr/lib/python2.7/pickle.pyc in save(self, obj)
284 f = self.dispatch.get(t)
285 if f:
--> 286 f(self, obj) # Call unbound method with explicit self
287 return
288
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_dict(self, obj)
171 self.save_reduce(_get_module_builtins, (), obj=obj)
172 else:
--> 173 pickle.Pickler.save_dict(self, obj)
174 dispatch[pickle.DictionaryType] = save_dict
175
/usr/lib/python2.7/pickle.pyc in save_dict(self, obj)
647
648 self.memoize(obj)
--> 649 self._batch_setitems(obj.iteritems())
650
651 dispatch[DictionaryType] = save_dict
/usr/lib/python2.7/pickle.pyc in _batch_setitems(self, items)
679 for k, v in tmp:
680 save(k)
--> 681 save(v)
682 write(SETITEMS)
683 elif n:
/usr/lib/python2.7/pickle.pyc in save(self, obj)
284 f = self.dispatch.get(t)
285 if f:
--> 286 f(self, obj) # Call unbound method with explicit self
287 return
288
/usr/local/lib/python2.7/dist-packages/molnsutil-0.0.2-py2.7.egg/molnsutil/molns_cloudpickle.pyc in save_function(self, obj, name, pack)
206
207 name = obj.name
--> 208 modname = pickle.whichmodule(obj, name)
209 #print 'which gives %s %s %s' % (modname, obj, name)
210 try:
/usr/lib/python2.7/pickle.pyc in whichmodule(func, funcname)
815 if module is None:
816 continue # skip dummy package entries
--> 817 if name != 'main' and getattr(module, funcname, None) is func:
818 break
819 else:
/usr/lib/python2.7/dist-packages/scipy/lib/six.pyc in getattr(self, attr)
114 if attr in ("file", "name") and self.mod not in sys.modules:
115 raise AttributeError
--> 116 _module = self._resolve()
117 value = getattr(_module, attr)
118 setattr(self, attr, value)
/usr/lib/python2.7/dist-packages/scipy/lib/six.pyc in _resolve(self)
103
104 def _resolve(self):
--> 105 return _import_module(self.mod)
106
107 def getattr(self, attr):
/usr/lib/python2.7/dist-packages/scipy/lib/six.pyc in _import_module(name)
74 def _import_module(name):
75 """Import module, returning the module after the last dot."""
---> 76 import(name)
77 return sys.modules[name]
78
ImportError: No module named _winreg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions