Search code examples
pythonpython-2.7python-scoop

Exception and TypeError when using SCOOP


I would like to use SCOOP (Scalable COncurrent Operations in Python) in a high performance computing context. To test SCOOP, I installed the module in an Anaconda environment (4.10.3) with Python 2.7.18 on my Windows machine. When running this example script from the docs:

# -*- coding: utf-8 -*-

from __future__ import print_function
from scoop import futures

def helloWorld(value):
    return "Hello World from Future #{0}".format(value)

if __name__ == "__main__":
    returnValues = list(futures.map(helloWorld, range(16)))
    print("\n".join(returnValues))

I got the following output in my console.

(scoop) C:\Users\flyinthelotion\Downloads>python -m scoop -n 6 test_scoop.py
[2021-08-12 09:39:35,285] launcher  INFO    SCOOP 0.7 1.1 on win32 using Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 17:26:54) [MSC v.1500 64 bit (AMD64)], API: 1013
[2021-08-12 09:39:35,285] launcher  INFO    Deploying 6 worker(s) over 1 host(s).
[2021-08-12 09:39:35,286] launcher  INFO    Worker distribution:
[2021-08-12 09:39:35,286] launcher  INFO       127.0.0.1:       5 + origin
Hello World from Future #0
Hello World from Future #1
Hello World from Future #2
Hello World from Future #3
Hello World from Future #4
Hello World from Future #5
Hello World from Future #6
Hello World from Future #7
Hello World from Future #8
Hello World from Future #9
Hello World from Future #10
Hello World from Future #11
Hello World from Future #12
Hello World from Future #13
Hello World from Future #14
Hello World from Future #15
Exception Exception TypeErrorTypeError: : ""''NNoonneeTTyyppee''  oobbjjeecctt  iiss  nnException ooTypeErrortt:   "cc'aaNllollnaaebbTllyeep""e in  in '<< bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000004141C18>>bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003DB2C18>>o ignored
Exception Exception bTypeErrorTypeError ignored
j: : Exception e""TypeErrorc: ''t"NN 'ooiNnnsoee nTTneyyoTpptyee p''ce  a'ool bblojjebaecjbctelt ce it"is  in s i< nsbound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003882C18>>no  ignored
ntoException o tTypeErrortc :  ac"cla'allNlalolbanalbelebTe"ly" in ep in <"e<bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003492C18>> in 'bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000004141F28>> ignored
Exception Exception <  ignored
Exception TypeErrorTypeErrorbound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003DB2F28>>oException TypeError: :  ignored
bTypeError: ""Exception j: "''TypeErrore"'NN: c'NNo"tooon' nnneNieeeTosTTTyn yyypenpppeToee'yte'' p '  oec 'obaoo bjlbbojeljjbecaeejctbccet lttc ie  tis"ii s  in ssi n<  snobound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003882F28>>nn ot ignored
oont Exception tto cTypeError  tca: cc al"aacll'llalaNlllaboaalblnbbaleellbe"Teel" in y""e in <p in  in "<bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003365C18>>e<< in bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003492F28>> ignored
'bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003945C18>>bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000004141F98>>< ignored
Exception   ignored
 ignored
bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003DB2F98>>Exception TypeErroroException  ignored
TypeError: bTypeError: "j: "'e"'Nc'NotNon oneineTseTy Typnyepop'ete ' 'o c boaojblbejljceaetcbc tlti e si"i s in sn < ontnbound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003882F98>>o o ignored
tct a clcalalallb[lal2021-08-12 09:39:37,559] launcher  (127.0.0.1:51026) INFO    Root process is done.
abebl"l in ee<"[2021-08-12 09:39:37,561] launcher  (127.0.0.1:51026) INFO    Finished cleaning spawned subprocesses.

Thus: SCOOP does what is needs to be doing but it also throws errors at the same time. The errors do not seem to have an impact on its performance though. Is this a problem for my future project, and how can I avoid these errors displaying?

Thanks


Solution

  • The message that the exception was ignored is because all exceptions raised in a __del__ method are ignored to keep the data model sane. docs

    If you want to cheap fix it yust try catch the error