bartvanderaa/dropAn​dRunCalculationsFor​Matlab

Drag, drop , and execute .m-file scripts on a Linux server.
43 Downloads
Updated 17 Aug 2015

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
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on File Operations in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.2.0.0

Header text updates.

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.