Message Boards Message Boards

ParallelSubmit taking forever to load graphics

Posted 10 years ago

Hello,

I've been working with parallelsubmit, and it seems like a nice feature, but I'm struggling with the fact its output takes forever. Using parallelsubmit makes a bunch of little squares to show the progress of what is running, which is nice and I want so I can periodically check the progress. The problem is (and I assume it is because they try to write the expression I'm trying to evaluate in 2 pt font even though the expression can't fit even on the full page) it takes about 6 seconds each process to generate the display. I can get around this by blocking output via ';', however like I said I would like to see the status as it runs.

The current expressions I'm using are:

pret00 = Table[T0[[int]]*LegendreP[0, Cos[x]]*Sin[x], {int, 1, 3^4}];
preintt00 = 
 Table[ParallelSubmit[{int, pret00}, 
   Integrate[pret00[[int]], {x, 0, Pi}]], {int, 1,2}]

Does anyone know how to adjust the output so I still have knowledge of the progress of the code, without it taking forever just to generate the graphics? I really can't believe Mathematica chose to construct things this way, it is so clearly inefficient.

edit: an example of the ugly elements of T0 is in a reply below...

POSTED BY: T C
4 Replies
Posted 10 years ago

Great, never occurred to me to do that. Thanks!

POSTED BY: T C

I managed to format the code.

It serves as a good example of something that should be in an attached notebook, so people looking for replies or making replies will not have to scroll and scroll. (I hope that did not sound harsh. Just a suggestion for next time.)

POSTED BY: Moderation Team
Posted 10 years ago
POSTED BY: T C

I don't believe your code is doing what you intended.

There is no definition of T0, so I made up one.

T0 = Table[x^int, {int, 1, 3^4}]
pret00 = Table[T0[[int]]*LegendreP[0, Cos[x]]*Sin[x], {int, 1, 3^4}]

Now to check and see if Integrate is doing something sensible:

Integrate[pret00[[1]], {x, 0, Pi}]

Yes, it is. So, something like this gives sensible results

ParallelTable[Integrate[pret00[[int]], {x, 0, Pi}], {int, 1, 12}]

or

ParallelTable[Integrate[pret00[[int]], {x, 0, Pi}], {int, 1, 3^4}]

which will produce fairly long output, but you can view it all if you wish.

However, I believe the Table that you have inside ParallelSubmit isn't doing what you expected because you are looking for the 0 index of a list, which will be "List".

ParallelTable[Integrate[pret00[[int]], {x, 0, Pi}], {int, 0, 1}]

A quick look at the ParallelSubmit documentation shows that the result of ParallelSubmit is a List of objects which are ready for computation on the kernels, but computation doesn't start until WaitAll or WaitNext is executed

POSTED BY: W. Craig Carter
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