Workspace 6.21.5
Directing the execution of parallel loops to specific machines

Introduction

In the previous tutorials we saw how to create parallel workflows using the parallel loop support. In this tutorial we will see how we can enforce parallel loop iterations to execute on specific machines.

  • How to tag a listed workspace server as supporting a set of features
  • How to tag an operation / workflow as requiring a feature in order to execute

Contents


How to tag a server as supporting a feature

  1. Open the workspace editor
  2. Go to Settings / Configure application... menu and select the "Parallel / Remote execution" settings entry from the left hand list
  3. You should have two default servers in your servers list: one default Out of process server as well as a default Workspace server, remove any other servers from your list
    Configuring workspace editor client settings
  4. We are now going to register our local workspace server so click on the "Add server" button
    New workspace server with default settings
  5. Set the Server Type to "Workspace Server"
  6. Set the Host to the IP of a machine remote to your local machine on which you have a workspace-server running
  7. Set the Port to 42150 (or the port that the workspace server above was configured to run on if you changed this)
  8. Set the Max Jobs to 2
  9. Set the Enabled field to ticked
  10. Next, click on the Configure... button and set the authentication provider to "none" and click OK
    The TCP scheduler specific configuration dialog
  11. Finally, click on the Features... button and add a feature called 'MyLibrary' and click OK to close the features dialog. By doing this we are saying that this server has the 'MyLibrary' feature and so any workflows that require this feature should be executed on this machine
    Adding a feature to a listed server
  12. Click 'Apply' then 'Close'
  13. Restart the workspace editor
  14. Ensure that your workspace-server is running on the IP specified above

Tagging an operation as requiring a feature in order to execute

  1. Open the workspace editor.
  2. In the operation catalogue, locate the "Parallel loop" workflow (located under the "Parallel" item) and drag this sample workflow onto your workspace canvas.
    The Parallel loop workflow
  3. Select the "Parallel loop" workflow you have added and right click on the workflow's Loop dependency output and choose the "Create workspace output" menu item.
    The Parallel loop workflow connected to an output
  4. Next, double click on the "Parallel loop" workflow you have added onto your canvas. You should be able to see that the parallel loop is in fact a pre-built workflow that contains a ForLoop. The for loop body simply prints the loop's counter value to the workspace Log window pausing several seconds between each iteration (to simulate a lengthy operation).
  5. Select the "For Loop" operation in your workflow
    The Parallel loop workflow's IO Tree Widget
  6. You should be able to see that, by default, our loop is configured to execute 10 iterations. You should also see that the loop is configured to run in parallel as indicated by the "Enable parallel looping" option.
  7. Next, select the operation labelled 'For Loop', right click and click the Properties... menu item to display the operation's properties dialog
  8. In the Operation properties dialog you should notice an area entitled "Features".
    The Operation properties dialog
  9. Next, add the same feature we listed as being supported by our server in the previous section. To do this, click on the 'Add feature' button and enter the feature 'MyLibrary' and close the dialog by clicking on the OK button
  10. Next, save the workflow
  11. Run the workflow
  12. You should notice that your loop body iterations will all now be executing on the remotely executing workspace-server (and not on the local machine). This occurs because the scheduler pattern matches the features as required by our loop body workspace with an appropriate server that supports the required features. In this way we can use the 'feature' tagging support to direct a loop's iterations to execute on a similarly tagged server.

Summary

This concludes the tutorial on directing parallel loop iterations to execute on a remote machine.