☰ Contents

How to set up queued simulations? That is, how to automatically run the next specified project after one simulation file finishes?

Problem Description

When running multiple simulation projects manually, I have to start each subsequent project only after the previous simulation completes. This workflow is not only inefficient but also prone to operational omissions. I need the automatic job queuing function sequentially launch specified projects upon completion of preceding simulations.

Possible Causes

The software provides a Jobs feature, allowing users to add simulation tasks to the Jobs queue and execute them in sequence, or use the script command runjobs to run the current queue.

Solutions

Troubleshooting

Users need to understand and master the basic usage of the Jobs feature.

Resolution Methods

There are two ways to implement queued simulations in the software:

1. Set up the simulation queue directly via the Jobs tab in the software.

2. Use script commands to set up the simulation queue, mainly involving the addjob and runjobs commands. For details, refer to Job Management.

Code Function
runjobs; Sequentially runs simulation tasks in the current project’s active solver queue. If no project is open, the FDTD solver queue is used by default.
runjobs('solver_type', parallel_set) Runs tasks in the specified solver’s queue. parallel_set=0: runs tasks in single-process mode. parallel_set=1: runs tasks using the parallel number set in the Jobs page.

The following script demonstrates how to use addjob and runjobs to perform parameter sweeps. Multiple project files with different parameters are saved using saveproject, then added to the Jobs queue in a for loop, and simulations are run sequentially.

addcircle;
addfdtd;
rad=[1:0.5:3].*1e-6;
for i=1:length(rad)
    setnamed('Circle','radius',rad(i));
    saveproject('D:/new_project/circle/'+'circle'+num2str(i));
    addjob('D:/new_project/circle/'+'circle'+num2str(i),'FDTD');
end
runjobs;

Currently, the Jobs feature is available for free trial in the SimWorks Finite Difference Cloud Client; users only need to pay for server computing resources, and related project results will be saved in the cloud. In the SimWorks Finite Difference Solutions client, Jobs requires authorization before use. Completed simulation results will automatically overwrite the original project.

Further Reading

Job Management