1. Introduction

This document is intended for Techila End-Users who are using R as their main development environment. This document contains a minimal amount information that should allow you to run your first R computations.

For more information about the Techila R API and walkthroughs of example material, please see document Techila Distributed Computing Engine with R.

2. Setup

This Chapter contains instructions for installing the R packages required to use Techila Distributed Computing Engine with R.

Note! In order to complete the configuration, you will need the following on your computer:

  • Java Development Kit (JDK) or Java Runtime Environment (JRE) (version 6 or newer)

Steps:

  1. Extract the previously downloaded TechilaSDK.zip to your computer, e.g. to your home directory.

    When extracted, the TechilaSDK.zip file will create a directory called 'techila' with the folder structure illustrated in the example screenshot below. In this example, the TechilaSDK.zip file was extracted to 'C:\'.

    matlab1
  2. Create an environment variable TECHILA_SDKROOT and set the value to point to the 'techila' directory. For example, if the 'techila' directory is located in C:\techila, then set the value to 'C:\techila'.

  3. Launch R

  4. In R, Change your current working directory to techila/lib/R in the Techila SDK.

  5. Execute following commands to install the R.Utils, rJava andd techila packages:

    install.packages("R.utils")
    install.packages("rJava")
    install.packages("techila", type = "source", repos = NULL, INSTALL_opts = "--no-multiarch")

    After executing the commands, the output should resemble the one shown below:

    r1
  6. Execute the following commands in R to test the network connection to the Techila Server:

    library(techila)
    init()

    If the network connection test was successful, the function should return without generating errors. The output of the above commands is illustrated in the screenshot below.

    r2

3. Running Your First R Project in TDCE

The techila R package includes a cloudfor helper function, which can be used to execute computationally intensive operations in a TDCE environment.

More cloudfor examples can be found in the following chapter of the full guide.

Note! In order for cloudfor to work, you will need to define where the techila directory of the Techila SDK is located on your computer. This can be done by:

  • Creating an environment variable called TECHILA_SDKROOT and setting the value to point to the techila directory on your computer. Example: TECHILA_SDKROOT=/path/to/your/techila. Please note that you will need to restart your R session after defining the variable.

OR

  • Using the .sdkroot parameter to define where your techila directory is located.

After you have defined where the techila directory is located, you can run the code snippet below in your R environment to create a computational Project.

# Load the Techila package
library(techila)

  result <- cloudfor (i=1:10,
                      #.sdkroot="/path/to/your/techila", # If you are not using TECHILA_SDKROOT, uncomment this parameter and modify to point to your 'techila' directory
                      .steps=2 # Perform two iterations per Job
                     ) %t% {  # Start of code block that will be executed on Workers
      i * i # This operation will be performed on the Workers
  } # End of code block executed on Workers
}

4. Next Steps

Congratulations! At this point you should have been able to run your first computations in TDCE. Next, you can start modifying your own code to run in TDCE.

The document Techila Distributed Computing Engine with R contains additional examples and information about the Techila R API. This document can be used as reference on how to implement various features available in TDCE when modifying your own code.