Questions tagged [parallelization]

Questions on parallel computing in Mathematica.

Filter by
Sorted by
Tagged with
8
votes
1answer
280 views

Parallelize[Mapindexed[]], level={-1}? Sal Mangano's 《Cookbook》

It is easy to Parallelize[] Map[] & MapIndexed[], as having been shown in MMA9 Help for ParallelMap[] and Parallelize[]. For MapIndexed[], the default levelspec is {1}. However there are many ...
8
votes
0answers
387 views

WolframScript never exits (v11 only)

after updating to version 11, I came across a problem with the execution of package files via bash. The WolframScript program runs the entire code, but frequently it does not exit properly and as a ...
7
votes
2answers
2k views

Can this code be changed to run faster?

I've worked for several days trying to get this code to run faster. The imported data is 15MB. ...
7
votes
2answers
668 views

Assignments in ParallelDo when using indexed variables

For convenience I use an indexed variables syntax to hold results of long computations for different integer parameters: ...
7
votes
1answer
320 views

How to make this code threadsafe?

I have the following code, schematically: ...
7
votes
2answers
668 views

Can Mathematica Take Advantage Of a AMD Ryzen Threadripper 2990wx 32 Core Processor?

I have a student version of Mathematica. I'm currently running it on my 8 Core Desktop. On my current Desktop I use it for Numerically integrating expressions 1000s of times, the ParallelTable ...
7
votes
2answers
430 views

Do SetSharedVariable/SetSharedFunction ruin the benefits of ParallelTable?

Edit: I changed the sample code to get at my question better. Slowdown due to accessing a shared variable is a much more relevant issue (to me at least) than slowdown due to writing to a shared ...
7
votes
1answer
123 views

Documentation example gives different answer in Mathematica 11.3 [duplicate]

I have been looking at the very first example on this page of the documentation in Mathematica 11.3 (default installation options) and I get a different result: ...
7
votes
1answer
307 views

Register “initialization code” to run on any newly started parallel kernel

Is it possible to register a some "initialization code" to be run on any newly started parallel kernel? This would be similar to how ParallelNeeds registers a ...
7
votes
1answer
693 views

Progress indicator with shared variables

I'm trying to create a custom progress indicator for a parallelized computation, using Dynamic and SetSharedVariables to display ...
7
votes
2answers
141 views

Parallelize GroupBy

I have a huge list longList that I want to split into two parts depending on whether an element of the list satisfies the condition: ...
7
votes
3answers
682 views

Parallel and non-Parallel functions return different results?

A friend of mine observed that when running ParallelMap or ParallelTable that he would get different results than when running <...
7
votes
1answer
207 views

Local logfiles for remote kernels

I'd like remote slave kernels to produce log files on my local machine, subject to the following constraints: 1) I don't want to install a distributed filesystem or do other administrative work on ...
7
votes
1answer
405 views

Setting $RecursionLimit across all parallel kernels

I'm trying to optimize an elliptic curve factoring method by running it in parallel. There is a recursive step which required me to set the recursion limit higher than 256, however when I try and run ...
7
votes
2answers
86 views

Parallelizing MapAt

What is the best way to parallelize MapAt? Only ParallelMap is provided, but seems bad when executing functions on a subset of a ...
7
votes
1answer
298 views

Remote Raspberry Pi Kernel from 2nd Raspberry Pi Front End

I've reviewed the following posts: Connecting two Raspberry Pi's using MathLink remote kernel through SSH How to connect the front end of one raspberry pi with the kernel of another But have been ...
7
votes
2answers
804 views

Communication between local kernels

this is my first post but you have already helped me so many times that I have to start by saying thanks a lot! I have a really long calculation to do, and I have used the Evaluation->Kernel ...
7
votes
1answer
83 views

Is there something wrong with DistributeDefinitions?

I have the following code, which fails to distribute the DownValues for the symbol f. Could anybody please explain what is wrong. ...
7
votes
1answer
465 views

Selecting the parallel kernels where tasks can be executed

When I use ParallelSubmit, is it possible to select on which kernel a task can possibly be executed? For example if have 3 parallel kernels, can I only use 2 of ...
7
votes
1answer
353 views

What do the elements of the Parallel Kernel Status screen mean?

I just managed to get my multiple kernels up and humming on a new multi-core machine, which I am quite happy about. I am slightly at a loss, though, about the meaning of the different parts of the ...
7
votes
1answer
945 views

Communication between parallel kernels

Greetings. This is my first post here, also, I am not a seasoned programmer, so any advice pertaining to coding that is not directly related to the problem (stated below) is welcome. I am having ...
7
votes
1answer
132 views

AbortKernels, CloseKernels may crash Mathematica

Let us start with a variant of an example in the documentation of AbortKernels. We launch four subkernels: LaunchKernels[4]; ...
7
votes
1answer
125 views

Association lookup in sub-kernel seems slow

While developing a parallel version of some code, I noticed that looking up an item in an association seemed much slower than in the serial version of the code. To show the effect, I created the ...
7
votes
1answer
3k views

Causes “libGL error: failed to load driver: swrast” an Huge Overhead in Parallel under Version 10.3?

Under Linux (SUSE Linux Enterprise 11) for Mathematica Version 10.2/10.3 I observe the following error in parallel ...
7
votes
1answer
260 views

Garbage collection for memoized functions on subkernels

I have a top-level function which operates on some data: findBestIntegers[data_]:=ParallelMap[optimize,data] which makes parallelized calls to an optimization ...
7
votes
1answer
920 views

