-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Hot Start File save-during-simulation feature #393
Conversation
Wow! I'm truly impressed you kept this alive and finally finished it after this long, @bemcdonnell! |
@jsadler2 trying to increase my follower count on GitHub… hahaha |
@bemcdonnell looks like the Mac tests are not running. We might have to revert back to the 10.14 version. |
@abhiramm7 thanks! Once I get review from @karosc ill merge! |
src/solver/toolkit.c
Outdated
@@ -412,6 +412,75 @@ EXPORT_TOOLKIT int swmm_getSimulationParam(SM_SimSetting type, double *value) | |||
return error_code; | |||
} | |||
|
|||
EXPORT_TOOLKIT int DLLEXPORT swmm_hotstart(SM_HotStart type, const char *hsfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove DLLEXPORT
from the function declaration for this to work with the SWIG wrapper.
src/solver/toolkit.c
Outdated
char fl_name[MAXFNAME]; | ||
sstrncpy(fl_name, hsfile, MAXFNAME); | ||
Fhotstart1.mode = USE_FILE; | ||
sstrncpy(Fhotstart1.name, addAbsolutePath(fl_name), MAXFNAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
When saving a hotstart,
addAbsolutePath
is not used...so the hotstart path is relative to the current working directory (CWD). -
When using a hotstart,
addAbsolutePath
IS used...so the hotstart path becomes relative to the inp file.
This discontinuity might be confusing to users who run a pyswmm model using an input file that is not in the CWD, you'd need to either always use an absolute path to reference the HSF, or change how to reference the path to the HSF depending on whether your SAVING or USING.
I think when using the API, it makes more prescribe paths relative to the CWD, so I'd consider removing addAbsolutePath
.
Inspired by @jsadler2 many years ago.. It's finally time to merge it in! This feature could really change how we perform model calibrations and I am really excited to see it in action! |
Closes #253, Finally!
Replaces #252. I took the work for @jsadler2 and finally retooled it to bring it in to SWMM.
With this feature the users can save a HSF any time during a simulation.