cpu-cores

Will a multi-threaded application be actually faster than a single-threaded application?

夙愿已清 提交于 2019-12-04 23:46:17
问题 All is entirely theoretical, the question just came to mind and I wasn't entirely sure whats the answer: Assume you have an application that calculates 4 independent calculations. (Totally independent, doesn't matter what order you do them and you don't need one to calculate another). Also assume those calculations are long (minutes) and CPU-bound (not waiting for any kind of IO) 1) Now, if you have a 1-processor computer, a single thread application will logically be faster than (or the same

How many CPU cores has a heroku dyno?

房东的猫 提交于 2019-12-03 22:26:02
I'm using Django with Celery 3.0.17 and now trying to figure out how many celery workers are run by default. From this link I understand that (not having modified this config) the number of workers must be currently equal to the number of CPU cores. And that's why I need the former. I wasn't able to find an official answer by googling or searching heroku's dev center . I think it's 4 cores as I'm seeing 4 concurrent connections to my AMQP server, but I wanted to confirm that. Thanks, J The number of CPUs is not published and is subject to change, but you can find out at runtime by running grep

Will a multi-threaded application be actually faster than a single-threaded application?

ぃ、小莉子 提交于 2019-12-03 14:58:15
All is entirely theoretical, the question just came to mind and I wasn't entirely sure whats the answer: Assume you have an application that calculates 4 independent calculations. (Totally independent, doesn't matter what order you do them and you don't need one to calculate another). Also assume those calculations are long (minutes) and CPU-bound (not waiting for any kind of IO) 1) Now, if you have a 1-processor computer, a single thread application will logically be faster than (or the same as) a multithreaded application. As the computer not able to do more then one thing at a time with one

Using spark-submit, what is the behavior of the --total-executor-cores option?

China☆狼群 提交于 2019-12-03 11:38:25
I am running a spark cluster over C++ code wrapped in python. I am currently testing different configurations of multi-threading options (at Python level or Spark level). I am using spark with standalone binaries, over a HDFS 2.5.4 cluster. The cluster is currently made of 10 slaves, with 4 cores each. From what I can see, by default, Spark launches 4 slaves per node (I have 4 python working on a slave node at a time). How can I limit this number ? I can see that I have a --total-executor-cores option for "spark-submit", but there is little documentation on how it impacts the distribution of

Is there a way to reliably detect the total number of CPU cores?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 16:47:28
I need a reliable way to detect how many CPU cores are on a computer. I am creating a numerically intense simulation C# application and want to create the maximum number of running threads as cores. I have tried many of the methods suggested around the internet like Environment.ProcessorCount, using WMI, this code: http://blogs.adamsoftware.net/Engine/DeterminingthenumberofphysicalCPUsonWindows.aspx None of them seem to think a AMD X2 has two cores. Any ideas? Edit: it appears that Environment.ProcessorCount is returning the correct number. It's on a intel CPU with hyperthreading that is

Is there a way to reliably detect the total number of CPU cores?

别等时光非礼了梦想. 提交于 2019-12-01 15:26:27
问题 I need a reliable way to detect how many CPU cores are on a computer. I am creating a numerically intense simulation C# application and want to create the maximum number of running threads as cores. I have tried many of the methods suggested around the internet like Environment.ProcessorCount, using WMI, this code: http://blogs.adamsoftware.net/Engine/DeterminingthenumberofphysicalCPUsonWindows.aspx None of them seem to think a AMD X2 has two cores. Any ideas? Edit: it appears that

Deceive the JVM about the number of available cores (on linux)

拟墨画扇 提交于 2019-11-29 01:36:50
In some purpose it is needed to make JVM think about it runs on machine with N cores on board instead of real number of cores (e.g. 4 cores instead of 16 ). JVM runs under some Linux build, based on Mandriva/Red Hat Linux core. This question is borderline case because I expect various solutions of this problem. This is not pure linux-administration question, and it isn't pure programmer's question. So... any ideas? The following Java program prints the number of processors as seen by the Java VM: public class AvailableProcessors { public static void main(String... args) { System.out.println

How to get number of cores in Win32?

孤街醉人 提交于 2019-11-28 13:49:40
I'm writing a program in C on windows that needs to run as many threads as available cores. But I dont know how to get the number of cores. Any ideas? You can call the GetSystemInfo WinAPI function; it returns a SYSTEM_INFO struct, which has the number of processors (which is the number of cores on a system with multiple core CPUs). You can read NUMBER_OF_PROCESSORS environment variable. James Black Even though the question deals with .NET and yours with C, the basic responses should help: Detecting the number of processors Type "cmd" on windows startup and open "cmd.exe". Now type in the

Android cpu cores reported in /proc/stat

空扰寡人 提交于 2019-11-28 10:38:34
I am developing an Android application that shows the CPU load per core and memory consumption. For CPU load I am reading /proc/stat and for memory -> /proc/meminfo. However I see that the number of CPU cores in /proc/stat is changing during subsequent reading of the file. cpu 230599 10622 84595 1892023 8236 16 285 0 0 0 cpu0 138005 7992 58080 1738918 6407 16 278 0 0 0 intr 9136791 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9601 0 0 0 0 0 0 ....... ctxt 16904510 btime 1394641996 processes 16919 procs_running 2 procs_blocked 0 softirq 1688530 407 706934 422 1558 407 407 92978 324500 1267 559650 and after

Limit number of cores used in Keras

人走茶凉 提交于 2019-11-28 08:21:54
I have a shared machine with 64 cores on which I have a big pipeline of Keras functions that I want to run. The thing is that it seems that Keras automatically uses all the cores available and I can't do that. I use Python and I want to run 67 neural networks in a for loop. I would like to use half of the available cores. I can't find any way of limiting the number of cores in Keras... Do you have any clue? As @Yu-Yang suggested, I used this line before each fit I do : from keras import backend as K K.set_session(K.tf.Session(config=K.tf.ConfigProto(intra_op_‌​parallelism_threads=‌​32, inter