优化雅可比矩阵计算;端口转发情况下仿真结果传输方式优化

This commit is contained in:
lujingze committed 2026-09-12 03:57:31 +00:00
1 parent 3bc4be3c06
commit aa4951b14e
28 files changed
+8038 -23

No files matched your search

+8
View File
@@ -59,6 +59,13 @@ static int write_result(NativeRun *r, const char *path, const char *index_path)
fprintf(f,"{\"success\":%s,\"status\":",!r->status?"true":"false");
json_string(f,r->status==0?"completed":r->status==1?"cancelled":"failed");
fprintf(f,",\"message\":"); json_string(f,r->message);
fprintf(f,",\"jacobianMode\":\"%s\",\"jacobianRhsCalls\":%lu,"
"\"jacobianColoredEvals\":%lu,\"jacobianFallbacks\":%lu,"
"\"jacobianChecks\":%lu,\"jacobianMismatches\":%lu,"
"\"cvodeRhsCalls\":%lu,\"cvodeLinearRhsCalls\":%lu",
!r->options.bdf?"not-used":r->jacobian_colored?"colored-difference":"dense-difference",
r->jacobian_rhs,r->jacobian_colored_evals,r->jacobian_fallbacks,
r->jacobian_checks,r->jacobian_mismatches,r->cvode_rhs,r->linear_rhs);
fprintf(f,",\"backend\":\"native-c\",\"method\":\"%s\",\"solver\":\"%s\",\"sundialsVersion\":\"%s\","
"\"simulatedUntil\":%.17g,\"solveSeconds\":%.17g,\"solveCpuSeconds\":%.17g,"
"\"nfev\":%lu,\"acceptedSteps\":%lu,\"rejectedSteps\":%lu,\"stateTransitions\":%lu,"
@@ -116,6 +123,7 @@ int main(int argc, char **argv) {
vector(stdout,y,NSTATES); fputc('\n',stdout); return 0;
}
if (!strcmp(arg,"--solve-only")) { r.options.record_samples=0; continue; }
if (!strcmp(arg,"--verify-jacobian")) { r.jacobian_verify=1; continue; }
if (i+1==argc) return 64;
const char *value=argv[++i];
if (!strcmp(arg,"--output")) output=value;