Questions tagged [parallelization]
Questions on parallel computing in Mathematica.
927
questions
3
votes
2
answers
173
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
121
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 ...
0
votes
1
answer
40
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
69
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
154
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
194
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
68
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
36
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
120
views
2
votes
0
answers
62
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
35
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
80
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
14
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
34
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
47
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
39
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
114
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
53
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
79
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
105
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
51
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
31
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
82
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
65
views
How to use ParallelTable and Eigensystem in right way?
I have the next matrices:
...
0
votes
0
answers
27
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
74
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
372
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
86
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
50
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
37
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
121
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
21
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
28
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
90
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
69
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
152
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
...
0
votes
0
answers
37
views
Running two different functions in parallel in the same kernel session
I have a written a program with several helper functions, but in which two functions, fun1 and fun2, do the real work: they run ...
8
votes
2
answers
359
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
65
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 ...
3
votes
1
answer
36
views
Parallel Kernel inheritance problem for Protect
for the following program:
Unprotect[Power];
Power[0, 0] = 1;
Protect[Power];
ParallelTable[0^0, {4}]
I have the following result:
(kernel 1) Power::indet : ...
1
vote
1
answer
55
views
Variable replacement not working in ParallelTable
The following code produces different results using Table and ParallelTable. K and ...
0
votes
0
answers
43
views
How to plot a function efficiently without having to recalculate
I have to make a lot of graphs for two different functions Nzzp (which can be computed quickly without problem) and NzzG which requires three numerical integrations in a row so I'm using paralleltable ...
2
votes
1
answer
73
views
Why it is not possible to Append list in ParallelDo?
I'm trying to run long calculations, so I need to run it in parallel. I'm running two nested Do, and it works fine until I put ...
0
votes
1
answer
38
views
function with parallel iterations
coprimesParallelIter[n_] := DistributeDefinitions[GCD];
ClearAll;
ParallelTable[If[GCD[i, n] == 1, i, Nothing], {i, 1, n - 1}] //
Flatten // DeleteCases[Nothing]
...
1
vote
0
answers
152
views
Mathematica does not recognize all CPU kernels/cores [closed]
I am using Ubuntu 22 and Mathematica 13. According to the description of my laptop I should have four CPU cores, as seen in the following screenshot:
However, Mathematica only seems to recognize two ...
3
votes
1
answer
82
views
Parallel computing doesn't use my own settings
To differentiate the conjugate of a function,
I used such settings.
...