Export graphics in parallel

I run a heavy simulation, using NDSolve and the method of lines. This means that the result of NDSolve is a list of, say, 400-...
7
votes
0answers
68 views

What's with the weird HoldRest Attribute of ParallelMap?

Bug introduced in 10.0 or earlier and persisting through 11.1 I have noticed some odd behavior of ParallelMap: When the list, that is mapped over, is not inserted ...
7
votes
0answers
147 views

ParallelSubmit executes only on one kernel

I'm trying to use Parallesubmit to run some calculations in parallel, but it looks like all the calculations are evaluated at one kernel. Consider this example: <...
7
votes
0answers
189 views

Bug: Calling `SetSharedVariable` while kernels are running hangs them up/crashes them

Bug introduced in 9.0 or earlier and persisting through 11.0.1 or later Start a fresh kernel Quit, and maybe launch ...
7
votes
0answers
502 views

How to force the compilation language to be C++ (not C) in CreateExecutable or CreateLibrary

I'm trying to speed up a section of a Mathematica 9.0.1 notebook by performing some calculations in C++ with the Cilk Plus and Threading Building Blocks tools available for the Intel C++ 14.0 compiler ...
6
votes
2answers
532 views

ParallelMap and Sow/Reap - not behaving as expected? [duplicate]

Is ParallelMap and Parallelize@Map expected to work with Sow and Reap construct. This is a rather brief toy code to find all Primes just to force the use of Sow/Reap inside Map ...
6
votes
1answer
964 views

Which is the correct way to parallelize this code?

I am reading this blog on how to parallelize Sow and Reap, but it uses SetSharedFunction: <...
6
votes
2answers
2k views

Limit the number of processors used by ParallelTable?

By default, ParallelTable will use all the processors available in a PC. Is there a way to set a limit to the number of processors used by ...
6
votes
2answers
82 views

Choose the number of kernels used by ParallelTable

By default, on my system, ParallelTable uses 4 kernels. Is it possible to change the number of kernels used, for example using only 3 instead of 4?
6
votes
2answers
678 views

Why doesn't ParallelTable work on this very simple example?

For some reason, I'd like to use ParallelTable with a variable number of iterators. Table[a[1], {a[1], 0, 10}] works fine: ...
6
votes
1answer
173 views

Speeding up tensor contractions and multiplication

Consider a tensor $T\in\mathbb{R}^{N\times N\times N\times M}$ and two vectors $x,y\in\mathbb{R}^N$. I want to compute the $N\times M$ vector defined by $X_{ij}=\operatorname{tr}(x^\top T_{:,:,i,j}y)=\...
6
votes
2answers
255 views

Contexts and parallelization

This question is related to my previous one here. I opened a new question because I think that the root cause is different though. BTW I use MMA 9 on a mac OS X 10.11 (El Capitan). I put here a ...
6
votes
1answer
599 views

Why does compiling a function with ConstantArray give an error when used in parallel?

Here is a sample compiled function: ...
6
votes
2answers
109 views

Operators without built-in meaning are incompatible with parallel evaluation

Mathematica has a useful set of Operators Without Built-In Meanings. For example: CenterDot, CircleDot, ...
6
votes
2answers
161 views

Paralleizing the Plot function internally

I have a function of several parameters, funct(a,b,c,d,f,...). Mathematica deals with this function fine but it takes a minute or so to make a data point. I want to plot graphs of funct using code ...
6
votes
1answer
541 views

Definitions are not distributed to parallel kernels

Bug introduced in 10.0 and fixed in 10.0.2. I have a small package with utilities, which looks like that: ...
6
votes
2answers
247 views

Parallelizing or optimizing a script for calculating the size of all pairwise intersections between collections of sets

I need to speed up or parallelize an operation that looks essentially like this: ...
6
votes
1answer
999 views

Export to file from ParallelDo loop

I currently have a Mathematica code similar to: ...
6
votes
1answer
204 views

Are more cores at lower GHz always faster for parallel processing?

Web searches have not yielded a definitive answer to this question: I am doing Monte Carlo simulations in Mathematica using ParallelTable, etc. to speed up the computation. I have an Enterprise ...
6
votes
2answers
173 views

Average length (in words) of paragraphs in document

I try to calculate the average length (in words) of paragraphs in a document. The data look like: ...
6
votes
1answer
152 views

How can multiple kernels update a shared Association object?

In the examples below, the variable status is an Association object that is supposed to be shared by three concurrent kernels. ...
6
votes
1answer
661 views

Cell evaluation and parallel kernels

Is it possible to simply force Mathematica to evaluate one cell with let's say kernel A and another cell with kernel B etc. so that they can be evaluated in parallel? There is a similar answer here ...
6
votes
2answers
5k views

Why can't I define a commutator operator in this way?

I am trying to define some operators I use frequently. For example, I defined a KroneckerProduct operator as $\otimes $ as follows: ...
6
votes
1answer
134 views

Is it safe to use older version subkernels with a newer version main kernel?

At the moment we only have access to version 8 of the Lightweight Grid (i.e. version 8 of the Mathematica kernel). Is it safe to run version 8 subkernels together with a version 9 main kernel? It ...
6
votes
1answer
82 views

Parallel Computation with the possibility of calculation failure

I would like to use Mathematica to speed-up a parallel calculation. I envisage each sub-process producing a list of 4 million machine reals. My problem is that sometimes the sub-process (based ...

1 2
3
4 5
15