multicore

Perl fork queue for n-Core processor

时光总嘲笑我的痴心妄想 提交于 2020-01-15 23:03:07
问题 I am writing an application similar to what was suggested here. Essentially, I am using Perl to manage the execution of multiple CPU intensive processes in parallel via fork and wait. However, I am running on a 4-core machine, and I have many more processes, all with very dissimilar expected run-times which aren't known a priori. Ultimately, it would take more effort to estimate the run times and gang them appropriately, than to simply utilize a queue system for each core. Ultimately I want

Is it possible to prevent children inheriting the CPU/core affinity of the parent?

北慕城南 提交于 2020-01-14 20:01:54
问题 I'm particularly interesting in doing this on Linux, regarding Java programs. There are already a few questions that say you have no control from Java, and some RFEs closed by Sun/Oracle. If you have access to source code and use a low-level language, you can certainly make the relevant system calls. However, sand-boxed systems - possibly without source code - present more of a challenge. I would have thought that a tool to set this per-process or an kernel parameter are able to control this

what's the difference between parallel and multicore programming?

偶尔善良 提交于 2020-01-13 19:01:32
问题 I think the topic says it all. What's the difference, if any, between parallel and multicore programming? Thanks. 回答1: Mutli-core is a kind of parallel programming. In particular, it is a kind of MIMD setup where the processing units aren't distributed, but rather share a common memory area, and can even share data like a MISD setup if need be. I believe it is even disctinct from multi-processing, in that a multi-core setup can share some level of caches, and thus cooperate more efficiently

Hadoop and map-reduce on multicore machines

冷暖自知 提交于 2020-01-13 08:39:07
问题 I have read a lot about Hadoop and Map-Reduce running on clusters of machines. Does some one know if the Apache distribution can be run on an SMP with several cores. In particular, can multiple Map-Reduce processes be run on the same machine. The scheduler will take care of spreading them across multiple cores. Thanks. - KG 回答1: Yes. You have multiple map and reduce slots in each machine which are determined by the RAM and CPU (each JVM instance needs 1GB by default so a 8GB machine with 16

move from pandas to dask to utilize all local cpu cores

做~自己de王妃 提交于 2020-01-12 08:50:39
问题 Recently I stumbled upon http://dask.pydata.org/en/latest/ As I have some pandas code which only runs on a single core I wonder how to make use of my other CPU cores. Would dask work well to use all (local) CPU cores? If yes how compatible is it to pandas? Could I use multiple CPUs with pandas? So far I read about releasing the GIL but that all seems rather complicated. 回答1: Would dask work well to use all (local) CPU cores? Yes. how compatible is it to pandas? Pretty compatible. Not 100%.

multicore and data.table in R

人走茶凉 提交于 2020-01-12 05:33:07
问题 I am attempting to use multicore function parallel with data.table and am unable to quite come up with the right way to do this. Code: require(multicore) require(data.table) dtb = data.table(a=1:10, b=1:2) x = dtb[,parallel(a+1),by=b] > x b pid fd 1: 1 12243 3 2: 1 12243 6 3: 2 12247 4 4: 2 12247 8 I would like to call collect() on this but these are no longer parallel objects. How should one do this? 回答1: I think this is along the lines of what you want: collect(dtb[, list(jobs = list

Is it possible to set affinity with sched_setaffinity in Android?

允我心安 提交于 2020-01-10 10:19:10
问题 Is it possible to set CPU affinity in native C code compiled with the Android NDK? Since the system is using a Linux kernel, it should be possible to use the sched_setaffinity/sched_getaffinity functions, but when I compile with the NDK, I get errors complaining that the cpu_set_t type is unknown (which is used as an argument to the functions). Is there any other way to accomplish this? When I compile with CodeSourcerys ARM compiler (arm-none-linux-gnueabi-gcc) this does not seem to be a

What instruction set is used by Tilera microprocessors?

[亡魂溺海] 提交于 2020-01-03 08:17:08
问题 Is there any documentation on this? I'm trying to get a handle on the feasibility of writing a compiler for the Tilera architecture. 回答1: The source code of their gcc compiler at www.tilera.com/scm includes gcc-style machine description (.md) files that define the instructions and other micro-architectural details needed by a compiler writer. 回答2: Rephrasing this answer, for clarity. Many references on the web claim they're supposedly MIPS derivates; on the other hand, neither has MIPS' own

What instruction set is used by Tilera microprocessors?

痴心易碎 提交于 2020-01-03 08:16:42
问题 Is there any documentation on this? I'm trying to get a handle on the feasibility of writing a compiler for the Tilera architecture. 回答1: The source code of their gcc compiler at www.tilera.com/scm includes gcc-style machine description (.md) files that define the instructions and other micro-architectural details needed by a compiler writer. 回答2: Rephrasing this answer, for clarity. Many references on the web claim they're supposedly MIPS derivates; on the other hand, neither has MIPS' own

Performance in multithreaded Java application

蓝咒 提交于 2020-01-02 19:14:12
问题 I want to understand performance in multithreaded environments. For that I have written a small test that I ran on my machine (quad-core Intel, Windows XP, Sun JDK 1.6.0_20), with surprising results. The test is basically a thread-safe counter that is synchronized using either the synchronized keyword or an explicit lock. Here is the code: import java.util.concurrent.locks.ReentrantLock; public class SynchronizedPerformance { static class Counter { private static final int MAX = 1 << 24; int