Questions tagged [parallelization]

Questions on parallel computing in Mathematica.

Filter by
Sorted by
Tagged with
12
votes
3answers
5k views

Parallelization works, but does not use all CPU power

I've written code which involves Parallelize@Cases. When I evaluate, I find that all 16 cores are being used, but not fully; in other words all cores are active, but the total CPU usage is only 50%. ...
12
votes
5answers
3k views

What is the fastest way to extract a substring from a huge string?

I develop an algorithm to find the most common substrings of a given length n up to a certain distance l in front of a pattern p in a huge sequence S. E.g. I want to find the most common hexamers (...
12
votes
3answers
629 views

Why is this parallel evaluation with Dispatch[] so slow?

Can you efficiently parallelize this? The parallel versions are much slower than the sequential version, and I'm not sure why. Does SetSharedVariable allow ...
12
votes
1answer
811 views

How to force an evaluation to use only one core?

There are some evaluations which are automatically parallelized or multithread if there are cores available.( for example, Eigenvalues) But I don't want the ...
12
votes
2answers
234 views

Surprising interaction of DistributeDefinition and ParallelNeeds in 11.3

Bug introduced in 11.3.0 (CASE:4039452) I believe I am seeing a new sort of behavior around some parallel functionality in Mathematica 11.3, because code that used to function properly in earlier ...
12
votes
1answer
2k views

Nesting Parallel processes

I just attempted to run code that had nested ParallelMap[] functions. It generates the error message: ParallelMap::subpar: Parallel computations cannot be nested; proceeding with sequential ...
12
votes
1answer
879 views

Parallel optimization of Markov Chain Monte Carlo

I'm trying to reduce the computation time of a MCMC simulation. Essentially I have a set of particles performing a random walk in a periodic random potential. The particles are independent and every ...
12
votes
1answer
1k views

How to run mathlink external commands in parallel?

I have an external function called increment (for the sake of illustration) that I call from Mathematica using MathLink. I.e., ...
11
votes
2answers
542 views

ParallelMap vs Map performance comparsion

The ParallelMap claims doing map faster than the normal Map, and I checked the demo does as the document describing but, I try ...
11
votes
1answer
2k views

How to do computations simultaneously in multiple notebooks? [duplicate]

I have a Mathematica script which takes a few hours to run. I want to be able to open another notebook while it's running and do some other computations. I have enough many cores on my computer for ...
11
votes
2answers
1k views

Why is ParallelMap way slower than Map

I recently tried to use ParallelMap instead of Map and to my surprise encountered that ...
11
votes
1answer
273 views

Difficulty in parallelizing function using package (MCMC)

Difficulty in parallelizing Packages using DistributeDefinitions Context I am trying to parallelize some parameter estimation using MCMC. As a test run I expect ...
11
votes
1answer
357 views

Experimental`NumericalFunction in NMinimize solution

I try to make a number of optimizations using this code: ...
11
votes
1answer
2k views

Wolfram Light Weight Grid and parallel computing

I have attempted to set up and use the Wolfram Lightweight Grid Manager so I can do parallel computing from Mathematica using 2 remote processors on another machine on my local network. My ...
11
votes
1answer
283 views

Can Predict/Classify be parallelized?

Being able to parallelize Predict /Classify would be useful on multiple fronts: Performance/Scale Streaming Pedagogical ...
10
votes
2answers
304 views

Understanding Parallelize methods

In the documentation page for Parallelize, we find the methods that can be used. I do not quite understand the difference between Method->"CoarsestGrained" and <...
10
votes
3answers
2k views

Why is ParallelTable slower than Table?

Update Following a comment of Szabolcs have changed Timing to AbsoluteTiming. The results are virtually the same. Original post I have accidentally observed the following surprising result. So, why ...
10
votes
2answers
3k views

CUDA and GPU hardware and compatibility questions?

We have iMac desktops and have just begun to parallelize computations across them see: Wolfram Light Weight Grid and parallel computing. This still does not look like it will give us the performance ...
10
votes
2answers
481 views

ParallelTable behaves differently when it is run inside a package

I've been butting my head against some very weird behaviour by ParallelTable, and its interaction with packages, over the past few weeks, and making relatively ...
10
votes
1answer
108 views

Parallelize[MapIndexed[…,Association[…]]] returns broken result

Bug introduced in 10.0.2 or earlier and persisting through 12.0 Confirmed: CASE:4041910 Consider the following example: ...
10
votes
1answer
807 views

PrintTemporary in ParallelTable

I thought of a possible answer to Monitor doesn't work with ParallelTable but it doesn't work as I hoped it would. This accumulates print cells instead of deleting them as intended. Can it be ...
10
votes
1answer
123 views

How to ensure that a package is always loaded on startup, even in parallel kernels?

Is there a robust way to ensure that a package is always loaded on startup, even in parallel kernels? Parallel kernels do not read Kernel/init.m.
10
votes
1answer
336 views

How to monitor the communication between parallel kernels

Recently I increased the problem size in my code, and it scales up very badly using ParallelTable. With a lot of help from the this community, it seems that the ...
10
votes
1answer
389 views

Why I only get 2X speedup when parallelized with 16 kernels

I'm trying to parallelize a function by ParallelTable, and it seems the speedup is not very good. I have 16 parallel kernels on my computer node: ...
10
votes
1answer
793 views

Parallelization with two Processors: only half number of cores run

I have a code which works really good in a parallelized way (with ParallelTable). I have a machine with 1 processor, 4 physical/8 logical cores, there 100% of the ...
9
votes
3answers
2k views

Which processor and graphics card to use for my Mathematica license

Does my Mathematica license support processors with 8 cores? I have to choose between one of the following processors: Intel® Xeon® E5-1630 v4 Prozessor (4 cores, 3,7 GHz, 4,0 GHz Turbo) Intel® ...
9
votes
4answers
957 views

Efficient way to utilise Parallel features to make use of many cores

Let's say I have 100 cores/kernels as my disposal and want to compute a function of two variables f[x,y] over {x,1,10}, ...
9
votes
1answer
975 views

Reap, Sow with Parallelize: bad performance, why?

I have a question about the performance of Reap and Sow with Parallelize. I am aware of the following questions How to collect result continuously (interruptible calculation) when running parallel ...
9
votes
1answer
460 views

Is there a way to convert mathematica code to OpenMP or OpenACC?

I see that Mathematica has limited support for things like OpenCL and CUDA, but what about other standards like OpenMP or OpenACC?
9
votes
1answer
120 views

How to launch a separate Java VM on each sub-Kernel?

I have some code that process very large flat files in to separate HSQL(Standalone) databases using ParallelSubmit and JDBC for each file using the strategy in this post (19542). Lately I keep ...
9
votes
0answers
208 views

Smart use of ParallelMap over Plus [closed]

I'm looking for ways to speed up calculation of a integral with a many-terms integrant. The obvious way is to go in parallel. I was surprised, but for some tests integration by ...
8
votes
2answers
1k views

How many cores can I use with my license?

From what I have been told, Mathematica licenses come with a limited number of cores it can run on in parallel. I have 24 cores on my machine and when I do ...
8
votes
2answers
342 views

ParallelTable running on outermost index only

I need to run a simple ParallelTable: ...
8
votes
2answers
580 views

How to write a custom ParallelTable command that monitors progress automatically

I am using a lot of ParallelTable and want to avoid wrapping it in a Monitor call each time. Since each of the calls inside ParallelTable will already consume considerable time, I do not mind the ...
8
votes
2answers
2k views

Filling global arrays in parallel calculations

I want to parallelize heavy computations which has to be done many times, the result should be arrays of data. Each calculation does not depend on others (but uses the same variables though). The ...
8
votes
1answer
582 views

Run several input cells in parallel

I have a notebook with several input cells that produce data which is then plotted into separate graphs. Since I do not want to save the results, because it makes the file huge, I keep the ...
8
votes
2answers
497 views

Use of Cellular Automaton or Discrete Convolution to calculate Potts Energy of a 2D Matrix

In a project of Monte Carlo Modelling of Grain Growth (Link) one of the most costly subroutines is the calculation of the Potts-Energy of an Monte Carlo Grid cell by comparing the center cell value ...
8
votes
1answer
638 views

Optimizing Monte Carlo simulation of a Pred-Prey model

My assignment and code As part of an assignment for one of my classes, I'm trying to run a "massive" Monte Carlo simulation in Parallel on the follow model: ...
8
votes
1answer
130 views

How to Parallelize a simple MapAt?

I have a simple map I would like to parallelize (4x speedup for my 4 cores): ...
8
votes
1answer
1k views

Is there a method to send different Cell evaluation to different core?

I am running Mathematica on a computer with multi CPU and every CPU has multicore. I am wondering if there exist a method to send different cell evaluation to different core? So if I already have a ...
8
votes
2answers
354 views

Distribute and analyze large datasets

I need to analyze very large datasets, and they obviously don't fit in a computer memory. I need to produce some statistics on these datasets, and this brings me here: How can I make some statistical ...
8
votes
1answer
184 views

Setting up tunnel to access compute nodes behind private LAN via front-end

Context I find the front end on macos way more convenient and I would like to keep my notebooks on my macbook. On the other hand, I have access faster multi-core linux machines behind a LAN. Hence I ...
8
votes
1answer
303 views

Export bug in combination with ParallelTable?

I am programming with Mathematica 10.3.1.0 on Windows 10 Professional 64 Bit and have an i7-4940-MX 3,1 GHz processor (4 cores). When I use in the example code below ...
8
votes
1answer
561 views

Launching remote slave kernels on HPC causes slow down

I had a post earlier regarding how I can run Mathematica at a HPC cluster (running PBSpro) by having a single MathKernel launch ...
8
votes
1answer
309 views

how can I avoid CPU waste (by master kernel) using WaitNext?

I'm using WaitNext in Mathematica for parallel processing on Mac OS X. I have 4 processors on my MacBook and LaunchKernels[] ...
8
votes
0answers
1k views

ParallelTable kernels die - maybe Mathlink timeout?

I am new to parallel computing in Mathematica. I am using LaunchKernels[16] ParallelTable[] to parallelize calculations. The ParallelTable consists of approx ...
7
votes
1answer
2k views

Suppress warnings in ParallelTable

I'm using ParallelTable to evaluate a function that involves NIntegrate. There are a lot of ...
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
1answer
307 views

How to make this code threadsafe?

I have the following code, schematically: ...
7
votes
2answers
471 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 ...