2
$\begingroup$

I need an example of a not-too-complicated yet intensive parallel computation in Mathematica. The result of the computation should be known before hand.

I need this to test the capabilities of a cluster. Where can I find examples of intensive parallel computation with known results?

Ideally, the intensiveness of the computation should be modifiable, so that I can run fast examples and long examples.

Downvoters alert: I'm not sure if this is on-topic here. If I see a few comments by different people saying that it isn't, I'll delete it. But please, my fragile reputation would appreciate it if you don't massively downvote this question.

Additional info: The cluster is a single system image cluster with on the order of tens of processors (say 20). By intensive computation I mean something that uses about 30GB's of RAM, and lasts about 1 day of computation. To test hard-drive capabitilities, the test should also I/O with some data of perhaps a couple of GB's that's stored on the drive. That test would satisfy me. It is important that the results be verifiable for correctness, perhaps by knowing the right answer before-hand for comparison.

$\endgroup$
  • $\begingroup$ Not sure if this is what you're looking for, but Eigensystem automatically parallelizes across multiple cores, so something like Eigensystem[RandomReal[{0, 1}, {3000, 3000}]] is a pretty easy-to-test parallel operation. $\endgroup$ – DumpsterDoofus Jan 13 '15 at 19:23
  • $\begingroup$ @DumpsterDoofus The downside with that example is that you don't know the results before hand. $\endgroup$ – becko Jan 13 '15 at 20:25
  • $\begingroup$ Well, you could also do A = RandomReal[{0, 1}, {3000, 3000}]; Eigensystem[A], and store A and the results of Eigensystem[A] for use in all later tests, that way the results will be known beforehand. $\endgroup$ – DumpsterDoofus Jan 13 '15 at 20:53
  • $\begingroup$ So, you want something that runs in the parallel computing toolkit? Or you have a single system image cluster? How big is your cluster? Tens of processors, or tens of thousands? Also, what do you mean by "intensive"? Arithmetically intensive? Demanding of memory capacity? Memory bandwidth? Something else? Do you want to stress the filesystem and the interconnect? $\endgroup$ – Oleksandr R. Jan 14 '15 at 1:38
  • $\begingroup$ @OleksandrR. See edit. $\endgroup$ – becko Jan 14 '15 at 13:23
2
$\begingroup$

What about testing with good and (purposely) bad implementations of number theory functions? The bad implementation tests your cluster, the good gives you a fast, modifiable answer. For example, PowerMod is faster than Mod.

ParallelSum[Mod[3749111187234987^n, 743], {n, 1, 10000}]]

ParallelSum[PowerMod[3749111187234987, n, 743], {n, 1, 10000}]

but becomes too memory intensive as n increases. Perhaps the trailing zeros of n!

ParallelSum[Tr@Floor@NestWhileList[#/5&, #/5, #>1&]&[n], {n, 10^3, 10^7}]

ParallelSum[(n - Total[IntegerDigits[n, 5]])/4, {n, 10^3, 10^7}]

(The first method is not "bad", just slower).

Or counts of semi-primes?

ParallelSum[
    f=FactorInteger[n];
    Boole[Length[f] < 3 && Total[f[[All, 2]]] == 2],
    {n, 1, 10^6}]]

SemiPrimeCount[n_Integer] := 
    ParallelSum[PrimePi[n/Prime[k]]-k+1, {k, 1, PrimePi[Sqrt[n]]}]

SemiPrimeCount[10^6]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.