Tachyon Parallel Ray-Tracer

Task 1 - Inspecting the tachyon_mpi Folder Contents

In this task, you will inspect the contents of the tachyon_mpi folder that contains the Tachyon MPI application and some essential utilities needed to execute it on Windows Azure nodes.

  1. Open the labs folder, navigate to the MPI\source\tachyon_mpi folder, and review its contents, as shown in Figure 12:

    Figure 12

    The contents of the tachyon_mpi folder

    The folder contains the following:

    1. AzureBlobCopy. This folder contains a command-line utility for uploading files to Windows Azure blob storage.
    2. tachyon.exe. This is the MPI application that will be executed in the Windows Azure nodes.
    3. tachyon.bat. This is a batch file that runs the MPI application on the HPC cluster.
    4. Input.dat files. These files will be processed by the tachyon.exe MPI application.
  2. Open the tachyon.bat file located in the tachyon_mpi folder, and review its contents.

    CMD

    mpiexec C:\app\tachyon\tachyon.exe -aasamples 4 -trans_vmd C:\app\tachyon\stmvao-white.dat -o C:\app\tachyon\stmvao-white_short.bmp -format BMP -rescale_lights 0.4 -add_skylight 0.9 -skylight_samples 32 -res 2000 2000 C:\app\tachyon\AzureBlobCopy\AzureBlobCopy.exe -Action Upload -BlobContainer tachyonout -LocalDir C:\app\tachyon -FileName stmvao-white_short.bmp
    1. The first line uses the mpiexec command to start the tachyon.exe MPI application.
    2. The second line uses the AzureBlobCopy.exe utility to upload the output of the MPI application to Windows Azure blob storage.

Task 2 - Configure the AzureBlobCopy Utility

In this task, you will configure the AzureBlobCopy to upload the result of the tachyon execution to a Windows Azure storage account accessible by you.

  1. Open the tachyon_mpi\AzureBlobCopy folder and review its contents, as shown in Figure 13:

    Figure 13

    The contents of the AzureBlobCopy folder

  2. Open the AzureBlobCopy.exe.config file and review its contents:

    XML

    <?xml version="1.0"?> <configuration> <appSettings> <add key="StorageAccountName" value="accountName"/> <add key="StorageKey" value="storageKey" /> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> </configuration>
  3. Update the configuration StorageAccountName and StorageKey application settings with a valid Windows Azure storage account name and key.

Task 3 - Deploy the Tachyon Application to Windows Azure Worker Nodes

In this task, you will deploy the Tachyon MPI application to your Windows Azure worker nodes.

  1. Open the command prompt window from Start | All Programs | Accessories | Command Prompt.
  2. Navigate to the MPI labs folder, and run the following command to create a deployment package (this step is illustrated in step 1 of Figure 1):

    CMD

    hpcpack create source\tachyon.zip source\tachyon_mpi\
  3. Run the following command to upload the deployment package to the Windows Azure package storage (this step is illustrated in step 2 of Figure 1):

    CMD

    hpcpack upload source\tachyon.zip /nodetemplate:"Azure node template" /relativePath:tachyon
    Note:
     Change the value of the nodetemplate parameter to the name of your Windows Azure node template.
  4. Use the following command to create a c:\app directory on the participating Windows Azure nodes:

    CMD

    clusrun /nodegroup:azurenodes md c:\app\
    Note:
     Change the value of the nodegroup parameter to the name of the group containing your Windows Azure nodes.
  5. Run the following command to deploy the contents of the deployment package to the Windows Azure nodes (this step is illustrated in step 3 of Figure 1):

    CMD

    clusrun /nodegroup:azurenodes hpcsync c:\app
    Note:
     Change the value of the nodegroup parameter to the name of the group containing your Windows Azure nodes.
  6. Run the following command to configure the Windows Azure Firewall to allow MPI communication between the Windows Azure nodes (this step is illustrated in step 4 of Figure 1):

    CMD

    clusrun /nodegroup:azurenodes hpcfwutil register tachyon c:\app\tachyon\tachyon.exe
    Note:
     Change the value of the nodegroup parameter to the name of the group containing your Windows Azure nodes.

Task 4 – Execute the Tachyon Application and View its Result

In this task, you will use the HPC 2008 R2 Cluster Manager to start a job that executes the Tachyon MPI application via tachyon.bat. Once the job is completed, you will access the Windows Azure blob storage via a URL and view the resulting image.

  1. Open the HPC 2008 R2 Cluster Manager application from Start | All Programs | Microsoft HPC Pack 2008 R2 | HPC Cluster Manager.
  2. In the Cluster Manager application, enter the Node Management section and verify that the Windows Azure nodes in the cluster are online, as shown in Figure 14:

    Figure 14

    Verifying the state of the Windows Azure nodes

  3. In the Cluster Manager application, enter the Job Management section and click New Job… in the Actions pane as shown in Figure 15:

    Figure 15

    Create a new job

  4. In the New Job dialog, set the Job name to tachyon, and in the Job resources, set the type of resources to Node, as shown in Figure 16:
  5. Figure 16

    Setting the name and resource type for the job

    Note:
    The Tachyon application can span several threads on multi-core machines. Rather than running several instances of the application on each node, one per core, it is preferable to run one instance of the application on each node, allowing that instance to take advantage of all the cores. This will reduce the number of running processes as well as the total amount of memory consumed by the Tachyon application.
  6. Still in the New Job dialog, click the Edit Tasks option, click the arrow next to the Add button, and then click Basic Task…, as shown in Figure 17:

    Figure 17

    New basic task

  7. In the Task Details and I/O Redirection window, set the Task name field to tachyon.bat, and in the Command Line field enter C:\app\tachyon\tachyon.bat. Finally, set the maximum number of resources to use to 9999, as shown in Figure 18:

    Figure 18

    Creating the MPI task in the job

  8. Click the ResourceSelection option, check the Run this job only on nodes that are members of all the following groups checkbox, and then add a group containing Windows Azure nodes, as shown in Figure 19:

    Figure 19

    Selecting node groups for the job

    Note:
    In your HPC cluster, the name of the Windows Azure node group may differ.
  9. Click the Environment Variables option, click the Add button, and then add an environment variable named CCP_MPI_NETMASK with the value of 0.0.0.0/0.0.0.0, as shown in Figure 20:

    Figure 20

    Adding an environment variable

  10. Click the Submit button to start the job.
  11. While the job is running, enter the Job Management section, select the tachyon job from the list of active jobs, and click on View Job… in the Actions pane, as shown in Figure 21:

    Figure 21

    Viewing the tachyon job

  12. Once the job is complete, open Internet Explorer and browse to the output file in your blob storage. The URL for the file should be as follows: https://YourStorageAccount.blob.core.windows.net/tachyonout/stmvao-white_short.bmp (replace the YourStorageAccount prefix with the name of your storage account, as you defined it in the AzureBlobCopy configuration file).
  13. You should now see the generated image from the job, as shown in Figure 22:

    Figure 22

    The BMP image result of tachyon.exe, as viewed from a Windows Azure blob account via Internet Explorer