Tagged Questions
0
votes
0answers
32 views
Native numpy parallelization - multiplication and sum/average
Is there a way to enable automatic parallelization for basic numpy operations, like element-wise multiplication of arrays and basic numpy functions like np.sum and np.average?
I know that it is ...
0
votes
1answer
33 views
Getting exception when working with list and parallel loops
I have written a code like following below:
Parallel.ForEach(filteredList, (f) =>
{
var conditionMatchCount = itm.AsParallel().Max(i =>
// One point if ID matches
((i.ItemID ...
0
votes
1answer
57 views
iterating 2D array using parallel processing MPI
i am quite new to parallel processing. I have an example of calculating and storing elements of a 2D array in a sequential way. I wanted to convert this into a parallel program using MPI.
Following ...
0
votes
0answers
17 views
Elementwise integration using an array of start and end points, and coefficients -python
I have a function that has a parameter in it. I want to integrate this function with a lot of different parameter values and a lot of different start and stop values such that the output is an array.
...
0
votes
0answers
22 views
Using a txt document into parallel arrays
My problem is:Write a program to read each student’s name and raw score from a file by calling a method “readData()” and store this information into two parallel arrays “names” and “scores”. So ive ...
0
votes
1answer
85 views
Auto parallelization of simple DO loop - memory reference too complex
I am using Absoft pro Fortran and I have a piece of code as follows:
program test1
INTEGER :: q, CAPQ, ingrid(1:6), outgrid(1:10)
ingrid = (/1,2,3,4,5,6/)
outgrid = 0
CAPQ = 6
DO q=1,CAPQ
...
1
vote
0answers
46 views
Designing a Swift algorithm for parallel execution on mac os X
-- Short version --
What is the best way to parallelize an algorithm that performs pairwise comparisons between elements of a large array in Swift so that multiple cores are exploited?
-- Long ...
0
votes
0answers
38 views
C - MPI - dynamic 2d array - weird issue [duplicate]
I'm writing a parallel image processing algorithm in C using MPI.
The image is parsed to a 2d array , sliced according to the processors and sent to each process correctly!
The weird problem is that ...
0
votes
0answers
35 views
MPI Array and IO
I am new to MPI and i have this simple task but not getting it. The program generates random numbers across processors, uses MPI gather to compute as a single array, this array is then written to a ...
0
votes
1answer
27 views
Java Synchronized/Thread-safe/'Centralised" Array or an alternative which will be shared by other Threads
I want to create an array which will be shared between Threads. It means that an array should have an ability to be modified by every thread as well as used by checking the values inside it. The only ...
1
vote
2answers
100 views
C/C++ MPI: What is the easier way to split an array
I'm a beginner on MPI and I have one problem at that point when I tried to split an array into some subarrays.
To be more exactly I have an array, let's say int a[10]={1,3,2,7,8,12,5,7,68,10} and I'...
0
votes
1answer
56 views
How can I create a parallel stream from an array?
I can create a Stream from an array using Arrays.stream(array) or Stream.of(values). Similarly, is it possible to create a ParallelStream directly from an array, without creating an intermediate ...
2
votes
1answer
42 views
Update an array of 1000000 items in parallel
This is a question which was asked in previous year exam.
Consider the following fragment of C code:
int i, array[1000000];
array[0] = 0;
for (i = 1; i < 1000000; i++)
array[i] = array[i-1] + 3;...
2
votes
1answer
74 views
How would I use Dask to perform parallel operations on slices of NumPy arrays?
I have a numpy array of coordinates of size n_slice x 2048 x 3, where n_slice is in the tens of thousands. I want to apply the following operation on each 2048 x 3 slice separately
import numpy as ...
0
votes
2answers
34 views
Retrievieng SharedArray on Julia 0.4
Edit: I did try using fetch()
I seem to have break something in Julia this week. I had played with the SharedArray type on a computer with 12 threads (6 doble thread cpu), I maneged to get a result ...
1
vote
1answer
121 views
OpenCL reduction - 2D matrix to 1-D array
I have a 2-D array of size MxN, where N is a power of 2 greater than or equal to 16 and M is an arbitrary integer which is not a power of 2. For example the size of array A could be 200x32.
I would ...
0
votes
1answer
62 views
Using ping-pong technique to search for a value in 1D array?
suppose I want to use a GPU to search for a particular value in an unsorted 1D array of size 2^L, where L is a positive even integer. All the values in the array are unique.
Is it possible to use ...
2
votes
1answer
41 views
Optimal way to handle array indexing in parallel?
I have the following situation: I have a list of particles in a box of size L, where L is the length of one of the sides.
Next, I split the box into cells, where L/cell_dim = 7. So there are 7*7*7 ...
3
votes
1answer
92 views
C++ Parallelization: Fast way to “reinitialize” array
I am doing a parallel for loop in OpenMP.
Here is my problem: I have a 4D array, where the 4th dimension's depth is a maximum value--I might not use all of the elements of the 4th dimension. In this ...
1
vote
3answers
60 views
How to use openmp to parallelize the movement of array elements
Below code piece is the most time consuming in my program if the pArray is very large. last is the variable for the end position of this array, Idx is the variable for a specific position of the array,...
1
vote
2answers
99 views
How to use lock array indices using OpenMP?
I'm doing an n body simulation and I've an array which stores the acceleration of particles. Now I'm trying to parallelize my code and I've met with this problem, since the array is of type real, I'm ...
0
votes
0answers
40 views
How to efficiently parallelize a scikit SVM classification on a 2D image in Python
I'm using the scikit-learn package to do a SVM classification on an 2D image. Each pixel has 9 features on which the classification is based. Let's assume I have a successfully trained classifier clf, ...
-4
votes
1answer
53 views
java add two arrays in parallel [duplicate]
I already found this question here, but it be great to see more options.
How to add two arrays in Java in parallel manner?
I have 2 float/ double arrays (around 10.000 to 100.000 entries) where I ...
-1
votes
1answer
56 views
Using Shared Memory in Cuda
I got this function in Cuda ( C ):
__global__ void FUN1(float *data,int M){
int I=blockIdx.x * blockDim.x + threadIdx.x;
int J=blockIdx.y * blockDim.y + threadIdx.y;int k;
int index=I+J*...
1
vote
1answer
37 views
Parallelize Convert Sorted Array to Binary Search Tree Function
I am trying to parallelize my Convert Sorted Array to BST program in Java. Because my function runs in Divide and Conquer manner, I believe it is parallelizable, but have been stuck with the ...
3
votes
2answers
182 views
Python: easy way to modify array in parallel
The question might sound easy, but being new to parallelization in Python I am definitely struggling. I dealt with parallelization in OpenMP for C++ and that was a hell of a lot easier.
What I need to ...
0
votes
1answer
112 views
Goroutines sharing an array channel : trying to solve data race
I try to write a complex program with parallel goroutines. It is my first program with channels ;) Each goroutine returns an array and, unfortunately, the result is "random". If I run 10 times the ...
0
votes
0answers
100 views
MPI derived datatype .Send rows of an array of structs with MPI (C)
I got an MPI programm that uses MPI derived datatype.
I got a struct :
typedef struct Cars {
float x;
float y;
float z;
float maxDist;
int type; //Nq or Nc
int bx;
int by;
int bz;
int process;
} car;
...
2
votes
2answers
83 views
Parallelize nested for-loop on 3 dimensional array in R
Using R on a Windows machine, I am currently running a nested loop on a 3D array (720x360x1368) which cycles through d1 and d2 to apply a function over d3 and assemble the output to a new array of ...
2
votes
2answers
100 views
Parallelize data processing
I have a large matrix data that I want to "organize" in a certain way. The matrix has 5 columns and about 2 million rows. The first 4 columns are characteristics of each observation (these are ...
5
votes
1answer
110 views
how to parallelize this for-loop using reduction?
I am trying to make this for-loop parallelized by using Openmp, i recognized that there reduction in this loop so i added "#pragma omp parallel for reduction(+,ftab)",but it did not work and it gave ...
0
votes
0answers
13 views
Adding data from a column
I'm trying to create a Parallel Coordinate graph with a CSV file I have. The graph I'm trying to make looks like the image I have drawn here:
I'm having trouble displaying the data. I keep getting "...
1
vote
1answer
61 views
R parallel code for two arrays
I'm trying to process two 3d arrays using parallel computing in R. I have a function that takes two vectors as input, so I need to loop through the rows and columns of my arrays. Doing this in serial ...
-1
votes
1answer
49 views
A lot of 0's received when using cudaMemcpy()
I've just started to learn CUDA and i wanted to fill an array (a 2D array represented as a 1D array) with random numbers. I followed another posts in order to generate random numbers, but i don't know ...
0
votes
1answer
28 views
Java: Processing an array in parallel, find which position an exception occurred
First, I have an array which is filled with 0's except for position 5, which is filled with "a" (put there intentionally to throw an NumberFormatException).
And then I call testMethod passing the ...
0
votes
1answer
81 views
How to edit objects attributes from array using parallel/multithreading Hamsters.js Javascript lib
When using Hamster.js we have to define the parameter array as
params = {"array":my_array}
my_array is formed by elements with many attributes and I need to change the attributes x and y.
In the ...
1
vote
1answer
303 views
Can't get attribute 'abc' on <module '__main__' from 'abc_h.py'>
I am defining a function in python. Program file name itself is abc_d.py . I don't understand if i can import the same file inside again.
import numpy as np
import matplotlib.pyplot as plt
import ...
0
votes
0answers
67 views
Parallelize the initialization of an array
The code bellow is written in C for Linux. I was able to parallelize the computation of the array sum.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <pthread....
1
vote
2answers
67 views
How can I dynamically using for loop, push functions with different arguments to an array?
Currently I am trying to run in parallel the same function with different arguments using Node.JS
For this I use Async.js and i am struggling trying to push/stack functions to an array. The problem ...
0
votes
0answers
24 views
Counting all occurrences of a value in an array in parallel (PRAM Model)
I was trying to write some parallel code that would add 1 to a local variable if that item occurs in the array. Suppose we have an array of size N and N processors then:
for all i in parallel // i is ...
1
vote
2answers
70 views
Processing array in Go parallel : any risk of to much threads?
I have an additional question concerning my previous post Processing array in Go parallel : imagine that my arrays are very large, for example
a1 := []int{0, 1, 2, 3, 4...1000}
a2 := []int{10, 20, 30,...
2
votes
1answer
76 views
Processing arrays in Go parallel gives unexpected results
I am interested to calculate correlations in parallel in Go. The main problem I have is that all the Go processes seems to execute exactly the same calculation. I reproduced here the problem with a ...
6
votes
1answer
531 views
Shared array usage in Julia
I need to parallelise a certain task over a number of workers.
To that purpose I need all workers to have access to a matrix that stores the data.
I thought that the data matrix could be implemented ...
4
votes
2answers
329 views
Sorting an array in parallel using Streams
I have written a program that sorts an array with multiple threads by splitting the array into equal chunks and sorting in individual threads with a bubble sort. I have then used a merging algorithm ...
4
votes
2answers
171 views
Parallelize python loop numpy.searchsorted using cython
I've coded a function using cython containing the following loop. Each row of array A1 is binary searched for all values in array A2. So each loop iteration returns a 2D array of index values. Arrays ...
0
votes
2answers
41 views
Getting both values from 2 arrays
How am I able to output the corresponding value from the parallel array. (i.e if I was to search for "John" on the c# console, the corresponding number should appear "34". However, only the name john ...
2
votes
1answer
58 views
Basic operations combining two SharedArrays
I've spent the last month or so learning julia and I'm very impressed. In particular I'm analysing large amount of climate model output, I put all this into SharedArrays and adjust and plot it all in ...
-2
votes
3answers
860 views
Find prime numbers in an array using multithreading
I'm currently trying to modify a sequential prime program I worked on and incorporate multithreading. I'd like to specify the amount of threads to split the work, and then have each thread run an ...
1
vote
2answers
81 views
How to read a 2d text file into an 2d array with PLinq
I have a .txt file like this:
1,2,3,4,5
6,7,8,9,10
11,12,13,14,15
16,17,18,19,20
I want to read this file to an double array with PLinq with this code:
OpenFileDialog ofd = new ...
0
votes
1answer
160 views
How to send a 2D array in MPI with variation for each processor
I'm trying to take a randomly generated array on root 0, vary it slightly and randomly, and send each variation to another processor. Here is my code so far:
#include "stdio.h"
#include "stdlib.h"
#...