Questions on parallel computing in Mathematica.

learn more… | top users | synonyms

42
votes
4answers
2k views

Speeding up this fractal-generating code

I used the code below (which is a sample from this gist containing more similar code) in my answer to my own question about Mandelbrot-like sets for functions other than the simple quadratic on ...
31
votes
1answer
898 views

Transferring a large amount of data in parallel calculations

This question is inspired by one of @whuber's answers Consider the following code: ...
29
votes
3answers
2k views

Are built-in Mathematica functions already parallelized?

I've been noticing something strange since updating to Mathematica 8, and that is that occaisionally I'll see that the MathKernel is using up to 800% CPU in my Activity Monitor on OS X (I have 8 ...
27
votes
4answers
2k views

Is it possible to speed up ContourPlot on multi-core machines?

It is not very difficult to face a function for which ContourPlot works too slow. And it seems natural that this function can be parallelized well. Anyway, naive ...
25
votes
1answer
530 views

Is it safe to launch/close kernels in the middle of a parallel calculation?

It appears that it is possible to launch additional kernels (or close existing ones) during a parallel calculation. The newly launched kernels will be utilized for the rest of the calculation. ...
20
votes
1answer
594 views

Mma 10: Half the parallel power (Macs)?

Here is a comparison of the parallel kernels launched under Mathematica under v9 and v10, on the same identical current 2014 R2-D2 Mac Pro ... [ Update: Valerio has commented that the same issue ...
19
votes
3answers
1k views

Does parallel programming use up large quantities of memory in Mathematica?

When I start Mathematica with a fresh kernel and load a program I am developing to analyze biology data, the amount of used system memory is 1.9 GB (free memory is 14.5 GB). These memory values are ...
19
votes
1answer
2k views

Why won't Parallelize speed up my code?

What reasons are there that can cause parallelized Mathematica code not to run with full performance?
18
votes
4answers
879 views

How to collect result continuously (interruptible calculation) when running parallel calculations?

This is the most common pattern to compute a table of results: Table[function[p], {p, parameters}] (regardless of how it's implemented, it could be a ...
18
votes
2answers
478 views

Parallelize evaluation of function with memoization

I have a complicated function that I need multiple times, so I want to memoize it and have the first evaluation done in parallel. Unlike in my example below it's not a continuous function, so ...
17
votes
3answers
1k views

Monitor doesn't work with ParallelTable

I can't monitor ParallelTable: Monitor[ParallelTable[Pause[3]; i, {i, 1, 10}], i] just displays i until it is finished. Do ...
15
votes
2answers
1k views

Parallelization problem in LinearSolve and Minimize

My CPU has got 8 cores (it is Intel Core i7-2600 3.40 GHz). When I try to solve a linear matrix equation using LinearSolve for large matrices, Mathematica just uses 4 cores to solve the problem (CPU ...
14
votes
4answers
391 views

How can we implement “Sleep Sort”?

Inspired by Implement Sleep Sort: Sleep Sort is an integer sorting algorithm I found on the Internet. It opens an output stream, and for each input numbers in parallel, delay for the number ...
14
votes
2answers
1k views

List of Parallelize[]-able functions

The question is clear and is inspired by this question and the first comment on this question. Although there are many tricks for parallelizing things that are not ...
14
votes
1answer
2k views

Parallelizing Numerical Integration in Mathematica

I have an ugly, six dimensional function that I need to integrate numerically. It works, but it currently take twelve hours to complete the calculation. Is there any good way to parallelize the ...
14
votes
1answer
517 views

Parallel compiled functions running on parallel sub-kernels

Question Why is it, that compiled, Listable, parallel functions which work perfectly fine on the main kernel, do not run in parallel on sub-kernels? Details ...
14
votes
1answer
308 views

Making Monte Carlo simulation with ParallelTable

I would like to to MonteCarlo simulations of various regressions - basically, doing OLS under various conditions to test approaches. On my macpro 2x 2.8 GHz quad core Xeon, 32 Gb RAM DDR2 @ 667 Mhz, ...
14
votes
1answer
295 views

How to constrain memory usage on HPC?

I found the performance of built-in function MemoryConstrained is very poor. It stops the evaluation after the memory limit has already been exceeded greatly than ...
14
votes
1answer
243 views

How to parallel the computation tasks according to machines instead of kernels

On a HPC, there are many computation nodes, each node corresponds to an independent machine. Every node has several cores, for example 8 per node. Mathematica can launch remote kernels on different ...
13
votes
6answers
810 views

Efficient conditional Mean[] on a large data set

Consider a list, AK6, that has 382 sublists of length varying from 2500 to 3000. Each "subsublist" is as such : ...
13
votes
2answers
784 views

Speeding up random walk for many particles

I am trying to speed up this code for many particles to take a random walk. I'm not sure why it is so slow for such a simple task. I got a few hints from colleagues to reduce the precision of the ...
12
votes
2answers
241 views

Tuning ParallelMap when IO and computationally bound

I'm currently doing work on processing a number of images taken frame-by-frame from a video. As a result, I have a directory of around 16K PNG images that at most ~300K. That said, I have a routine, ...
12
votes
2answers
409 views

Tell ParallelMap[] to use just specific kernels

Is there a way to tell ParallelMap to use just some specific kernels (as is possible for ParallelEvaluate)? Background: I have ...
12
votes
3answers
654 views

Mathematica Parellelization on HPC

I'm currently using Mathematica on a High Performance Cluster (HPC) which consists of many compute nodes each with around 16 cores. I currently run my Mathematica script on 20 of the nodes that ...
12
votes
2answers
279 views

Parallelization of distinct array write access from subkernels

I'm working on an implementation of a multivariate FFT, which is (or at least should be) highly parallelizable due to the row-column-algorithm. However, i can't figure out how to implement that. The ...
11
votes
3answers
301 views

Suspecting bug in Parallel Framework

I've reduced my actual problem to: ParallelEvaluate[ Module[{slot=1}, Slot[slot] ] ] gives error messages that I think shouldn't be there. It seems I can ...
11
votes
5answers
1k 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 ...
11
votes
2answers
283 views

Package found with `Needs`, but not with `ParallelNeeds`

I want to use a self-written package in a parallel computation. However while Needs["mypackage`"] works without problems, ...
11
votes
1answer
708 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., ...
10
votes
5answers
791 views

Connecting to and disconnecting from a continuously running kernel, on demand

I realized that there are lots of advantages to driving C/C++/FORTRAN code directly from Mathematica as LibraryLink functions (instead of running them from the command line or a shell script, as I ...
10
votes
1answer
400 views

Parallelization and Hadoop

The short question: Has anyone used Mathematica in conjunction with Hadoop and does Mathematica's built in parallelization play well with Hadoop? The long version: So I have a Mathematica program ...
10
votes
2answers
1k 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
1answer
626 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 ...
10
votes
1answer
633 views

Is there a simple example using OpenCLLink that shows performance advantages?

OpenCLLink allows Mathematica to use the OpenCL parallel computing language. I have done some tests on simple examples, but so far, the CPU regularly outperforms ...
10
votes
1answer
444 views

How to run an external program in parallel with a Mathematica package?

Under Mathematica 8 (Linux x84_64) I was able to run an external program in parallel from a Mathematica package. However this procedure breaks down under Mathematica 9. Within my Mathematica package ...
9
votes
3answers
321 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 ...
9
votes
2answers
284 views

Why is ParallelMap way slower than Map

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

ParallelEvaluate for function minimization

Is there a parallelized version of a minimization routine available in Mathematica? The objective function is non-linear and the gradients have to be numerically computed. Every function evaluation ...
9
votes
1answer
162 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 ...
9
votes
1answer
271 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: ...
9
votes
1answer
1k 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 ...
8
votes
2answers
961 views

ParallelTable and Table do not give same result

I have a question regarding the use of Parallelize. In the help one can read that “Parallelize[Table[expr,iter, …]] (which is ...
8
votes
2answers
217 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
122 views

Experimental`NumericalFunction in NMinimize solution

I try to make a number of optimizations using this code: ...
7
votes
1answer
222 views

How to make this code threadsafe?

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

Writing data to a common file during parallel processing

I am executing a loop, and in each loop I have to store a parameter in a file. It is like ...
7
votes
3answers
360 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}, ...
7
votes
1answer
212 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 ...
7
votes
1answer
274 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
1answer
221 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?