parallel-processing

What concepts or algorithms exist for parallelizing parsers?

≡放荡痞女 提交于 2021-02-20 10:16:25
问题 It seems easy to parallelize parsers for large amounts of input data that is already given in a split format, e.g. a large list of individual database entries, or is easy to split by a fast preprocessing step, e.g. parsing the grammatical structure of sentences in large texts. A bit harder seems to be parallel parsing that already requires quite some effort to locate sub-structures in a given input. Common programming language code looks like a good example. In languages like Haskell, that

What concepts or algorithms exist for parallelizing parsers?

可紊 提交于 2021-02-20 10:12:24
问题 It seems easy to parallelize parsers for large amounts of input data that is already given in a split format, e.g. a large list of individual database entries, or is easy to split by a fast preprocessing step, e.g. parsing the grammatical structure of sentences in large texts. A bit harder seems to be parallel parsing that already requires quite some effort to locate sub-structures in a given input. Common programming language code looks like a good example. In languages like Haskell, that

Parallel Processing for Setting Seed in R

此生再无相见时 提交于 2021-02-19 07:36:06
问题 I Have an R code that helps me to know at what seed when I use arima.sim() function to simulate ARIMA(1, 0, 0) it will actually simulate ARIMA of order 1, 0, 0 when auto.arima() function is employed for a check. MWE library(forecast) SEED_vector <- 1:10 arima_order_results <- data.frame() flag <- TRUE i <- 1 seed_out <- c() while(flag){ set.seed(SEED_vector[i]) ar1 <- arima.sim(n = 20, model=list(ar=0.8, order = c(1, 0, 0)), sd = 1) ar2 <- auto.arima(ar1, ic = "aicc") if(all(arimaorder(ar2)=

R: asynchronous parallel lapply

隐身守侯 提交于 2021-02-19 07:14:58
问题 The simplest way I've found so far to use a parallel lapply in R was through the following example code: library(parallel) library(pbapply) cl <- makeCluster(10) clusterExport(cl = cl, {...}) clusterEvalQ(cl = cl, {...}) results <- pblapply(1:100, FUN = function(x){rnorm(x)}, cl = cl) This has a very useful feature of providing a progress bar for the results, and is very easy to reuse the same code when no parallel computations are needed, by setting cl = NULL . However, one issue that I've

scipy optimise minimize — parallelisation options

自作多情 提交于 2021-02-19 05:49:05
问题 When running scipy optimize minimum using the L-BFGS-B method, I found that on certain computers, it uses all 8 cpu cores (see photo 1), on others it uses 4 out of 8 cores (see photo 2) and on others it only uses 1 core. I have not used any libraries/code to make it parallel -- it seems to be doing that by default. Is there a way that I can specify how many cores it should use easily? I couldn't find anything online that suggested scipy optimize uses parallelisation by default. fmin = scipy

What's a good strategy for processing a queue in parallel?

老子叫甜甜 提交于 2021-02-19 05:17:10
问题 I'm writing a program which needs to recursively search through a folder structure, and would like to do so in parallel with several threads. I've written the rather trivial synchronous method already - adding the root directory to the queue initially, then dequeuing a directory, queuing its subdirectories, etc., until the queue is empty. I'll use a ConcurrentQueue<T> for my queue, but have already realized that my loops will stop prematurely. The first thread will dequeue the root directory,

What's a good strategy for processing a queue in parallel?

99封情书 提交于 2021-02-19 05:16:06
问题 I'm writing a program which needs to recursively search through a folder structure, and would like to do so in parallel with several threads. I've written the rather trivial synchronous method already - adding the root directory to the queue initially, then dequeuing a directory, queuing its subdirectories, etc., until the queue is empty. I'll use a ConcurrentQueue<T> for my queue, but have already realized that my loops will stop prematurely. The first thread will dequeue the root directory,

What's a good strategy for processing a queue in parallel?

霸气de小男生 提交于 2021-02-19 05:15:44
问题 I'm writing a program which needs to recursively search through a folder structure, and would like to do so in parallel with several threads. I've written the rather trivial synchronous method already - adding the root directory to the queue initially, then dequeuing a directory, queuing its subdirectories, etc., until the queue is empty. I'll use a ConcurrentQueue<T> for my queue, but have already realized that my loops will stop prematurely. The first thread will dequeue the root directory,

Handling multiple exceptions from async parallel tasks

丶灬走出姿态 提交于 2021-02-18 22:13:27
问题 Problem Several tasks are run in parallel, and all, none, or any of them might throw exceptions. When all the tasks have finalized, all the exceptions that might have happened must be reported (via log, email, console output.... whatever). Expected behavior I can build all the tasks via linq with async lambdas, and then await for them running in parallel with Task.WhenAll(tasks) . Then I can catch an AggregateException and report each of the individual inner exceptions. Actual behavior An

Handling multiple exceptions from async parallel tasks

社会主义新天地 提交于 2021-02-18 22:13:05
问题 Problem Several tasks are run in parallel, and all, none, or any of them might throw exceptions. When all the tasks have finalized, all the exceptions that might have happened must be reported (via log, email, console output.... whatever). Expected behavior I can build all the tasks via linq with async lambdas, and then await for them running in parallel with Task.WhenAll(tasks) . Then I can catch an AggregateException and report each of the individual inner exceptions. Actual behavior An