Message Boards Message Boards

0
|
2959 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

ParallelDo works in Mathematica 12 but not in 10?

Posted 5 years ago

Hey you all, I have the following problem. I am using a MonteCarlo approach to model stuff in a simulation. Since the different monte carlo runs are independent, I use a parallel approach (for the first time). Here's a sketch of my notebook

runs=1000
f[x_]:=(Module[{...},
results = ConstantArray[0, runs];
SetSharedVariable[results];
ParallelDo[
...;
results[[ll]] = tt - 1,
  {ll, 1, runs, 1}
  ];
];
Return[results]
)

So, this code runs fine with my Notebook and Mathematica 12. It does not on our Cluster with Mathematica 10. The list results is afterwards empty except ALWAYS the second entry, no matter how many runs I do. If I replace it by Do, everything is fine I assume some variables being defined destroy it, however. First time "parallel coding", I am happy about every tip

Attachments:
POSTED BY: Michael Fischer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract