简体   繁体   English

Spyder在Ubuntu上运行代码的速度非常慢

[英]Spyder running code really slow on Ubuntu

I am trying to run some python code on a workstation with Ubuntu 14.04 LTS. 我正在尝试在具有Ubuntu 14.04 LTS的工作站上运行一些python代码。 The workstation has a Intel® Xeon(R) CPU E5-2630 v3 @ 2.40GHz × 16 processor, and all threads are activating and working. 该工作站具有Intel®Xeon(R)CPU E5-2630 v3 @ 2.40GHz×16处理器,并且所有线程正在激活并正在工作。 The problem is that I ran this code in windows (same machine) and it took 3 minutes to run running in Spyder, on Ubuntu running in Spyder it has been more than an hour, and the code hasn't finished running. 问题是我在Windows(同一台计算机)上运行了这段代码,并且在Spyder上运行花了3分钟,而在Spyder上运行的Ubuntu上已经花了一个多小时,并且代码还没有完成运行。 Spyder is only using 8% of my total CPU power!!! Spyder仅使用了我的CPU总功率的8%!!! and when I check system monitor only one thread is being used 100% and the rest either 0 or 1.**% where * is any integer from 0-9. 当我检查系统监视器时,仅100%使用一个线程,其余0或1。**%,其中*是0-9之间的任何整数。

Seems like either Ubuntu or Spyder is not using the full potential of the CPU and I have no clue why. 好像Ubuntu或Spyder都没有充分利用CPU的潜力,我也不知道为什么。 Hyperthreading is activated and all cores are being used by ubuntu. 超线程已激活,并且所有内核都被ubuntu使用。

edit: Ubuntu is using all threads, but python is not. 编辑:Ubuntu使用所有线程,但python不是。 In fact, Python is using only 1 CPU. 实际上,Python仅使用1个CPU。 I searched around the forums and found a thread of somebody who had the same problem 16 threads, only 1 being used. 我在论坛上四处搜索,发现有人遇到相同问题的线程有16个线程,仅使用了1个。 They fixed it by running this "os.system("taskset -p 0xffffffff %d"% os.getpid())" before your code. 他们通过在代码之前运行此“ os.system(” taskset -p 0xffffffff%d“%os.getpid())”来解决此问题。 This didn't do it for me. 这对我没做。 This is driving me insane, I really need to use all cores or this workstation is less powerful than my $200 laptop. 这让我发疯了,我真的需要使用所有内核,或者这个工作站的功能不如我的200美元笔记本电脑。

Try Continuum Intel's Math Kernel Library (MKL). 试用Continuum Intel的数学内核库(MKL)。 See here . 这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM