multicore

Detect the number of cores on windows

狂风中的少年 提交于 2019-12-03 12:52:30
问题 If I am running R on linux or on a mac, I can detect the number of available cores using multicore:::detectCores() . However, there's no windows version of the multicore functions, so I can't use this technique on windows. How can I programmatically detect the number of cores on a windows machine, from within R? 回答1: The parallel package now has a function to detect the number of cores: parallel:::detectCores() . 回答2: This thread has a number of suggestions, including: Sys.getenv('NUMBER_OF

Multicore programming in Haskell - Control.Parallel

Deadly 提交于 2019-12-03 12:05:53
I'm trying to learn how to use the Control.Parallel module, but I think I didn't get it right. I'm trying to run the following code ( fibs.hs ). import Control.Parallel fib :: Int -> Int fib 0 = 0 fib 1 = 1 fib n = p `par` (q `pseq` (p + q)) where p = fib (n-1) q = fib (n-2) main = print $ fib 30 I compiled this with: ghc -O2 --make -threaded fibs.hs And then I get the following results executing this program (output of a Python script that runs each program 100 times and returns the average and standard deviation of the execution time): ./fibs +RTS -N1 -> avg= 0.060203 s, deviation = 0.004112

How Concurrent is Prolog?

有些话、适合烂在心里 提交于 2019-12-03 11:13:24
问题 I can't find any info on this online... I am also new to Prolog... It seems to me that Prolog could be highly concurrent, perhaps trying many possibilities at once when trying to match a rule. Are modern Prolog compilers/interpreters inherently* concurrent? Which ones? Is concurrency on by default? Do I need to enable it somehow? * I am not interested in multi-threading, just inherent concurrency. 回答1: In theory that seems attractive, but there are various problems that make such an

Parallel and Multicore Processing in R [closed]

一世执手 提交于 2019-12-03 09:50:16
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . This is towards the extreme in R's capabilities I think, but here goes... I'm doing some heavy processing in R in which I've written a function which does all the leg work from a single call. However, I'd like to thread or utilise more than a single core. I've looked at the Parallel package, which

How can I most effectively take advantage of multiple cores for short computations in .NET?

為{幸葍}努か 提交于 2019-12-03 09:50:08
问题 Here is the context: I am writing an interpreter in C# for a small programming language called Heron, and it has some primitive list operations which can be executed in parallel. One of the biggest challenges I am facing is to distribute the work done by the evaluator across the different cores effectively whenever a parallelizable operation is encountered. This can be a short or long operation, it is hard to determine in advance. One thing that I don't have to worry about is synchronizing

Is Multi-Threaded algorithm required to make use of Multi-core processors?

老子叫甜甜 提交于 2019-12-03 09:45:47
问题 I was just wondering whether we actually need the algorithm to be muti-threaded if it must make use of the multi-core processors or will the jvm make use of multiple core's even-though our algorithm is sequential ? UPDATE: Related Question: Muti-Threaded quick or merge sort in java 回答1: I don't believe any current, production JVM implementations perform automatic multi-threading. They may use other cores for garbage collection and some other housekeeping, but if your code is expressed

Dataflow Programming API for Java? [closed]

廉价感情. 提交于 2019-12-03 06:55:58
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. I am looking for a Dataflow / Concurrent Programming API for Java. I know there's DataRush , but it's not free. What I'm interested in specifically is multicore data processing, and not distributed, which rules out MapReduce or Hadoop . Any thoughts? Thanks,

How to run processes piped with bash on multiple cores?

不羁岁月 提交于 2019-12-03 05:59:21
问题 I have a simple bash script that pipes output of one process to another. Namely:. dostuff | filterstuff It happens that on my Linux system (openSUSE if it matters, kernel 2.6.27) these both processes run on a single core. However, running different processes on different cores is a default policy that doesn't happen to trigger in this case. What component of the system is responsible for that and what should I do to utilize multicore feature? Note that there's no such problem on 2.6.30 kernel

Parallelizing SQL queries in R

ぐ巨炮叔叔 提交于 2019-12-03 05:54:38
问题 I have six SQL queries that I script though R that each take a very long time (~30 minutes each). Once each query returns I then manipulate the data for some standard reports. What I'd like to do is use my multicore machine to run these SQL requests in parallel from R. I'm on a Windows machine with a Oracle DB. I was following a blog post to use doSNOW and foreach to try and split these requests and this is the best thing I can find on stackoverflow. I've been able to get the process to work

Why don't large programs (such as games) use loads of different threads? [closed]

我的梦境 提交于 2019-12-03 05:46:04
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I don't know how commercial games work inside very much, but the open source games I have come across don't seem to be massively into