Opened 8 years ago

Closed 6 years ago

#4159 closed defect (fixed)

Clean up flags dealing with Jacobian generation

Reported by: Francesco Casella Owned by: Willi Braun
Priority: high Milestone: 1.13.0
Component: Backend Version:
Keywords: Cc:

Description

The current situation with compiler flags dealing with Jacobian generation is a bit confusing. We have

  • --postOptModules=calculateStrongComponentJacobians Generates analytical jacobian for torn linear and non-linear strong components. By default non-linear components with user-defined function calls are skipped. See also debug flags: NLSanalyticJacobian and forceNLSanalyticJacobian)
  • --initOptModules=calculateStrongComponentJacobians Generates analytical jacobian for torn linear and non-linear strong components. By default non-linear components with user-defined function calls are skipped. See also debug flags: NLSanalyticJacobian and NLSanalyticJacobianDisable
  • --debug=NLSanalyticJacobian Enables analytical jacobian for non-linear strong components without user-defined function calls, for that see forceNLSanalyticJacobian
  • --debug=forceNLSanalyticJacobian Forces calculation analytical jacobian also for non-linear strong components with user-defined functions
  • detectJacobianSparsePattern Detects the sparse pattern for Jacobian A
  1. NLSanalyticJacobianDisable is mentioned in the documentation of --initOptModules=calculateStrongComponentJacobians ulateStrongComponentJacobians}}}, but actually seems to be defined nowhere
  1. It is not clear what is the interplay between the preOptModule and initOptModule flags and the debug flags. If I set the debug flags, do they override both the intOpt and postOpt flags? What if I wanted to force the symbolic differentiation of functions for the initial equation system but not for the causalized simulation equations?
  1. It is not clear what exactly is the Jacobian matrix A computed bydetectJacobianSparsePattern. I guess it is df/dx in the causalized representation dx/dt = f(x,t) - if so, please write it down explicitly

Change History (9)

in reply to:  description ; comment:1 by Willi Braun, 8 years ago

Status: newaccepted

Replying to casella:

  1. NLSanalyticJacobianDisable is mentioned in the documentation of --initOptModules=calculateStrongComponentJacobians ulateStrongComponentJacobians}}}, but actually seems to be defined nowhere

NLSanalyticJacobianDisable is outdated and already removed but forgotten in the flag description. Fixed in #PR1264.

Replying to casella:

  1. It is not clear what is the interplay between the preOptModule and initOptModule flags and the debug flags. If I set the debug flags, do they override both the intOpt and postOpt flags? What if I wanted to force the symbolic differentiation of functions for the initial equation system but not for the causalized simulation equations?

The debug flags do change the behavior of the module, which is used in the different pipe-lines. So currently you can not achieve the later behavior. So I need to create different modules for that.

Replying to casella:

  1. It is not clear what exactly is the Jacobian matrix A computed bydetectJacobianSparsePattern. I guess it is df/dx in the causalized representation dx/dt = f(x,t) - if so, please write it down explicitly.

Fixed in #PR1264.

in reply to:  1 ; comment:2 by Lennart Ochel, 8 years ago

Replying to wbraun:

Replying to casella:

  1. It is not clear what is the interplay between the preOptModule and initOptModule flags and the debug flags. If I set the debug flags, do they override both the intOpt and postOpt flags? What if I wanted to force the symbolic differentiation of functions for the initial equation system but not for the causalized simulation equations?

The debug flags do change the behavior of the module, which is used in the different pipe-lines. So currently you can not achieve the later behavior. So I need to create different modules for that.

You don't need different modules for that. You just need to define accurately the intended behaviour with flags.

in reply to:  2 ; comment:3 by Francesco Casella, 8 years ago

Replying to lochel:

You don't need different modules for that. You just need to define accurately the intended behaviour with flags.

I agree with Lennart. The case of doing different things for initialization and simulation was just hypothetical, it's probably of little or no practical use. Just make sure that the behaviour with the different flags is clear in the documentation, particularly when you combine them, because currently it's not.

I won't waste time adding other modules (and yet another flag), unless there's a specific need to do so.

in reply to:  3 comment:4 by Lennart Ochel, 8 years ago

Replying to casella:

The case of doing different things for initialization and simulation was just hypothetical, it's probably of little or no practical use.

I agree. The current design uses the same debug flags for all optimization phases. If there are other use cases, then we have just to define more specific debug flags. However, this has to be clear from the documentation.

comment:5 by Francesco Casella, 7 years ago

Milestone: 1.12.01.13.0

Milestone moved to 1.13.0 due to 1.12.0 already being released.

comment:6 by Willi Braun, 6 years ago

I think this is fixed in PR1264.
@casella Can we close it?

comment:7 by Francesco Casella, 6 years ago

I guess so. I only have one doubt: the detectJacobianSparsePattern flag has disappeared from the compiler flags. Was this done on purpose?

comment:8 by Willi Braun, 6 years ago

This is merged into the postOptModule: symbolicJacobian.

comment:9 by Francesco Casella, 6 years ago

Resolution: fixed
Status: acceptedclosed

OK, excellent!

Note: See TracTickets for help on using tickets.