Skip to content

Plugin Examples

Two complete examples showing how to build plugins from scratch. Make sure you’ve read the Plugin Guide first.

An MPI-based solver that runs in batch mode — version selection, file picking, conditional fields, MPI machinefile, environment variables, and pre/postprocess steps.

Go to Admin > Plugins, click New Plugin, enter ID my-solver, and click Create.

FieldValue
NameMy Solver
CategorySimulation
DescriptionRun My Solver MPI jobs on the cluster
Plugin Version1.0.0
EnabledLeave off until configuration is complete
FieldValue
Nodes1
Tasks per Node4
Memory8G
ExclusiveOn

Machinefile Type: Select With Slots (OpenMPI format).

Environment Modules: Add openmpi/4.1.1.

Environment Variables: Add one entry:

KeyValueEnabled
MY_SOLVER_LICENSE[email protected]On

Preprocess: Add a step:

NameCommandEnabled
Copy input to scratchcp "$input_file" /scratch/$SLURM_JOB_ID/On

Postprocess: Add a step:

NameCommandEnabled
Copy results backcp /scratch/$SLURM_JOB_ID/result.* .On

Click Add Version Fields to auto-generate versions, version, and version_path. Then edit:

  • versions default: {"2.5": "/opt/mysolver/2.5/bin/solver", "2.4": "/opt/mysolver/2.4/bin/solver"}
  • version default: 2.5

Add these parameters:

input_file — Type: string, Widget: file, Extensions: ["inp", "dat"], Required: yes

num_iterations — Type: integer, Widget: number, Default: 1000, Minimum: 1, Maximum: 100000

precision — Type: string, Widget: radio, Default: double, Enum: ["single", "double"], enumLabels: {"single": "Single Precision (faster)", "double": "Double Precision (accurate)"}

Terminal window
mpirun -np $SLURM_NTASKS -machinefile machinefile-$SLURM_JOB_ID \
"$version_path" -input "$input_file" -iter $num_iterations -prec "$precision"

Create two groups:

  • Solver Options — fields: version, precision, num_iterations
  • Input — fields: input_file
  1. Go to the Preview tab. Check Form Preview — you should see the version dropdown, precision radio buttons, iteration number field, and file picker.
  2. Fill in sample values and check Script Preview — verify the mpirun command looks correct.
  3. Click Save Plugin.
  4. Go to Basic Info tab, flip Enabled on, and save again.

A plugin for MATLAB that can run .m scripts in batch mode or launch the interactive MATLAB desktop inside a VNC session. This mirrors the built-in MATLAB plugin.

Go to Admin > Plugins, click New Plugin, enter ID my-matlab, and click Create.

FieldValue
NameMATLAB
CategoryData Analysis
DescriptionMathWorks MATLAB — batch scripts or interactive desktop
Plugin Version1.0.0
EnabledLeave off for now
FieldValue
CPUs per Task2
Memory4G

This is the key step:

  1. Under GUI Settings, check Enable VNC GUI.
  2. Set GUI Mode to Optional (user chooses).

This adds a “Run in GUI Desktop” checkbox to the submit form and makes a built-in gui variable available (true/false).

Click Add Version Fields and edit:

  • versions default: {"R2024a": "/usr/local/MATLAB/R2024a/bin/matlab", "Default": "/usr/local/bin/matlab"}
  • version default: R2024a

Add one more parameter:

script_path — Type: string, Widget: file, Extensions: ["m"], showIf: { "gui": false }, requiredIf: { "gui": false }

The showIf and requiredIf reference the built-in gui key. When the user checks “Run in GUI Desktop”, the script file field hides.

Terminal window
if [ "$gui" = "true" ]; then
"$version_path" -desktop
else
"$version_path" -nodisplay -nodesktop -nosplash < "$script_path"
fi

Create one group:

  • MATLAB Options — fields: version, script_path
  1. Go to Preview > Form Preview. You should see the version dropdown and the script file picker.
  2. Check the Run in GUI Desktop checkbox. The script_path field should disappear.
  3. Switch to Script Preview — verify the if/else block.
  4. Click Save Plugin, then enable it.