优化 Jacobian 确定性复用并补充性能剖析与平台依赖文档

在单次 Jacobian 构建内按完整输入精确复用储气物性、PH 反算、密度和管路求根结果,保持原有求值副作用、差分政策与失败回退。八路模型求解 CPU 中位数减少 19.27%,循环和不循环的完整原始采样均与恢复基线一致。

增加独立的跨平台时间剖析工具,记录互斥阶段耗时、Newton/LU 统计、矩阵复用与内核复用,保存 UD00 两种工况的调查报告和机器可读汇总。

补充 Windows/Linux 运行、测试、原生编译和剖析所需依赖文档及索引,不修改依赖清单、版本锁或安装环境。

验证:8 项新增专项回归通过;2270 次完整 Jacobian 核对零差异;16 次剖析配对及预热运行保持完整数值一致。既有固定样本哈希失败和 Linux 实机验收限制见报告。
This commit is contained in:
ljz committed 2026-09-16 13:39:53 +08:00
1 parent 2b07d996cf
commit 1aac220084
26 files changed
+2293 -13

No files matched your search

+4
View File
@@ -7,6 +7,7 @@
#ifndef NFRICTIONS
#define NFRICTIONS 0
#endif
#define NATIVE_JACOBIAN_STATS_COUNT 3
typedef struct {
double start, stop, sample_step, max_step, rtol, timeout;
int bdf, record_samples;
@@ -33,6 +34,9 @@ typedef struct {
int jacobian_verify, jacobian_colored;
unsigned long jacobian_rhs, jacobian_colored_evals, jacobian_fallbacks;
unsigned long jacobian_checks, jacobian_mismatches, cvode_rhs, linear_rhs;
unsigned long jacobian_gas_evaluations, jacobian_gas_reuses;
/* PH, density, pipe. Keep runtime-only harnesses independent of kernels.h. */
unsigned long jacobian_scalar_evaluations[NATIVE_JACOBIAN_STATS_COUNT], jacobian_scalar_reuses[NATIVE_JACOBIAN_STATS_COUNT];
unsigned long same_time_returns, same_time_streak, max_same_time_streak;
int stagnating, cvode_flag;
double cvode_return_time, cvode_internal_time, cvode_last_step, cvode_next_step;