Skip to main content
deleted 26 characters in body
Source Link
vapor
  • 8k
  • 2
  • 23
  • 59

I have found the problem. 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} 

I have found the problem. 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} 

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} 
Source Link
vapor
  • 8k
  • 2
  • 23
  • 59

I have found the problem. 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}