# Parallelization and assumptions

I'm having a simple problem. Here is the code

Table[Simplify[DifficultFunction[i],assumptions], {i,DifficultSet[1, 2]}]


the correct and simplified answer is

while if I try to parallelize:

Table[Simplify[DifficultFunction[i],assumptions], {i,DifficultSet[1, 2]}]//Parallelize


what I get is

which is still correct but not simplified. I used $Assumptions, but even if i put them as the se second argument of Simplify nothing happen. In my case it would be crucial to let different kernel simplify different expressions since in some cases this is the operation that requires a lot of time. How can I do? # EDIT The strange point is that if I use IntermediateResult= Table[DifficultFunction[i], {i,DifficultSet[1, 2]}]  and then ParallelTable[Simplify[i,assumptions],{i,IntermediateResult}]  it works. How is this possible? • A concrete example would make this problem much easier to work with. Dec 19, 2016 at 16:34 • It's hard to make concrete examples: my file contains very complicated functions, and if I try to do a MWE it boils down to a triviality. However the edit I did should be independent on what are the definitions of my functions. – MaPo Dec 19, 2016 at 17:17 • I understand that creating a minimum working example can be difficult. Nevertheless I think it will be hard to answer your question without one unless someone has already experienced and analyzed this problem. I hope for you that is the case. Dec 19, 2016 at 17:19 ## 1 Answer There can be several causes. $Assumptions is not active on parallel kernels unless you explicitly set it:

ParallelEvaluate[$Assumptions = ...]  You should explicitly use DistributeDefinitions on any defined symbols that appear in the expression that you assign to $Assumptions. ParallelEvaluate does not auto-distribute before version 10.4 (like most other parallel functions do).

Also keep in mind that the result from Simplify (and many other symbolic functions) may depends on what was previously evaluated. Simplify uses a time limit for trying certain transformations. Whether it reaches that limit depends on the speed of your computer as well as what symbolic results were cached previously. The cache state is not shared between parallel kernels.

• Thanks for the reply. I had the suspect that assumptions could not be shered among kernels, so I manully put assumptions in the second argument of Simplify. What astonishes me is what I write afer the EDIT. It seems that if I insert an intermediate step, it works perfectly but this doesn't make any sense. Does it? P.S. My version is 11.0 so I shouldn't have the other issue you mensioned
– MaPo
Dec 19, 2016 at 17:27
• @MaPo As Mr Wizard said, without an MWE it's hard to say much ... Dec 19, 2016 at 17:29