Questions tagged [parallelization]
Questions on parallel computing in Mathematica.
934
questions
8
votes
0
answers
88
views
How to parallelize Reap and Sow in Mathematica 14.0.0
I'm working with a huge amount of data, so I'm avoiding to use AppendTo. I used to use the Reap and ...
4
votes
1
answer
145
views
Effective use of idle cores when using parallelization
Assume I have 10 cores in a CPU. And I run ParallelMap on them:
LaunchKernels[10];
ParallelMap[F1,L1];
where L1 is a list of ...
1
vote
0
answers
89
views
The first step to Speed Up using GPU
If we run the following code, mathematica kernel uses only CPU :
LinearOptimization[
x + y, {x + 2 y >= 3, x >= -1, y >= -1}, {x, y}]
I want the ...
2
votes
0
answers
82
views
ParallelTable does not execute in parallel
I would like to construct a Table in Parallel in Mathematica. However, it only uses one Kernel for the calculation, the others run idle. My code looks like this (I will remove a big chunk of the ...
2
votes
0
answers
75
views
Optimizing prallel computing for nested integration
I need an advice for optimization of computing with ParallelMap, as well as general hints to speed up computing discussed below. I have several questions about this ...
5
votes
1
answer
65
views
Is it possible to force ParallelDo to periodically close and launch subkernels?
I have a function f which calls an external library that has a memory leak, so I kind of have to live with it.
I call this function thousands of times within ...
1
vote
1
answer
140
views
Parallelized Monte-Carlo
I'm trying to do a little Monte-Carlo, and the code is working great, but slows down when I try to increase the number of iterations, any suggestions on how I can parallelize this? Every way I've ...
2
votes
1
answer
45
views
Understanding Parallelization
I'm starting to use Mathematica's parallelization more frequently, and noticed an oddity I would appreciate to be explained. Please feel free to correct my terminology.
When on the main kernel, ...
3
votes
2
answers
187
views
Speed up the evaluation of For loop
I am writing a script to simulate the spins. I have used "For" loop, but the execution takes long time as I have a lot of dataset.
Has there any way to make it faster ?
Here is the code:
<...
1
vote
1
answer
169
views
Mathematica Not Seeing All CPU Cores
I have a machine with 112 CPU cores, but $ProcessorCount reports only 32 cores. Windows 11 sees all 112 cores, and other applications are able to use them, but Mathematica only sees 32. Any idea how ...
1
vote
1
answer
48
views
Sending definitions from the kernel to the subkernels: unnexpected differences for functions and variables
I don't understand the strange behaviour below. Is this expected?
...
1
vote
0
answers
86
views
Attempt to find a solution (out of potentially many) to a system of equations with FindInstance runs forever or crashes
I have a system of equations that in principle should have a solution (I would think not a unique one), which I want to solve. I am not interested in all solutions; I just want to locate one, assuming ...
0
votes
0
answers
71
views
Retrieving cached definitions from subkernel into the main kernel during parallelization
I am trying to do a computation that takes a lot of CPU time and it is quite computationally intensive. I want to make it Parallel instead of serial to compute the results faster.
Things I tried:
<...
1
vote
1
answer
174
views
Performance of polynomial functions in Mathematica vs Python [closed]
I am trying to compare the performance of Mathematica vs Python for vectorized operations involving polynomials. The data is floatMatrix which has dimensions (...
5
votes
2
answers
203
views
How to make FactorInteger iterative?
I want to factorize big numbers like 10^100. FactorInteger with no Automatic option can take a lot of time and as I know there ...
2
votes
1
answer
73
views
Parallel evaluation of Do loops [closed]
This is my first time trying to implement a parallel computation in Mathematica and my question could be very naive. I would like to ask how I can best implement the following:
I have several Do loops ...
0
votes
0
answers
55
views
I am having problem with initialization of parallelization in Mathematica
I have been using parallel computing in Mathematica for a couple of months. Today suddenly, parallel kernels are not starting. Can anyone tell me what can be the potential reason?
...
2
votes
2
answers
123
views
2
votes
0
answers
92
views
Asynchronous parallelization of LLM calls
The new LLM functionality in Mathematica 13.3 is really quite slick. But it is often the case that one wants to apply it to many items in parallel, i.e., to submit many jobs simultaneously. The ...
1
vote
0
answers
36
views
Sending definitions from the subkernels to the kernel
Sometimes it is convenient to define an indexed quantity g[i] as in
f[i_] := (Pause[5]; i^2);
Do[g[i] = f[i], {i, 10}];
A ...
5
votes
1
answer
87
views
Is it possible to improve the speed where parallelization is not efficient?
I tried to use Parallelize but did not boost the speed. how can improve the speed?
...
1
vote
0
answers
15
views
How can I distribute computations requiring socket connections with ParallelSubmit?
I have two computers over which I would like to distribute some large-scale computations. On each computer there is a TCP server, written in another language, that listens for requests and return the ...
0
votes
0
answers
37
views
Parallel Computing in the cloud
I'm currently processing a large dataset created from a search log of around 2.5 million entries using association rule mining. The pre-processing of the data alone to extract entities from the search ...
1
vote
0
answers
31
views
Getting DownValues from memoized function - ParallelEvaluate only uses one kernel at a time
I have the following code where I calculate primorial(n) using a memoized function. When I run this function in ParallelDo everything is fine - the calculation runs on 8 kernels.
But I want to use ...
1
vote
0
answers
39
views
Parallelization with procedural functions, e.g. `AddTo`, `PreIncrement`, and so on
I have a problem that procedural functions don't work with parallelization, e.g. AddTo and PreIncrement. At first, I thought it ...
1
vote
1
answer
52
views
ParallelTable and NC polynomial simplification
I use NC algebra to apply simplification rules on non commutative polynomials.
I would like to treat a huge number of polynomials, ~200, so I would like to run these computations in parallel.
However, ...
1
vote
0
answers
40
views
ParallelDo behaves unexpectedly (that is, against my expectations!) [closed]
Here's an example of a Do loop that performs as expected. (I realize that the DO loop is not the optimum construct here but my real work has a much more complicated structure so I've reduced to a ...
2
votes
2
answers
119
views
Speed up NDSolveValue
I'm trying to solve this differential equation to obtain the density matrix elements $\rho$.
$$\frac{d\rho}{dt}=-i\Big(H_{0}(t)\rho(t)-\rho(t)H_{0}(t)\Big)$$,
for Hermitian Hamiltonian $$H_{0}(t)=\...
1
vote
1
answer
63
views
Perform two computations in parallel without using ParallelTable or ParallelMap
I have two functions, f and g, that I wish to apply to large data sets, data1 and ...
1
vote
1
answer
109
views
Issue loading SubKernels`RemoteKernels` package for remote kernels in Mathematica
I am encountering a problem when trying to load the SubKernels`RemoteKernels package in Mathematica. The purpose of loading this package is to set up remote kernels ...
1
vote
0
answers
109
views
Random Seed and Parallelization in Compiled Functions
I am having trouble reproducing a random number from a compiled function with parallelization even with the random seed being set.
Specifically, running the following script should give the same value ...
1
vote
0
answers
56
views
Problem of " The kernel is not responsing to dynamic evaluation "
I am having this error again and again while using parallel computation. The code is fine because
it runs when I am not using parallel computation. But as it takes a lot of time to run ( around 3 - 4 ...
0
votes
0
answers
32
views
How do subkernels return results to the master kernel?
Assume you have a large Table defined in the master kernel. I want to compute its elements in parallel. I am familiar with ParallelTable but, for my particular case,...
5
votes
1
answer
85
views
Custom Graphics primitives can't work with parallel Rasterize
I tried to create Graphics primitives using the techniques in this, found problems with parallel rasterization
...
0
votes
1
answer
68
views
How to use ParallelTable and Eigensystem in right way?
I have the next matrices:
...
0
votes
0
answers
35
views
I am having problem in paralleltable and parallel sum ( Parallel computation in Mathematica)
You will receive the code here
I want to do parallel computation here because I have planning to go further level and it will take a much longer time. I could not understand what this error means and ...
0
votes
1
answer
85
views
What is the most concise way to parallelize over all Table components at the same time?
Question statement: Consider a Table with any number of indices {i,1,imax},{j,1,jmax},{k,1,kmax},.... Now I want to apply the same independent operation to each one ...
1
vote
2
answers
374
views
Parallelize a "For" cycle
I'm trying to parallelize a simple routine inside a "for" loop. Essentially, I need to compute the roots of a function $f(x)$ that depends on the discrete parameters $d$ and $R_0$. However, ...
0
votes
0
answers
90
views
How to prevent Mathematica from maximum CPU usage?
I have a high-demanding Mathematica task that uses Compile and turns on parallelization. While evaluating, it always consumes around 100% of CPU.
Could you please tell me how to reduce the maximal ...
1
vote
0
answers
51
views
Comparing performance of `ParallelMap` with pure function
Test data are here:
q = CloudGet[
"https://www.wolframcloud.com/obj/874e3b18-808a-404a-aaa0-4e3ad1ac4668"];
I construct interpolation and an equi-...
0
votes
0
answers
21
views
`ParallelMap` on `TimeSeries` not working properly, operations on `TimeSeries` extremely slow
I have this data:
CloudObject["https://www.wolframcloud.com/obj/25f4b06e-2c89-4909-841d-83b7888b6ed8"]
which you can get by
...
0
votes
0
answers
39
views
Parallel constructs and automatic kernel starting
The help gives an example on ParallelMap:
ParallelMap[(Pause[1]; f[#]) &, {a, b, c, d}] // AbsoluteTiming
I tried it and it ...
3
votes
2
answers
126
views
Efficient method (maybe parallel method) to calculate a 256$\times$256 matrix?
I want to calculate a matrix of shape 256$\times$256 as follows
...
1
vote
0
answers
22
views
Incorrect result for parallel run to calculate a Do loop? [closed]
I want to calculate the following Do loop
Clear["Global`*"];
pmat = ConstantArray[0, {4, 4}];
ParallelDo[pmat[[i, j]] = i*j, {i, 1, 4}, {j, 1, 4}];
pmat
...
0
votes
0
answers
31
views
ParallelTable stuck
I have Mathematica 12.1. I generate a data dat in the form x1, x2, x3, x4, func[x1,x2,x3,x4], then interpolate it obtaining a ...
0
votes
1
answer
95
views
How to start another notebook calculation when one notebook is running?
If your first notebook is running and needs a long time to finish, but you still need Mathematica to do other calculation in another notebook.
The second notebook will not start until the first ...
2
votes
0
answers
70
views
Argument value loss using Listable C-Compiled Function
In my recent studies, I have come across a very strange anomaly with C compiled functions. When I call a function that has the 'Listable' attribute while global variables are accessed through ...
5
votes
0
answers
167
views
Target Device->"GPU" Not Working For Machine Learning: LibraryFunction error
I'm running Wolfram Desktop version 13.2.1, and after downloading Visual Studio, Nvidia Toolkit version 12.1 and 11.2, and verifying that
...
9
votes
2
answers
370
views
Efficient way to store the terms of a summation in a list?
I have two matrices, A and B of the same dimension $Nr\times Nc$, with $Nr\gg Nc$.
Essentially, I am trying to put all the terms ...
3
votes
1
answer
67
views
What is the optimal way to get selected elements from a matrix?
I have a 2x2 matrix "M", and a list "ind" containing pairs of indices.
M = {{a, b, c}, {d, f, g}, {h, i, j}};
ind = {{1, 2}, {1, 1}, {3, 1}};
I ...