parallel-processing

Strange Behaviour Using Scala Parallel Collections and setParallelism

我只是一个虾纸丫 提交于 2020-01-24 22:48:46
问题 I recently found out about Parallel Collection in Scala 2.9 and was excited to see that the degree of parallelism can be set using collection.parallel.ForkJoinTasks.defaultForkJoinPool.setParallelism. However when I tried an experiment of adding two vectors of size one million each , I find Using parallel collection with parallelism set to 64 is as fast as sequential (Shown in results). Increasing setParallelism seems to increase performance in a non-linear way. I would have atleast expected

Julia - Parallel mathematical optimizers

断了今生、忘了曾经 提交于 2020-01-24 20:01:10
问题 Im using GLPK with through Julia, and I need to optimize the same GLPK.Prob repeatedly. What changes between each optimization is that some combination of variables gets fixed to 0 simply put in pseudocode lp = GLPK.Prob() variables_to_block = [[1,2,3], [2,3], [6,7], [19,100,111]...] for i in variables_to_block block_vars(lp, i) simplex(lp) restore_vars(lp, i) end when I then run this, it looks like CPU1 acts as a scheduler, staying in the 9-11% range, and the load on CPU3 and CPU4 alternates

Julia: How to give multiple workers access to functions that are 'include(…)' into a module?

痞子三分冷 提交于 2020-01-24 18:56:36
问题 I have the following test module (MyMod.jl) to store some functions in Julia. Some of the core functions are written in serial. Other functions call the core functions in parallel. module MyMod export Dummy,distribute_data,recombine_data,regular_test,parallel_test function Dummy(icol,model,data,A,B) nz,nx,nh = size(model) # = size(A) = size(B) for ih = 1:nh for ix = 1:nx for iz = 1:nz data[iz,icol] += A[iz,ix,ih]*B[iz,ix,ih]*model[iz,ix,ih] end end end end function distribute_data(X, obj_name

OpenMP - How does the thread decide when to defer a task and when to execute immediately

别等时光非礼了梦想. 提交于 2020-01-24 15:37:26
问题 The OpenMP specification document says that "When a thread encounters a task construct, it may choose to execute the task immediately or defer its execution until a later time". However, the specification does not say how this choice is made. How does the thread decide when to execute the task immediately and when to defer the execution? If this is implementation specific, how does compilers like gcc solve this? 回答1: There are two conditions coming from the standard: When an if clause is

Variable scope in boot in a multiclustered parallel approach

无人久伴 提交于 2020-01-24 12:07:14
问题 I'm trying to figure out how to pass functions and packages to the boot() function when running parallel computations. It seems very expensive to load a package or define functions inside a loop. The foreach() function that I often use for other parallel tasks has a .packages and .export arguments that handles this (see this SO question) in a nice way but I can't figure out how to do this with the boot package. Below is a meaningless example that shows what happens when switching to parallel:

Variable scope in boot in a multiclustered parallel approach

♀尐吖头ヾ 提交于 2020-01-24 12:06:21
问题 I'm trying to figure out how to pass functions and packages to the boot() function when running parallel computations. It seems very expensive to load a package or define functions inside a loop. The foreach() function that I often use for other parallel tasks has a .packages and .export arguments that handles this (see this SO question) in a nice way but I can't figure out how to do this with the boot package. Below is a meaningless example that shows what happens when switching to parallel:

How to disable parallelism in OpenCV?

China☆狼群 提交于 2020-01-24 10:56:05
问题 I've built OpenCV using Intel IPP, so I suppose that whenever possible it's used (e.g. matrix multiplication). I want to test the scalability of my parallel application by comparing it with a serial version. In order to do so, when it I do: omp_set_num_threads(1); cv::setNumThreads(1); However, by monitoring the CPU usage I see that multiple CPUs are still used. Why is that? And how can I force the program execution by using just one CPU? 回答1: Re-building OpenCV from source with following

How to convert a for loop into parallel processing in Python?

喜夏-厌秋 提交于 2020-01-24 09:35:48
问题 I am still in very early stage of my learning of Python. Apologize in advance if this question sounds stupid. I have this set of data (in table format) that I want to add few calculated columns to. Basically I have some location lon/lat and destination lon/lat, and the respective data time, and I'm calculating the average velocity between each pair. Sample data look like this: print(data_all.head(3)) id lon_evnt lat_evnt event_time \ 0 1 -179.942833 41.012467 2017-12-13 21:17:54 1 2 -177

How to export many variables and functions from global environment to foreach loop?

别等时光非礼了梦想. 提交于 2020-01-24 09:32:06
问题 How can I export the global environment for the beginning of each parallel simulation in foreach? The following code is part of a function that is called to run the simulations. num.cores <- detectCores()-1 cluztrr <- makeCluster(num.cores) registerDoParallel(cl = cluztrr) sim.result.list <- foreach(r = 1:simulations, .combine = list, .multicombine = TRUE, ) %dopar% { #...tons of calculations using many variables... list(vals1, vals2, vals3) } stopCluster(cluztrr) Is it necessary to use

parallel computing in octave

只愿长相守 提交于 2020-01-24 06:14:06
问题 I found some sources online that indicate that there are tools for Octave that allow one to parallelize algorithms, but couldn't find any details or how to get and use them. Any help/insight into this would be great. 回答1: http://octave.sourceforge.net/parallel/ Just install the package and the function reference may help. 来源: https://stackoverflow.com/questions/7047840/parallel-computing-in-octave