To get rid of this error, you can disable TSHistory with the command line 
option -ts_trajectory_use_history 0

or set up your TS with

TSGetTrajectory(ts, &tj);
TSTrajectorySetUseHistory(tj, PETSC_FALSE);

It is a known issue, but not the intended behavior for TSSetSaveTrajectory. I 
think TSHistory should be disabled by default in TS. It is actually disabled in 
the setup for TSAdjoint. So if you call TSAdjointSolve once, this error should 
not occur in the following calls to TSSolve.

Hong(Mr.)

On Aug 18, 2020, at 1:11 PM, Salazar De Troya, Miguel via petsc-users 
<[email protected]<mailto:[email protected]>> wrote:

Hello,

If I set up my TS with TSSetSaveTrajectory() and then call TSSolve() more than 
once, the second time I get this error:

[0] TSSolve() line 4102 in 
/Users/salazardetro1/scicomp_libraries/firedrake-debug/firedrake/src/petsc/src/ts/interface/ts.c
[0] TSTrajectorySet() line 73 in 
/Users/salazardetro1/scicomp_libraries/firedrake-debug/firedrake/src/petsc/src/ts/trajectory/interface/traj.c
[0] TSHistoryUpdate() line 82 in 
/Users/salazardetro1/scicomp_libraries/firedrake-debug/firedrake/src/petsc/src/ts/interface/tshistory.c
[0] Petsc has generated inconsistent data
[0] History id should be unique

If I call TSAdjointSolve() in between calls to TSSolve(), there is no problem. 
Is this the intended behavior for TSSetSaveTrajectory? Meaning that 
TSAdjointSolve() always has to be called right after TSSolve() if 
TSSetSaveTrajectory() is called. I need to call TSSolve() independently of 
TSAdjointSolve() whenever I want to perform a line search during the 
optimization.

Is there a workaround like creating a new trajectory whenever TSSolve() is 
called?

Thanks
Miguel



Miguel A. Salazar de Troya
Postdoctoral Researcher, Lawrence Livermore National Laboratory
B141
Rm: 1085-5
Ph: 1(925) 422-6411

Reply via email to