Run Parallel Simulations in Signal Integrity Toolbox
You can easily generate many thousands of SPICE or Channel Analysis simulations using the Serial Link Designer and Parallel Link Designer apps. By default, the apps run all simulations sequentially on the local computer, which can take a significant amount of time to complete. However, if you have a Parallel Computing Toolbox™ license, then you can run multiple simulations in parallel and considerably reduce the time required to run the complete set of simulations.
Using the default Parallel Computing Toolbox settings, most users can run parallel simulations quickly and efficiently without making any changes to the settings. However, in some cases, running simulations with the default settings on your local machine can reduce the interactive performance and impede your ability to do other work at the same time. Likewise, running too many simulations at once on a multiuser machine can negatively impact other users. If you find that the default settings negatively impact you or other users on a shared machine, then you can modify the parallel computing settings.
Here are some useful parallel computing concepts:
Task: A list of operations. In Signal Integrity Toolbox™, these operations are individual simulations. Each task can consist of one or multiple simulations run sequentially.
Cluster: The location where tasks will be performed. A cluster can be a single machine that can execute multiple threads simultaneously, such as a multiprocessor or multicore system, or a system with one or more CPUs. A cluster can also consist of a group of remote machines.
Worker: A MATLAB® computational engine that runs in the background without a graphical desktop.
Parallel pool: A set of MATLAB workers running in parallel on a cluster.
Configure Local MATLAB Cluster for Parallel Simulations
Using the default Parallel Computing Toolbox settings, the built-in local MATLAB cluster uses all available cores (or logical processors) on a machine.
When performing local simulations, Parallel Computing Toolbox uses a parallel pool. Each worker in a parallel pool launches its own instance of MATLAB. Therefore, the workers can use a significant amount of memory when running. Make sure that a minimum of 4 GB RAM per worker is available to avoid an impact on the overall performance of the target machine.
You can adjust the number of workers used in parallel simulations using the Cluster Profile Manager. This figure shows Cluster Profile Manager with a custom cluster called si_simulations that uses ten workers.
Open the Cluster Profile Manager from the MATLAB toolstrip by selecting the Parallel drop-down list from the Environment tab, then select Create and Manage Clusters. Follow these steps to add and configure a cluster suitable for your signal integrity simulations in the Cluster Profile Manager:
Highlight the default Processes Cluster Profile
Select Duplicate from the toolbar menu. This action creates a copy of the local profile named Processes_Copy.
Rename the Prcesses_Copy profile to si_simulationsor to a name you prefer by double-clicking the profile name and editing the text box.
With the si_simulations profile highlighted, click the Edit button to modify the si_simulations profile.
Change the number of workers (
NumWorkers) text field to the desired number of workers. A good starting point is 4 GB per worker. For example, on a machine with 12 logical processors and 64 GB of memory, setting the number of workers to 10 should allow for good interactive performance without using all the resources on the machine. However, on the same machine with only 32 GB of memory, setting the number of workers to 6 keeps you from running out of memory.
When running on a remote cluster, use a similar approach. However, if the remote machine is shared across multiple users, reduce the number of workers to allow good performance for all users. You may need to adjust this number in your cluster based on the memory and CPU demands on your cluster and the machine hosting your cluster.
Click Done to save the changes.
With si_simulations highlighted, click the Set as Default button in the toolbar menu.
Finally, test that everything is working correctly by clicking the Validate button. If everything works, you can close the Cluster Profile Manager.
Parallel Computing Toolbox supports many different cluster types such as Microsoft® Windows® HPC Server or IBM Spectrum LSF®. For more information about configuring these clusters, see Discover Clusters and Use Cluster Profiles (Parallel Computing Toolbox) and Get Started with MATLAB Parallel Server (MATLAB Parallel Server).
Adjust Cluster Settings for Signal Integrity Toolbox
To edit the cluster settings in the Serial Link Designer and Parallel Link Designer apps, select Setup > User Preferences, then select the Simulation tab.
For Parallel Link Designer, select either the IsSpice4 or HSPICE simulator using the radio buttons. Serial Link Designer only supports HSPICE simulations.
Signal Integrity Toolbox provides an unlimited number of IsSpice4 licenses. The only limit on the number of IsSpice4 and Channel Analysis simulations that can be run in parallel is the size of your cluster.
Running HSPICE simulations requires a separate HSPICE license and installation. The number of HSPICE simulations is limited to the number of HSPICE licenses that you have.
You can specify the path to the HSPICE executable whether running a single simulation at a time locally or many simulations in parallel on a cluster. The Default setting picks the version of HSPICE specified by the HSPICE system environment variables. The Other setting allows a specific version of HSPICE to be used when multiple versions are installed.
You can add additional HSPICE flags using the Other
path. For example, to enable multithreading, use:
C:/synopsys/Hspice_P-2019.06-SP1/WIN64/hspice.exe -mt 2.
Parallel Computing Toolbox Clusters
You can specify different clusters for SPICE and Channel Analysis simulations. If you
do not require different clusters for SPICE and Channel Analysis and will not concurrently
run other MATLAB functions (such as
parfor (Parallel Computing Toolbox)) on a parallel cluster while you are running simulations, then select
<Default Cluster> for both SPICE and Channel
Choose the default cluster from the MATLAB toolstrip by selecting the Parallel > Select a Default Cluster drop-down list.
The Parallel button enables and disables parallel simulations. The Test button is similar to the Validate function in the Cluster Profile Manager, but also includes some additional tests specific to Signal Integrity Toolbox. Test the final setup to verify that everything is set up and working correctly.
Number of Simulations Per Task
The Number of Simulations Per Task specifies how many
simulations are submitted to a worker. By default, a single simulation is sent to each
worker. When a worker completes a simulation, a new single simulation is sent to that
worker. Although the overhead of this process is low, when running very fast simulations
(less than 1 second per simulation), it can be advantageous to submit multiple simulations
to a worker. Unless you are consistently running very fast simulations, leave this setting
Local to Remote Path Maps
The local path refers to a network drive as seen from the local machine. The remote
path refers to the path as seen from the cluster machine. Map the local path to the remote
path when using a queuing system such as MATLAB Job Scheduler (MJS) or IBM Spectrum LSF®. The project must be on a network
drive that is accessible by both the local machine and the remote machine. For example, a
network drive mapped as
Z:/ on a local Windows machine might be seen as
/hw/projects from a remote Linux
machine that runs the remote simulation.
Path maps are not required when running local parallel pools or Microsoft Windows HPC Server clusters.
File Completion Retry
Completion Retry Count specifies how many times Signal Integrity Toolbox will retry its completion check before flagging a simulation as incomplete and failed. Completion Retry Pause specifies the delay, in seconds, between each completion check retry.
In some remote server and remote disk environments, the simulation output files are not completely written to disk when the simulation completes. If you see simulation errors when simulations appear to have run to completion, try increasing the value of these two parameters.
Run Parallel Simulations
First, set up the simulation parameters to populate the solution space. For example, this figure shows the Solution Space panel with parameters set up according to the example Analyze Parallel Links with Parallel Link Designer. The Base SPICE Simulation Count shows that there are 15 simulations.
To run the simulations, select Run > Simulated Selected. The Prelayout Simulation dialog box opens.
If you have Parallel Computing Toolbox, then the Parallel button should already be selected. Toggle this selection to enable and disable the parallel simulations. With the Parallel button enabled, launch the simulations by clicking Run. There is a short delay while the parallel pool starts.
Note: The startup time of the parallel pool is only required for the first set of simulations. After the parallel pool is up and running, subsequent simulations will launch immediately. By default, the parallel pool will remain up for 30 minutes. This value can be adjusted using the Parallel Computing Toolbox Preferences dialog box.
You can monitor the simulations using the SPICE Queue Monitor panel of the Prelayout Simulation dialog box. The SPICE Queue Monitor shows this information:
Total number of simulations submitted
Number of simulations completed
Number of simulations completed without errors
Number of simulations currently running
Number of simulations still waiting in the queue
Total elapsed time
Project finish time based on the number of simulations submitted and the time taken by the already completed simulations to run
You can also track the status of simulations using the Job Monitor in MATLAB. The Job Monitor shows the number of tasks that can currently be run in the parallel pool (equivalent to the number of workers here) and the current state of the parallel pool. The description in this example reads Interactive Pool and the State reflects the current state of the parallel pool and not the state of the current set of simulations. Entries in the Job Monitor are never automatically purged and will accumulate over time. You can periodically delete old entries by selecting them, right-clicking, and selecting Delete. For more information, see Job Monitor (Parallel Computing Toolbox).