Questions tagged [parallelization]

Questions on parallel computing in Mathematica.

Filter by
Sorted by
Tagged with
0
votes
0answers
31 views

Quit Mathematica script (no matter what)

I have a complicated script (not just written by me) that gets called using MathKernel -script script.m. Among others script.m ...
4
votes
0answers
58 views

Should I worry about concurrent access to LibraryLinked code?

According to these answers, when several heterogeneous results (say {MTensor, mint, double}) are needed to be returned from a LibraryLink ...
0
votes
1answer
54 views
-1
votes
0answers
62 views

Parallelizing or optimizing use of Outer and Integrate

I'm trying to optimize or parallelize the following code as it's slow for larger n ...
0
votes
0answers
35 views

Clear a variable on parallel kernels

I am running the following code: SetSharedVariable[a]; a= {}; x = 1; ParallelDo[ x += i; AppendTo[a, x] , {i, 1, 3}] I want to define variable x outside the ...
0
votes
0answers
60 views

Memory leak during parallel computing

I have a memory leak during parallel computing. The problem seems to be in how a large variable is passed to kernels but I can't think of anything to fix that. Consider this simplified example: ...
0
votes
0answers
46 views

Using Mathematica to run an external bash script

This seems like a straightforward problem, but I am having trouble. I have a bash script that runs a parallel process (OpenFoam). I would like to call this script from a Mathematica Module. Processes ...
1
vote
1answer
71 views

How to speed up (or parallelize) NDSolve?

Is there a way to speed up the following code: ...
1
vote
0answers
77 views

Speeding up value reassignments in ParallelTable

I am solving a differential equation of two closed functions using ParallelTable. For the attached code, I thought the computation time should be approximately proportional to ...
1
vote
2answers
73 views

How can I test if the sum of two divisors of a number add up to a perfect square? [closed]

Let's say I have a number $n$ and I want to find the divisors of $n$, I can do that using Divisors[n]. That will generate a list ...
1
vote
0answers
51 views

Parallelizing construction of sparsearray

I'm constructing sparse arrays where blocks of each array are results of the integral defined in integralList ...
1
vote
0answers
66 views

Definite integral gets stuck in the calculation

$f=\frac{\sinh ^{-1}\left(e^{-2 k t} \sinh (6 k)\right)}{2 k}-2$ for $k=20$ I have: $\frac{df}{dt}=-\frac{e^{-20 t} \sinh (60)}{\sqrt{e^{-40 t} \sinh ^2(60)+1}}$ ...
0
votes
1answer
63 views

How to use parallel computation in mathematica for numerical Integration

I have a multi dimensional integral and I need to integrate it numerically and than plot it over an extra variable for zeta = 0.5. ...
1
vote
1answer
36 views

ParallelSum issue inside package

I have the following very simple package with only one external function SumSeries[]: ...
0
votes
0answers
28 views

Error using ParallelMap to evaluate NIntegrate of numerical derivative ND

I want to evaluate a numerical integration in which the integrand is constructed out of a function f and its derivative f'. <...
5
votes
1answer
112 views

Parallel/Multi-thread element code generation using AceGen

I am using AceGen to generate source code for finite element simulations in AceFEM. I have elements with a very large number of vertices/degrees of freedom which can take a very long time to compile. ...
0
votes
0answers
45 views

How to resolve these errors that pop up when using 'Compile' for a large function? [duplicate]

The problem I have been wanting to make my code which solves an optimisation problem faster. This led to this question on here and I realised from there that the root of the problem is the very slow <...
0
votes
0answers
32 views

Handling large data generated by a script file (using parallelization in Mathematica)

I want to write a script file Script_file.m which I am going to run on a server and collect all the data in a file named ...
1
vote
1answer
64 views

Why the computation time is shorter in this case?

The task I would like to compute the Lorentz transformation $\mathbf{p}'$ of an arbitrary 3-momentum vector $\mathbf{p}$ given a boost characterized by some other momentum vector $\mathbf{p}_{N}$. The ...
3
votes
3answers
76 views

How to avoid duplicating the same data on the master kernel into each subkernel?

I have found the same question Avoid copying memory for each subkernel However, there was no proper answer. This question was posted in 2015. Now it has been 6 years. So, I wish to find the solution ...
0
votes
0answers
50 views

How to parallelize Total[]?

I have a list of length ~10^4, with each element being a power series (SeriesData expression). The list has been computed by an earlier part of the code, but I'd like to sum up the list. The Total ...
0
votes
0answers
40 views

Can Predict/Classify/NetTrain be parallelized over multiple computers (kernels)?

A similar question was posted more than five years ago here and I was wondering if anything has changed and whether there is a way to parallelize Classify/Predict/NetTrain now. More specifically, ...
2
votes
0answers
42 views

ParallelTry Hangs on previously working code

When I run the below ParallelTry command, it just sits on it and says its being evaluated, but I cant abort it, it doesn't return what I am expecting, and I have to ...
2
votes
0answers
25 views

Save the internal state of each kernel and start the computation again later

I use ParallelEvaluate[], inside that is a lengthy code, many variables are calculated and updated may times, lets say a=..., b=..., c=... Lets say I want to stop calculation once, and start ...
15
votes
1answer
905 views

Metropolis-Hastings Algorithm - Significantly slower than Python

I would like to code a Metropolis Hasting algorithm and thought I would get the general scheme of things going with a toy example. I think I got it running but my Mathematica code runs significantly ...
5
votes
3answers
229 views

Speeding up FactorInteger for product of two primes

I have a large integer $N$ of size about 10^150. I know that $N$ is a product of two primes $p$ and $q$. I also know that both $p$ and $q$ are of roughly equal size, so one of them is not, for example,...
7
votes
1answer
148 views

Fast Evaluation of a series of dot product

Context I have a function that depends on 3 real variables x,y and z and that is defined by a series of matrix products. The evaluation of f for a specific (x,y,z) is fast ~0.02 sec but I want to ...
2
votes
0answers
61 views

Can I parallelize this function?

Can I and should I parallelize this function ? my aim is to have faster calculations below is a toy function in which I kept the structure of the real function I am using. It uses ...
0
votes
0answers
48 views

ParallelTable of NIntegrate of an Interpolating Function

I construct a 2D interpolating function using the following data (MWE): ...
0
votes
0answers
35 views

Memory leak while using ParallelTable

I am populating a table using ParallelTable. The entries of this table are given by a function written as a module, which depends on several modules itself. Here's a rough skeleton of the code: ...
1
vote
1answer
46 views

Unique symbol for parallel kernels

For each kernel, a unique symbol can be generated with Unique[]. However, since it's basically defined by the growing ...
0
votes
0answers
52 views

How to improve the parallelization of the following piece of code?

I'm new to the parallelization of code. I have a code that takes so much time to run and I'm trying to parallelize it. I'm copying below the piece that I need to improve. Can someone help with the ...
1
vote
1answer
36 views

Manipulating ScalingFunctions for several Plots inside Table is working, but not working inside ParallelTable

I've encountered a problem I can't make sense of: I'm combining the ListPlot of a HPLC chromatogram (called bgcorrected in this case) with a ...
0
votes
0answers
73 views

An issue with ParallelTable

Consider a function function[x_,y_,method_,distr_]:=NIntegrate[distr[x,y,z,t],{z,zmin[x,y],zmax[x,y]},{t,tmin[z,x,y],tmax[z,x,y]},Method->method] Here, ...
0
votes
0answers
50 views

Why does Mathematica 12.1 fail to launch available parallel kernels

I am running Mathematica 12.1 on Windows 10 Enterprise from a local PC with 24 cores using a remote site licence from my University. Under Parallel Configuration I have requested 24 local kernels (...
0
votes
1answer
53 views

Parallel evaluation produces wrong result

Consider the following code: ...
0
votes
0answers
25 views

parallel computation fails

I have a code that evaluates matrix elements. It works correctly in sequential mode (one Kernel). It involves a custom function BariVi which is declared earlier and ...
0
votes
0answers
46 views

Finding if a number is perfect square [duplicate]

I used the following code to found if a specific number is a perfect square: ...
0
votes
0answers
45 views

Run Batch Job on more than One node of HPC

In continuation of the previous Ques; I am able to run successfully my batch job on one node of HPC through- pqsub -n 40 -t 1 -q atulya run.sh #atulya is HPC and at ...
1
vote
0answers
30 views

Easiest Way To Parallelize Derivatives

What I would like to do I have a Lagrangian (a scalar). Of this function I take the derivative w.r.t. to metric-components. Of the result, I take again a derivative. The formula looks like $\partial_a\...
0
votes
1answer
149 views

Running Mathematica package on supercomputers by parallelizing it

a) I am thinking of installing Mathematica on supercomputers of my center. and running programs by parallelizing it for faster computations. But I was told that running Mathematica on supercomputers ...
2
votes
0answers
45 views

ParallelTable never ends on simple ContourPlot loop

Context I am interested in solving Transient Gray Scott equations. Following the documentation: I define the equations ...
2
votes
1answer
84 views

Parameter space search routine is too fast?

I wrote a small script to comb through the parameter space of a function looking for where the function satisfies a certain relation everywhere on its (co-ordinate space) domain. However, since I am ...
1
vote
0answers
56 views

Optimizing a parameter space search

This is related to my previous question: Solve for parameters so that a relation is always satisfied The Problem I am searching the parameter space of a large (many terms) function to find where the ...
1
vote
1answer
27 views

How to share multiple “tagged” functions (symbols) like f[a][b] in parallel kernels?

I would like to give some context: I need to analyse many data sets stored in files using different kind of analyses. To keep track I like to tag each results of my analysis for example like ...
1
vote
1answer
44 views

How to collect results from compiled function in ParallelEvaluate?

I am using Mathematica 12.x and have a compiled function, returning many things. I would like to run several instances of this compiled function, one for each core of my CPU, and then collect all of ...
6
votes
1answer
100 views

Efficient construction of a SparseArray from LIL (list of lists of column entries)

In Python scipy.sparse, there are methods to convert between CSR, CSC, LIL, DOK, etc. implementations of a sparse matrix. What is the most efficient way in Mathematica to construct a ...
0
votes
0answers
26 views

If statement in dynamic cluster query

I use a High-Performance Cluster for some of my work. I can dynamically see the state of the work but I couldn't use the If statement in the cluster query. I want to hear a sound when my work finishes....
0
votes
1answer
77 views

Use of ParallelDo with an iterative or recursive calculation

Is it possible to use ParallelDo (or any similar parallelization method) to speed up the calculation of an iterative calculation, which takes a previous calculation ...
0
votes
1answer
45 views

EvaluationObject not appearing

By using ParallelSubmit[1 + 2] the output is simply EvaluationObject[16,1+2,<>] I was expecting to see . Even in the ...

1
2 3 4 5
16