Example: Set the queue based on both Memory Architecture and Number of CPUs fields(Linux)
In this example, both the Memory Architecture and Number of CPUs fields that are selected together control what is displayed in the Queues field. A Linux script is required since users are accessing the submission form through the web browser only.
When a user selects Memory Architecture: Sequential, and Number of CPUs: 1, the default value that is displayed in the Queue field is normal.
When a user selects Memory Architecture: SMP, and Number of CPUs: 2 in the Number of CPUs field, the default value that is displayed in the Queue field is admin.
When a user selects any other combination of values in the Memory Architcture and Number of CPUsfields, the only value that is displayed in the Queue field is low.
- Create your Linux script and test that it works on Linux.
#!/bin/bash #this script controls which queues are available based on the values of MEMARC and NCPU if [ "$MEMARC" = "Sequential" -a "$NCPU" = "1" ]; then echo "<field-control visible=\"true\" type=\"default\">" echo "<option value=\"normal\" />" echo "</field-control>" elif [ "$MEMARC" = "SMP" -o "$NCPU" = "2" ]; then echo "<field-control visible=\"true\" type=\"default\">" echo "<option value=\"admin\" />" echo "</field-control>" else echo "<field-control visible=\"true\" type=\"content\">" echo "<option value=\"low\" />" echo "</field-control>" fi
- Unpublish your submission template.
- Add the fields to your submission template. Ensure the Memory
Architecture and Number of CPUs fields are listed before the
Queue field in the submission form as these fields control the
Queue field.
- Memory Architecture dropdown field with ID: MEMARC
- Number of CPUs dropdown field with ID: NCPU
- Queue field with ID: QUEUE
- Edit the Queue(QUEUE) field, select Enable
Dependencies, specify your script, and add the MEMARC and NCPU fields as linked fields.
For example:
- Save and publish your template.
- Test your template. In IBM Spectrum LSF Application Center, go to , select your form, and test the options to ensure that behavior is as expected.