bartvanderaa/dropAndRunCalculationsForMatlab
If you ever need to do a (huge) parameter study using a Matlab based simulation program, and run these simulations on a Linux server, you may end up logging into the respective screen-session just too often. That is, if you would need to start running each case manually from the command-line. For those occasions, I came up with a solution which hopefully is helpful for some other people out there.
The idea is to create a folder structure where executable .m-files can be dropped easily using an ordinary FTP program. The code searches for the oldest excectubale script in the "toBeProcessed" folder, moves the script to the "processing" folder, and runs the simulation. When the simulation is finished, the script is moved to the "processed" folder, and the code again searches for the oldest file in the "toBeProcessed" folder. If no new calculation file is found a timer is started and terminates the code when 7 days (604800 seconds) have passed.
In brief:
- Drag-and-drop .m-file calculation scripts into a serial server session, e.g. on a remote Linux server with a local SSH (screen) session.
- The overhead script continuously looks for new excecutable scripts, and runs them if new files are found.
- The oldest files in the folder are computed first.
A three-stage folder structure (toBeProcessed, processing, processed) is used to avoid infinite excecution.
- Excecutable m-files are written as usual, but storage of the .mat-file is done according to, e.g. savePath = fileparts(pwd); save([savePath '/mat/solutions.mat']);
- Avoid using clear-statements in the excecutable scripts, otherwise the folder-structure is deleted too.
Cite As
Bart van der Aa (2024). bartvanderaa/dropAndRunCalculationsForMatlab (https://github.com/bartvanderaa/dropAndRunCalculationsForMatlab), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Versions that use the GitHub default branch cannot be downloaded
Version | Published | Release Notes | |
---|---|---|---|
1.2.0.0 | Header text updates. |
|