Parallel Computing Problem Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?ParallelTable and DistributeDefinitionsParallel computing NInverseFourierTransFormHow can I prevent these warnings while using ParallelTableParallelTable slowdown for a task involving ComponentMeasurementsAdd Results of ParallelMap in ParallelParallelTable local variables don't update precisionParalell computing - divisors of large numbersCreating a version of ParallelTable that parallelizes over all levelsRemote parallel processingParallel computing issues when running a ModuleParallelTable fails to finish evaluating after completing computation
Triggering an ultrasonic sensor
How do I find out the mythology and history of my Fortress?
Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode
Why are vacuum tubes still used in amateur radios?
Crossing US/Canada Border for less than 24 hours
Find 108 by using 3,4,6
What is the meaning of 'breadth' in breadth first search?
How does light 'choose' between wave and particle behaviour?
Belief In God or Knowledge Of God. Which is better?
What is the difference between globalisation and imperialism?
What is "gratricide"?
Would it be easier to apply for a UK visa if there is a host family to sponsor for you in going there?
What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?
When a candle burns, why does the top of wick glow if bottom of flame is hottest?
Using audio cues to encourage good posture
Why wasn't DOSKEY integrated with COMMAND.COM?
Why is it faster to reheat something than it is to cook it?
Time to Settle Down!
Take 2! Is this homebrew Lady of Pain warlock patron balanced?
How fail-safe is nr as stop bytes?
Did Deadpool rescue all of the X-Force?
Do I really need to have a message in a novel to appeal to readers?
Did any compiler fully use 80-bit floating point?
AppleTVs create a chatty alternate WiFi network
Parallel Computing Problem
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?ParallelTable and DistributeDefinitionsParallel computing NInverseFourierTransFormHow can I prevent these warnings while using ParallelTableParallelTable slowdown for a task involving ComponentMeasurementsAdd Results of ParallelMap in ParallelParallelTable local variables don't update precisionParalell computing - divisors of large numbersCreating a version of ParallelTable that parallelizes over all levelsRemote parallel processingParallel computing issues when running a ModuleParallelTable fails to finish evaluating after completing computation
$begingroup$
The program runs out quickly(30 seconds) if I don't do parallel.But when I replace Table with ParallelTable,the Program will keep running,no output results.
My code
https://privatebin.net/?d1b1eeff435720eb#XWLsW2gY2EfTFnX+eQCXtCVBPN4budq3wQtVWaNwI4g=
parallelization
$endgroup$
add a comment |
$begingroup$
The program runs out quickly(30 seconds) if I don't do parallel.But when I replace Table with ParallelTable,the Program will keep running,no output results.
My code
https://privatebin.net/?d1b1eeff435720eb#XWLsW2gY2EfTFnX+eQCXtCVBPN4budq3wQtVWaNwI4g=
parallelization
$endgroup$
add a comment |
$begingroup$
The program runs out quickly(30 seconds) if I don't do parallel.But when I replace Table with ParallelTable,the Program will keep running,no output results.
My code
https://privatebin.net/?d1b1eeff435720eb#XWLsW2gY2EfTFnX+eQCXtCVBPN4budq3wQtVWaNwI4g=
parallelization
$endgroup$
The program runs out quickly(30 seconds) if I don't do parallel.But when I replace Table with ParallelTable,the Program will keep running,no output results.
My code
https://privatebin.net/?d1b1eeff435720eb#XWLsW2gY2EfTFnX+eQCXtCVBPN4budq3wQtVWaNwI4g=
parallelization
parallelization
asked 6 hours ago
guangyaguangya
142
142
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Replace your t'
with anything legal, e.g. tp
will solve the problem. Assigning t'
is actually doing Derivative[1][t]=1
, which is not advisable.
The reason of this strange behavior is that SubValues
of derivative is not automatically distributed to kernels. Therefore you get 1'==0.6
for the main kernel, and 1'==0&
for the sub kernels, and the value of this constant becomes a function which fails the later calculation.
After making such replacement, and deleting the duplicated ParallelTable
in your F
definition, you can get the expected result:
ParallelTable[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
4.8858, Null
Table[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
8.10208, Null
$endgroup$
add a comment |
$begingroup$
Two things will provide for immense speed-up with parallel functions like ParallelTable:
Launch your kernels ahead of the initial parallel call with:
LaunchKernels["Number of Kernels, max available if left blank"]
Ensure each kernel has prior knowledge of the functions with:
DistributeDefinitions["context`"]
You should also see some increase in speed, due to a decrease in CPU need, if you were to provide assumptions for all of your defined variable functions. What I mean by this is something like:
f[x_?NumericQ,n_?IntegerQ]
Wherein x is always a numerical input and n is an integer.
I hope this helps you understand how to run parallel code better, it's a constant learning process, as we will continue to make more and more efficient ways that leave the previous best methods in the dust, and we will have to keep up :D
So, after discussing with @happy fish, I was able to test the code, and got this output, after replacing the second ParallelTable with Table:
-0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029
There is something amiss with this, and I apologize that I cannot immediately parse what the issue is. I will take some time to check later and see if I can provide additional input, after satisfying my own duties prior ;) As for the rest:
The issue with using two ParallelTable calls is why you would not receive output for your addition of Parallel to the second Table, again, barring my lack of understanding. Additionally, you would assuredly benefit from a functional method of implementing this code. There are numerous inline reassignments which can likely be shortened, and I anticipate that is another issue imparting itself upon your long-running/non-functional parallel implementation.
$endgroup$
2
$begingroup$
Thanks for your answer, but I don't think it addresses the problem OP encountered.LaunchKernels
andDistributeDefinitions
are done automatically, there is no need of explicitly writing down. There won't be an "immense speed-up with parallel functions" in either case. Testing the parameter can avoid unnecessary symbolic computations, but won't help here since everything is numerical.
$endgroup$
– happy fish
4 hours ago
$begingroup$
@happyfish I'm not sure that is entirely accurate, unfortunately. Though it would be nice! My understanding is as follows: When you perform the first call on a parallel function, you will spend more time than subsequent calls, this being due to the need to launch all kernels. Additionally there is some time taken to distribute definitions, if this is indeed done automatically. I am curious if there is a part of the documentation you can point to for this? I am unable to have ParallelTable actually use all kernels unless you have done as I stated, otherwise they take about a second longer.
$endgroup$
– CA Trevillian
4 hours ago
$begingroup$
@happyfish my comment stems from my having had an order of magnitude speed-up earlier today, by distributing definitions of my self-packaged function and launching the kernels ahead of their parallel execution. It seems, though, this may be another time when "vectorized"(I still struggle to confidently state/grasp this concept/method) functions would be helpful if implemented? Your expertise puts mine at a junior, however, so I will look to your continued interpretation of this problem solution.
$endgroup$
– CA Trevillian
3 hours ago
1
$begingroup$
I agree with your general ideas on parallel evaluations. I am just saying that these theories don't localize for this particular problem. If you experiment on the problem you will find immediately that the bottleneck is not on where you focus: it's just distributing 10 difficult tasks to 6(by default) kernels, the overhead of subsequent calls and copying definitions is negligible. For the automatically distribute definition part, please refer to the first example in Options->DistributedContexts and mathematica.stackexchange.com/questions/39178/…
$endgroup$
– happy fish
3 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f195571%2fparallel-computing-problem%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Replace your t'
with anything legal, e.g. tp
will solve the problem. Assigning t'
is actually doing Derivative[1][t]=1
, which is not advisable.
The reason of this strange behavior is that SubValues
of derivative is not automatically distributed to kernels. Therefore you get 1'==0.6
for the main kernel, and 1'==0&
for the sub kernels, and the value of this constant becomes a function which fails the later calculation.
After making such replacement, and deleting the duplicated ParallelTable
in your F
definition, you can get the expected result:
ParallelTable[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
4.8858, Null
Table[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
8.10208, Null
$endgroup$
add a comment |
$begingroup$
Replace your t'
with anything legal, e.g. tp
will solve the problem. Assigning t'
is actually doing Derivative[1][t]=1
, which is not advisable.
The reason of this strange behavior is that SubValues
of derivative is not automatically distributed to kernels. Therefore you get 1'==0.6
for the main kernel, and 1'==0&
for the sub kernels, and the value of this constant becomes a function which fails the later calculation.
After making such replacement, and deleting the duplicated ParallelTable
in your F
definition, you can get the expected result:
ParallelTable[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
4.8858, Null
Table[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
8.10208, Null
$endgroup$
add a comment |
$begingroup$
Replace your t'
with anything legal, e.g. tp
will solve the problem. Assigning t'
is actually doing Derivative[1][t]=1
, which is not advisable.
The reason of this strange behavior is that SubValues
of derivative is not automatically distributed to kernels. Therefore you get 1'==0.6
for the main kernel, and 1'==0&
for the sub kernels, and the value of this constant becomes a function which fails the later calculation.
After making such replacement, and deleting the duplicated ParallelTable
in your F
definition, you can get the expected result:
ParallelTable[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
4.8858, Null
Table[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
8.10208, Null
$endgroup$
Replace your t'
with anything legal, e.g. tp
will solve the problem. Assigning t'
is actually doing Derivative[1][t]=1
, which is not advisable.
The reason of this strange behavior is that SubValues
of derivative is not automatically distributed to kernels. Therefore you get 1'==0.6
for the main kernel, and 1'==0&
for the sub kernels, and the value of this constant becomes a function which fails the later calculation.
After making such replacement, and deleting the duplicated ParallelTable
in your F
definition, you can get the expected result:
ParallelTable[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
4.8858, Null
Table[F[0, 0, k], k, 1, 10]; // AbsoluteTiming
8.10208, Null
edited 1 hour ago
answered 1 hour ago
happy fishhappy fish
5,57121546
5,57121546
add a comment |
add a comment |
$begingroup$
Two things will provide for immense speed-up with parallel functions like ParallelTable:
Launch your kernels ahead of the initial parallel call with:
LaunchKernels["Number of Kernels, max available if left blank"]
Ensure each kernel has prior knowledge of the functions with:
DistributeDefinitions["context`"]
You should also see some increase in speed, due to a decrease in CPU need, if you were to provide assumptions for all of your defined variable functions. What I mean by this is something like:
f[x_?NumericQ,n_?IntegerQ]
Wherein x is always a numerical input and n is an integer.
I hope this helps you understand how to run parallel code better, it's a constant learning process, as we will continue to make more and more efficient ways that leave the previous best methods in the dust, and we will have to keep up :D
So, after discussing with @happy fish, I was able to test the code, and got this output, after replacing the second ParallelTable with Table:
-0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029
There is something amiss with this, and I apologize that I cannot immediately parse what the issue is. I will take some time to check later and see if I can provide additional input, after satisfying my own duties prior ;) As for the rest:
The issue with using two ParallelTable calls is why you would not receive output for your addition of Parallel to the second Table, again, barring my lack of understanding. Additionally, you would assuredly benefit from a functional method of implementing this code. There are numerous inline reassignments which can likely be shortened, and I anticipate that is another issue imparting itself upon your long-running/non-functional parallel implementation.
$endgroup$
2
$begingroup$
Thanks for your answer, but I don't think it addresses the problem OP encountered.LaunchKernels
andDistributeDefinitions
are done automatically, there is no need of explicitly writing down. There won't be an "immense speed-up with parallel functions" in either case. Testing the parameter can avoid unnecessary symbolic computations, but won't help here since everything is numerical.
$endgroup$
– happy fish
4 hours ago
$begingroup$
@happyfish I'm not sure that is entirely accurate, unfortunately. Though it would be nice! My understanding is as follows: When you perform the first call on a parallel function, you will spend more time than subsequent calls, this being due to the need to launch all kernels. Additionally there is some time taken to distribute definitions, if this is indeed done automatically. I am curious if there is a part of the documentation you can point to for this? I am unable to have ParallelTable actually use all kernels unless you have done as I stated, otherwise they take about a second longer.
$endgroup$
– CA Trevillian
4 hours ago
$begingroup$
@happyfish my comment stems from my having had an order of magnitude speed-up earlier today, by distributing definitions of my self-packaged function and launching the kernels ahead of their parallel execution. It seems, though, this may be another time when "vectorized"(I still struggle to confidently state/grasp this concept/method) functions would be helpful if implemented? Your expertise puts mine at a junior, however, so I will look to your continued interpretation of this problem solution.
$endgroup$
– CA Trevillian
3 hours ago
1
$begingroup$
I agree with your general ideas on parallel evaluations. I am just saying that these theories don't localize for this particular problem. If you experiment on the problem you will find immediately that the bottleneck is not on where you focus: it's just distributing 10 difficult tasks to 6(by default) kernels, the overhead of subsequent calls and copying definitions is negligible. For the automatically distribute definition part, please refer to the first example in Options->DistributedContexts and mathematica.stackexchange.com/questions/39178/…
$endgroup$
– happy fish
3 hours ago
add a comment |
$begingroup$
Two things will provide for immense speed-up with parallel functions like ParallelTable:
Launch your kernels ahead of the initial parallel call with:
LaunchKernels["Number of Kernels, max available if left blank"]
Ensure each kernel has prior knowledge of the functions with:
DistributeDefinitions["context`"]
You should also see some increase in speed, due to a decrease in CPU need, if you were to provide assumptions for all of your defined variable functions. What I mean by this is something like:
f[x_?NumericQ,n_?IntegerQ]
Wherein x is always a numerical input and n is an integer.
I hope this helps you understand how to run parallel code better, it's a constant learning process, as we will continue to make more and more efficient ways that leave the previous best methods in the dust, and we will have to keep up :D
So, after discussing with @happy fish, I was able to test the code, and got this output, after replacing the second ParallelTable with Table:
-0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029
There is something amiss with this, and I apologize that I cannot immediately parse what the issue is. I will take some time to check later and see if I can provide additional input, after satisfying my own duties prior ;) As for the rest:
The issue with using two ParallelTable calls is why you would not receive output for your addition of Parallel to the second Table, again, barring my lack of understanding. Additionally, you would assuredly benefit from a functional method of implementing this code. There are numerous inline reassignments which can likely be shortened, and I anticipate that is another issue imparting itself upon your long-running/non-functional parallel implementation.
$endgroup$
2
$begingroup$
Thanks for your answer, but I don't think it addresses the problem OP encountered.LaunchKernels
andDistributeDefinitions
are done automatically, there is no need of explicitly writing down. There won't be an "immense speed-up with parallel functions" in either case. Testing the parameter can avoid unnecessary symbolic computations, but won't help here since everything is numerical.
$endgroup$
– happy fish
4 hours ago
$begingroup$
@happyfish I'm not sure that is entirely accurate, unfortunately. Though it would be nice! My understanding is as follows: When you perform the first call on a parallel function, you will spend more time than subsequent calls, this being due to the need to launch all kernels. Additionally there is some time taken to distribute definitions, if this is indeed done automatically. I am curious if there is a part of the documentation you can point to for this? I am unable to have ParallelTable actually use all kernels unless you have done as I stated, otherwise they take about a second longer.
$endgroup$
– CA Trevillian
4 hours ago
$begingroup$
@happyfish my comment stems from my having had an order of magnitude speed-up earlier today, by distributing definitions of my self-packaged function and launching the kernels ahead of their parallel execution. It seems, though, this may be another time when "vectorized"(I still struggle to confidently state/grasp this concept/method) functions would be helpful if implemented? Your expertise puts mine at a junior, however, so I will look to your continued interpretation of this problem solution.
$endgroup$
– CA Trevillian
3 hours ago
1
$begingroup$
I agree with your general ideas on parallel evaluations. I am just saying that these theories don't localize for this particular problem. If you experiment on the problem you will find immediately that the bottleneck is not on where you focus: it's just distributing 10 difficult tasks to 6(by default) kernels, the overhead of subsequent calls and copying definitions is negligible. For the automatically distribute definition part, please refer to the first example in Options->DistributedContexts and mathematica.stackexchange.com/questions/39178/…
$endgroup$
– happy fish
3 hours ago
add a comment |
$begingroup$
Two things will provide for immense speed-up with parallel functions like ParallelTable:
Launch your kernels ahead of the initial parallel call with:
LaunchKernels["Number of Kernels, max available if left blank"]
Ensure each kernel has prior knowledge of the functions with:
DistributeDefinitions["context`"]
You should also see some increase in speed, due to a decrease in CPU need, if you were to provide assumptions for all of your defined variable functions. What I mean by this is something like:
f[x_?NumericQ,n_?IntegerQ]
Wherein x is always a numerical input and n is an integer.
I hope this helps you understand how to run parallel code better, it's a constant learning process, as we will continue to make more and more efficient ways that leave the previous best methods in the dust, and we will have to keep up :D
So, after discussing with @happy fish, I was able to test the code, and got this output, after replacing the second ParallelTable with Table:
-0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029
There is something amiss with this, and I apologize that I cannot immediately parse what the issue is. I will take some time to check later and see if I can provide additional input, after satisfying my own duties prior ;) As for the rest:
The issue with using two ParallelTable calls is why you would not receive output for your addition of Parallel to the second Table, again, barring my lack of understanding. Additionally, you would assuredly benefit from a functional method of implementing this code. There are numerous inline reassignments which can likely be shortened, and I anticipate that is another issue imparting itself upon your long-running/non-functional parallel implementation.
$endgroup$
Two things will provide for immense speed-up with parallel functions like ParallelTable:
Launch your kernels ahead of the initial parallel call with:
LaunchKernels["Number of Kernels, max available if left blank"]
Ensure each kernel has prior knowledge of the functions with:
DistributeDefinitions["context`"]
You should also see some increase in speed, due to a decrease in CPU need, if you were to provide assumptions for all of your defined variable functions. What I mean by this is something like:
f[x_?NumericQ,n_?IntegerQ]
Wherein x is always a numerical input and n is an integer.
I hope this helps you understand how to run parallel code better, it's a constant learning process, as we will continue to make more and more efficient ways that leave the previous best methods in the dust, and we will have to keep up :D
So, after discussing with @happy fish, I was able to test the code, and got this output, after replacing the second ParallelTable with Table:
-0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029, -0.463029
There is something amiss with this, and I apologize that I cannot immediately parse what the issue is. I will take some time to check later and see if I can provide additional input, after satisfying my own duties prior ;) As for the rest:
The issue with using two ParallelTable calls is why you would not receive output for your addition of Parallel to the second Table, again, barring my lack of understanding. Additionally, you would assuredly benefit from a functional method of implementing this code. There are numerous inline reassignments which can likely be shortened, and I anticipate that is another issue imparting itself upon your long-running/non-functional parallel implementation.
edited 3 hours ago
answered 4 hours ago
CA TrevillianCA Trevillian
435
435
2
$begingroup$
Thanks for your answer, but I don't think it addresses the problem OP encountered.LaunchKernels
andDistributeDefinitions
are done automatically, there is no need of explicitly writing down. There won't be an "immense speed-up with parallel functions" in either case. Testing the parameter can avoid unnecessary symbolic computations, but won't help here since everything is numerical.
$endgroup$
– happy fish
4 hours ago
$begingroup$
@happyfish I'm not sure that is entirely accurate, unfortunately. Though it would be nice! My understanding is as follows: When you perform the first call on a parallel function, you will spend more time than subsequent calls, this being due to the need to launch all kernels. Additionally there is some time taken to distribute definitions, if this is indeed done automatically. I am curious if there is a part of the documentation you can point to for this? I am unable to have ParallelTable actually use all kernels unless you have done as I stated, otherwise they take about a second longer.
$endgroup$
– CA Trevillian
4 hours ago
$begingroup$
@happyfish my comment stems from my having had an order of magnitude speed-up earlier today, by distributing definitions of my self-packaged function and launching the kernels ahead of their parallel execution. It seems, though, this may be another time when "vectorized"(I still struggle to confidently state/grasp this concept/method) functions would be helpful if implemented? Your expertise puts mine at a junior, however, so I will look to your continued interpretation of this problem solution.
$endgroup$
– CA Trevillian
3 hours ago
1
$begingroup$
I agree with your general ideas on parallel evaluations. I am just saying that these theories don't localize for this particular problem. If you experiment on the problem you will find immediately that the bottleneck is not on where you focus: it's just distributing 10 difficult tasks to 6(by default) kernels, the overhead of subsequent calls and copying definitions is negligible. For the automatically distribute definition part, please refer to the first example in Options->DistributedContexts and mathematica.stackexchange.com/questions/39178/…
$endgroup$
– happy fish
3 hours ago
add a comment |
2
$begingroup$
Thanks for your answer, but I don't think it addresses the problem OP encountered.LaunchKernels
andDistributeDefinitions
are done automatically, there is no need of explicitly writing down. There won't be an "immense speed-up with parallel functions" in either case. Testing the parameter can avoid unnecessary symbolic computations, but won't help here since everything is numerical.
$endgroup$
– happy fish
4 hours ago
$begingroup$
@happyfish I'm not sure that is entirely accurate, unfortunately. Though it would be nice! My understanding is as follows: When you perform the first call on a parallel function, you will spend more time than subsequent calls, this being due to the need to launch all kernels. Additionally there is some time taken to distribute definitions, if this is indeed done automatically. I am curious if there is a part of the documentation you can point to for this? I am unable to have ParallelTable actually use all kernels unless you have done as I stated, otherwise they take about a second longer.
$endgroup$
– CA Trevillian
4 hours ago
$begingroup$
@happyfish my comment stems from my having had an order of magnitude speed-up earlier today, by distributing definitions of my self-packaged function and launching the kernels ahead of their parallel execution. It seems, though, this may be another time when "vectorized"(I still struggle to confidently state/grasp this concept/method) functions would be helpful if implemented? Your expertise puts mine at a junior, however, so I will look to your continued interpretation of this problem solution.
$endgroup$
– CA Trevillian
3 hours ago
1
$begingroup$
I agree with your general ideas on parallel evaluations. I am just saying that these theories don't localize for this particular problem. If you experiment on the problem you will find immediately that the bottleneck is not on where you focus: it's just distributing 10 difficult tasks to 6(by default) kernels, the overhead of subsequent calls and copying definitions is negligible. For the automatically distribute definition part, please refer to the first example in Options->DistributedContexts and mathematica.stackexchange.com/questions/39178/…
$endgroup$
– happy fish
3 hours ago
2
2
$begingroup$
Thanks for your answer, but I don't think it addresses the problem OP encountered.
LaunchKernels
and DistributeDefinitions
are done automatically, there is no need of explicitly writing down. There won't be an "immense speed-up with parallel functions" in either case. Testing the parameter can avoid unnecessary symbolic computations, but won't help here since everything is numerical.$endgroup$
– happy fish
4 hours ago
$begingroup$
Thanks for your answer, but I don't think it addresses the problem OP encountered.
LaunchKernels
and DistributeDefinitions
are done automatically, there is no need of explicitly writing down. There won't be an "immense speed-up with parallel functions" in either case. Testing the parameter can avoid unnecessary symbolic computations, but won't help here since everything is numerical.$endgroup$
– happy fish
4 hours ago
$begingroup$
@happyfish I'm not sure that is entirely accurate, unfortunately. Though it would be nice! My understanding is as follows: When you perform the first call on a parallel function, you will spend more time than subsequent calls, this being due to the need to launch all kernels. Additionally there is some time taken to distribute definitions, if this is indeed done automatically. I am curious if there is a part of the documentation you can point to for this? I am unable to have ParallelTable actually use all kernels unless you have done as I stated, otherwise they take about a second longer.
$endgroup$
– CA Trevillian
4 hours ago
$begingroup$
@happyfish I'm not sure that is entirely accurate, unfortunately. Though it would be nice! My understanding is as follows: When you perform the first call on a parallel function, you will spend more time than subsequent calls, this being due to the need to launch all kernels. Additionally there is some time taken to distribute definitions, if this is indeed done automatically. I am curious if there is a part of the documentation you can point to for this? I am unable to have ParallelTable actually use all kernels unless you have done as I stated, otherwise they take about a second longer.
$endgroup$
– CA Trevillian
4 hours ago
$begingroup$
@happyfish my comment stems from my having had an order of magnitude speed-up earlier today, by distributing definitions of my self-packaged function and launching the kernels ahead of their parallel execution. It seems, though, this may be another time when "vectorized"(I still struggle to confidently state/grasp this concept/method) functions would be helpful if implemented? Your expertise puts mine at a junior, however, so I will look to your continued interpretation of this problem solution.
$endgroup$
– CA Trevillian
3 hours ago
$begingroup$
@happyfish my comment stems from my having had an order of magnitude speed-up earlier today, by distributing definitions of my self-packaged function and launching the kernels ahead of their parallel execution. It seems, though, this may be another time when "vectorized"(I still struggle to confidently state/grasp this concept/method) functions would be helpful if implemented? Your expertise puts mine at a junior, however, so I will look to your continued interpretation of this problem solution.
$endgroup$
– CA Trevillian
3 hours ago
1
1
$begingroup$
I agree with your general ideas on parallel evaluations. I am just saying that these theories don't localize for this particular problem. If you experiment on the problem you will find immediately that the bottleneck is not on where you focus: it's just distributing 10 difficult tasks to 6(by default) kernels, the overhead of subsequent calls and copying definitions is negligible. For the automatically distribute definition part, please refer to the first example in Options->DistributedContexts and mathematica.stackexchange.com/questions/39178/…
$endgroup$
– happy fish
3 hours ago
$begingroup$
I agree with your general ideas on parallel evaluations. I am just saying that these theories don't localize for this particular problem. If you experiment on the problem you will find immediately that the bottleneck is not on where you focus: it's just distributing 10 difficult tasks to 6(by default) kernels, the overhead of subsequent calls and copying definitions is negligible. For the automatically distribute definition part, please refer to the first example in Options->DistributedContexts and mathematica.stackexchange.com/questions/39178/…
$endgroup$
– happy fish
3 hours ago
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f195571%2fparallel-computing-problem%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown