Print

Print


On May 29, 2018, at 9:09 AM, Adam Constabaris <[log in to unmask]> wrote:

> I don't know if spacy has anything built in for this, but I'd recommend
> going in the direction suggested by Flannon and one of the answers on Stack
> Overflow, and use your OS to do the limiting, if it supports that.


Yes, thank you. I do not think there is a Spacy-way to limit the number of processors used in a... process. So I took advantage of a Linux utility called taskset to do the limitation. I added the following line to my Python code, and now my program behaves itself accordingly:

  # limit ourselves is a few processors only
  os.system( "taskset -pc 0-1 %d > /dev/null" % os.getpid() )

Thanks all who replied.

--
Eric Morgan