Message Boards Message Boards

GROUPS:

Problems with WaitAll & ParallelSubmit

Posted 2 years ago
4484 Views
|
3 Replies
|
1 Total Likes
|

I am trying to do some Numerical Integration in parallel using ParallelSubmit and WaitAll. The code is this,

WaitAll[{
ParallelSubmit[NIntegrate[Integrand1Test[0.4,thA,phiA,0.5,thC,phiC,0,0,0] 
Sin[thA] Sin[thC],{phiC,0,2 \[Pi]},{phiA,0,2 \[Pi]},{thA,0,\[Pi]},{thC,0,\[Pi]}]],
ParallelSubmit[NIntegrate[Integrand2Test[.4,thA,phiA,.5,thC,phiC,0,0,0]
Sin[thA]Sin[thC],{phiC,0,2\[Pi]},{phiA,0,2\[Pi]},{thA,0,\[Pi]},{thC,0,\[Pi]}]],
ParallelSubmit[NIntegrate[Integrand3Test[.4,thA,phiA,.5,thC,phiC,0,0,0]
Sin[thA]Sin[thC],{phiC,0,2\[Pi]},{phiA,0,2\[Pi]},{thA,0,\[Pi]},{thC,0,\[Pi]}]],
ParallelSubmit[NIntegrate[(Integrand4Test[.4,thA,phiA,.5,thC,phiC,0,0,0]-Integrand5Test[.4,thA,phiA,.5,thC,phiC,0,0,0])
Sin[thA]Sin[thC],{phiC,0,2\[Pi]},{phiA,0,2\[Pi]},{thA,0,\[Pi]},{thC,0,\[Pi]}]],
ParallelSubmit[NIntegrate[Integrand6Test[.4,thA,phiA,.5,thC,phiC,0,0,0]
Sin[thA]Sin[thC],{phiC,0,2\[Pi]}, {phiA,0,2\[Pi]},{thA,0,\[Pi]},{thC,0,\[Pi]}]]}]//AbsoluteTiming

These integrations are independent of each other. The output is this: (besides some warnings from the numerical integration)

{288.921,{RefLink[ParallelSubmit,paclet:ref/ParallelSubmit][-0.00279665], 
RefLink[ParallelSubmit,paclet:ref/ParallelSubmit][0.342983],
RefLink[ParallelSubmit,paclet:ref/ParallelSubmit]-0.559774],
RefLink[ParallelSubmit,paclet:ref/ParallelSubmit][-0.0569992+0. I],
RefLink[ParallelSubmit,paclet:ref/ParallelSubmit][-0.0309274+0. I]}}

I don't know what does "RefLink[ParallelSubmit,paclet:ref/ParallelSubmit]" mean? The examples in mathematica documents and tutorials run OK without these messages. The numbers in the "[ ]" are the integration result.

The other problem is that I use top and htop (on linux) to look at the CPU usage, and see that only one CPU core is working 100%, the others are only less than %5. This means that it run only on one CPU core. There is also one similar problem I googled in here https://mathematica.stackexchange.com/questions/132366/parallelsubmit-executes-only-on-one-kernel .

The Parallelize command seems to do well. Is the ParallelSubmit & WaitAll combination buggy?

3 Replies

When you copy code from the documentation, it sometimes doesn't copy as plain text but copies as a hyperlink to the documentation. That is why you are seeing RefLink. At some point you copied the name of the function from the documentation center and didn't copy it as plaintext.

I would take the code and trying copying it all by right clicking and selecting "Copy as > PlainText"

Thanks, this solved the problem. The calculation also runs on different cores now.

Sorry, I didn't learn how to post codes. But when I edit the post again, there is no such code formatting button on top of the frame. I just learned from the forum help, and put something like "< pre>< code>", "</ code></ pre>" around the code.

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