parallel-processing

Sub-Matrix computations

自古美人都是妖i 提交于 2020-01-24 00:58:08
问题 I want to calculate the pair wise distance between two sub-matrices of a matrix. For example I have a matrix A (MxN) and two blocks of that matrix B1 (mxn) and B2 (kxt). More specifically, I want to calculate the distance of the B1(1,1) element from all the other elements of the B2 and to do this process for all the B1 elements. To be more clear the B1 and B2 may be not compact parts of the matrices and basically the information I know is the coordinates of the elements of B1 and B2 on the

Parallel loop in python

删除回忆录丶 提交于 2020-01-24 00:23:10
问题 Hi there I'm trying to run a big for loop, 239500 iterations, I have made some tests and I've found that 200 takes me 1 hour, resulting in 2 months of cpu time. This is the loop: for i in range(0, MonteCarlo): print('Performing Monte Carlo ' + str(i) + '/' + str(MonteCarlo)) MCR = scramble(YearPos) NewPos = reduce(operator.add, YearPos) C = np.cov(VAR[NewPos, :], rowvar=0) s, eof = eigs(C, k=neof, which='LR') sc = (s.real / np.sum(s) * 100)**2 tcs = np.sum(sc) MCH = sc/tcs Hits[(MCH >= pcvar)

Parallel loop in python

十年热恋 提交于 2020-01-24 00:22:27
问题 Hi there I'm trying to run a big for loop, 239500 iterations, I have made some tests and I've found that 200 takes me 1 hour, resulting in 2 months of cpu time. This is the loop: for i in range(0, MonteCarlo): print('Performing Monte Carlo ' + str(i) + '/' + str(MonteCarlo)) MCR = scramble(YearPos) NewPos = reduce(operator.add, YearPos) C = np.cov(VAR[NewPos, :], rowvar=0) s, eof = eigs(C, k=neof, which='LR') sc = (s.real / np.sum(s) * 100)**2 tcs = np.sum(sc) MCH = sc/tcs Hits[(MCH >= pcvar)

mcmapply performance on multiple cores

落花浮王杯 提交于 2020-01-23 17:52:14
问题 I have a function which I want to run on around 3 million datapoints. I am trying to parallelise the function using mcmapply on a Ubuntu machine with 8 cores. The function takes in a list of length 3 million as well as 3 more vectors of length 3 million and 1 constant value cutoffyearmon . The code runs perfectly fine with 100000 rows of data within 2 minutes on a single core and throws no error. However, when I try to run the code in parallel on 6 cores of my machine using mcmapply it keeps

Parallel simulation of AES in C using Openmp

一曲冷凌霜 提交于 2020-01-23 16:22:05
问题 Here is my problem. I want to parallelize AES-128 encryption in C using Openmp. I am hardly getting any speedup with the following code using openmp. My machine is Quadcore intel i5 machine. Here is the code. Any suggestion how to parallelize this code further would be really really appreciated. Please take a look at the main function which is at the end of the code. AES code below consists of a few functions to achieve its functionality. Please suggest how to best extract parallelism from

Parallel simulation of AES in C using Openmp

末鹿安然 提交于 2020-01-23 16:21:12
问题 Here is my problem. I want to parallelize AES-128 encryption in C using Openmp. I am hardly getting any speedup with the following code using openmp. My machine is Quadcore intel i5 machine. Here is the code. Any suggestion how to parallelize this code further would be really really appreciated. Please take a look at the main function which is at the end of the code. AES code below consists of a few functions to achieve its functionality. Please suggest how to best extract parallelism from

Parallel Computing - Shuffle

我与影子孤独终老i 提交于 2020-01-23 11:22:28
问题 I am looking to shuffle an array in parallel. I have found that doing an algorithm similar to bitonic sort but with a random (50/50) re-order results in an equal distribution but only if the array is a power of 2. I've considered the Yates Fisher Shuffle but I can't see how I could parallel-ize it in order to avoid O(N) computations. Any advice? Thanks! 回答1: There's a good clear recent paper on this here and the references, especially Shun et al 2015 are worth a read. But basically you can do

How do I index codistributed arrays in a spmd block

感情迁移 提交于 2020-01-23 10:43:15
问题 I am doing a very large calculation (atmospheric absorption) that has a lot of individual narrow peaks that all get added up at the end. For each peak, I have pre-calculated the range over which the value of the peak shape function is above my chosen threshold, and I am then going line by line and adding the peaks to my spectrum. A minimum example is given below: X = 1:1e7; K = numel(a); % count the number of peaks I have. spectrum = zeros(size(X)); for k = 1:K grid = X >= rng(1,k) & X <= rng

Integrate Selenium Grid and Sikuli API

一笑奈何 提交于 2020-01-23 09:48:25
问题 Currently, I am working on the automation testing framework, which combines with both Selenium Grid and Sikuli API. I already implemented a library which includes functionality of Selenium and Sikuli, and it works well when I set up my hub and node on the same machine. However, this is just the same as running Selenium RC on the machine. So, in order to achieve parallel testing, my next step is to launch the nodes from other machines and register them to the hub machine. The idea environment

Wait for all threads in an Executor to finish?

微笑、不失礼 提交于 2020-01-23 07:04:27
问题 I'm implementing a parellel quicksort as programming practice, and after I finished, I read the Java tutorial page on Executors, which sound like they could make my code even faster. Unfortunately, I was relying on join()'s to make sure that the program doesn't continue until everything is sorted. Right now I'm using: public static void quicksort(double[] a, int left, int right) { if (right <= left) return; int i = partition(a, left, right); // threads is an AtomicInteger I'm using to make