# Tag Info

## Hot answers tagged parallel

21

I've always wondered about the scalability of MathLink (now officially "Wolfram Symbolic Transfer Protocol"). This is the protocol used by Mathematica to communicate between the front end and the kernel, and the basis of the Parallel` package. It has quite low bandwidth and high latency relative to, for example, MPI libraries. I also wonder how many MathLink ...

14

I am sure you can easily install also Linux on it and then you could contact Vladyslav Shtabovenko, the current maintainer of FeynCalc (https://github.com/vsht) and ask him about hard problems in High Energy Physics he would like to benchmark on such a King-Kong machine. Either him or somebody else could also provide you with more complicated examples of ...

11

I would choose a problem that exploits the unique power of Mathematica, in particular the natural functions involving graph theory, symbolic math, graphics, and the high compute power you have available. So I would choose some image recognition and clustering problem such as: Take some large number of images ($\sim\!\!10^8$) and perform deep learning on ...

9

4 TB memory? N-body of course; dir = 2; T = 10; k = 1; l = 10; n = l^3; v = 6; q[i_] := (-1)^i m[i_] := RandomReal[5] Rem[o_] := l (o - IntegerPart[o]) eqns = Table[ {D[Subscript[r, i][t], {t, 2}] m[i] == Sum[ Normalize[Subscript[r, i][t] - Subscript[r, j][t]] k q[ i] q[j]/(Subscript[r, i][t] - Subscript[r, ...

6

This is what I'd do: You say most of the pixels are dark, and thus uninteresting, but some of them are bright. So I'd start by summing all images up to find the "bad" pixels: files = FileNames[ "*.png"]; totalBrightness = 0.0; Monitor[Do[ totalBrightness = ImageData[Import[f]] + totalBrightness, {f, files}], f]; meanBrightness = ...

5

First off, the 6300 series has various models with 4, 8, 12, or 16 "cores". You should provide the full model number (in which the "00" in "6300" is filled in with other digits). Second, there is the issue of how you count "cores". Intel processors have physical cores and logical cores, where there are twice as many of the latter as the former. The ...

4

Responding to the OP's comment, here is a way to monitor subkernel progress. (* Clear variables *) ToExpression["x" <> ToString[#], StandardForm, Clear] & /@ ParallelEvaluate[$KernelID, Kernels[]]; (* Monitor *) With[{varnames = "x" <> ToString[#] & /@ ParallelEvaluate[$KernelID, Kernels[]]}, With[{vars = ToExpression@varnames}, ...

4

To take advantage of that kind of memory, you really want to do some parallel processing. Mathematica's parallel processing focuses on data-parallelism, or more simply, embarrassingly parallel problems. So you might try out various Monte Carlo simulations. I don't recommend trying to reproduce full MPI functionality with LinkCreate et al. In the case ...

4

The more I've thought about this question, the more my answer (above) has changed. Now my answer is this: Assuming there is a high-bandwidth connection to the Wolfram server, choose a problem that relies on Mathematica's superior handling of curated data. Create an enormous problem that relies on curated financial data, geographic data, biological data, ...

4

Pieter, here is one suggestion: - try a FEM calculation on a huge and complicatd structure, eg. stress around clusters of cracks :)

4

This should do what you are asking about, ParallelEvaluate[x = 0; {$KernelID, With[{x = x}, Dynamic[x]]}] (*{{1,0},{2,0},{3,0},{4,0}}*) But it negates the point of having Dynamic since it won't update. Need to see the full code to see how you want to use it in the end. 4 What I am most interested in is described in Oleksandr's answer. Here's something else I would also try: There are several built-in functions that take advantage of parallelization without any special settings (and without using the Parallel tools framework). I would like to know how well these scale to a high number of cores. Examples: Matrix ... 4 The data FileNames["*.png"] (* {"image_01.png", "image_02.png", "image_03.png", \ "image_04.png", "image_05.png", "image_06.png", "image_07.png", \ "image_08.png", "image_09.png", "image_10.png"} *) All at once If there are no memory constraints, you can load all in a single array (read below for other cases). data = ImageData[Import[#], "Byte"] & ... 3 This happens because you never set a as a shared variable before using UnsetShared. That is, you were using UnsetShared in an incorrect manner. In short: make sure you never use UnsetShared on a symbol unless it was shared first! Mathematica in general is pretty forgiving (unlike languages like C) and won't make it possible to mess up its internal state ... 3 You have to set arr as a shared variable first, using SetSharedVariable, SetSharedVariable[arr]; arr = Array[0 &, 10]; ParallelTable[Set[arr[[i]], 1], {i, 1, 10}]; arr (* {1, 1, 1, 1, 1, 1, 1, 1, 1, 1} *) 3 Most of your time is spent in defining PolarCoords. Let's take a look at your code. It looks like you've tried to optimize it already. Let's try to simplify it first: PolarCoords = Map[Function[i, ToPolarCoordinates /@ newCoord[[i]] /. {x_, y_} /; y < 0 -> {x, y + 2 \[Pi]}], Range@Length@pts] Simpler: PolarCoords = ... 3 If you use float instead integer you can reduce the computing time. data = RandomInteger[{1, 400}, {5000, 2}]; c = 10.; r = 60.; pts = c + r {Cos[#], Sin[#]} & /@ Range[0., 2. π, 2. π/16.]; newCoord = Table[(# - pts[[i]]) & /@ data, {i, 1, Length@pts}]; PolarCoords = Table[ToPolarCoordinates[#] & /@ ... 2 Not a complete answer, but it may help to illustrate some of this behavior. If I run the simple example, Dynamic[Refresh[TableForm[{"ind2=", ind2, "j=", j}], UpdateInterval -> 1]] j = 0; num = 100; SetSharedVariable[j]; ParallelTable[ind2^2; Pause[2]; j++, {ind2, 1, num}] I find that Dynamic does not display ind2. It does, however, display j, which ... 2 I noticed this problem recently (Feb 2016) following an update to Raspian's Jessie on the Raspberry Pi. My solution is probably specific to the RPi, and I apologize in advance if I am considered to have hijacked your question. I noticed upon starting Mathematica that I would get a similar LibGL swrast driver error. Following the suggestions mentioned here ... 1 Here is the solution of Jason B. ParallelEvaluate[ Table[ {$KernelID, i}; x = i^2; Print["$KernelID = ",$KernelID, ", i = ", i ", x = \!$$\*SuperscriptBox[\(i$$, $$2$$]\) = ", x], {i, ($KernelID - 1) 250 + 1,$KernelID 250} ]; ]; Output is correct: (I only do not understand why for i=1 no output is shown?) ...

1

Confirmation rather than answer. I'm not sure the original example is entirely functional, at least it was not for me. Mine is... SetDirectory["F:\\Temp"]; (* Adjust to suit your environment *) hist = Histogram[RandomVariate[NormalDistribution[0, 1], 10000], ScalingFunctions -> "Log", ImageSize -> 600] Note log scale on y-axis in resulting ...

Only top voted, non community-wiki answers of a minimum length are eligible