Hot answers tagged

5

This is an extended comment. This behaviour is new in 10.4. I can reproduce it with 10.4.1 on OS X, but not with 10.3.1. This may be related: DistributeDefinitions and synchronization in Mathematica 10 We can try to analyse what happens like this: z := (Print[$KernelID]; 1); SetSharedVariable[z]; ParallelEvaluate[z] ...


5

You don't have to write all your code within ParallelSubmit. You can wrap your code in Module or Block and assign it to a variable using SetDelayed (:=) so it won't be evaluated immediately. Here is a toy example: eval1 := PrimeQ[528973465287364528736543] eval2 := Module[{}, Pause[2]; 3] evaluators = ParallelSubmit[{eval1, eval2}] You then run the ...


4

Your cube file had a very large grid ( 117*117*130 = 1779570), and 2 million points is just far too many for testing a function. So I created cube files for the electron density and electrostatic potential for the molecule furan, using a much sparser grid (around 8000 grid points instead). Here they are: Density cube file Potential cube file Now that ...


3

Thanks to Wolfram Technical Support, I am now able to answer my own question and explain the results I showed in the Edit. My question was: what exactly has changed in DistributeDefinitions? The answer is simple: nothing. What I observed is due to a undocumented change in ParallelEvaluate. Since version 10.4, it has an option DistributedContexts with ...


3

OP wrote: I want to be able to simply call Needs["Test`"] and have functions such as Test`f available for use inside ParallelTable without any further calling of $DistributedContexts or DistributeDefinitions We had a similar problem designing mathStatica functions to operate in a parallel environment. There can be varying degrees of complexity. For ...


2

The output variable lives on the main kernel. This variable is special, it represents an open file. It cannot be used on the parallel kernels if the file was opened on the main kernel. Is it still possible to write to the same file in parallel from multiple different kernels? Yes, but to do it robustly you must use an advanced parallel programming ...


1

To make my comment more concrete (for a four-processor machine), {ParallelEvaluate[f[largelist[[1 ;; 20]]], 1], ParallelEvaluate[f[largelist[[21 ;; 40]]], 2], ParallelEvaluate[f[largelist[[41 ;; 60]]], 3], ParallelEvaluate[f[largelist[[61 ;; 80]]], 4]} Total[%] (* {{20, 210}, {20, 610}, {20, 1010}, {20, 1410}} {80, 3240} *)



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