There seems to be a problem with ParametricNDSolveValue togeteher with ParallelTable
First we create a ParametricNDSolveValue object
f = ParametricNDSolveValue[{x'[t] == -a x[t], x[0] == 1}, (x[1] - 1)^2, {t, 0, 2}, {a}]
ParametricFunction[SequenceForm["<", ">"]]
Then we make a table of derivatives, which works fine.
Table[D[f[a], a], {2}]
Now we do the same thing in a ParallelTable, which gives a huge amount of errors.
ParallelTable[D[f[a], a], {2}]
Internal`Bag::intpm: Positive machine-sized integer expected at position 3 in Internal`Bag[{{#1,#2},{#3,#4}},#5,#6].
Thread::tdlen: Objects of unequal length in {0}+{0,0,0,0,0,0,0,0,0}+<<11>>+0& (<<33>>^(<<1>>))[0,<<8>>,{1.}]+(Internal`Bag^({{0,0},{0,1}},0,0))[{{t$8850,a$8849},{t,a}},1,2] (NDSolve`NDSolveParametricFunction^(0,{0,1},<<6>>,{},{0}))[0,{ParametricNDSolveValue,Internal`Bag[<2>]},<<6>>,{},{1.}] cannot be combined.
If we use Deriviative this works fine
ParallelTable[Derivative[1][f][a], {2}]
Is this a bug in ParametricNDSolve?
Comments
Post a Comment