C: Assignment to Test Setup

Warning

The TACC allocation for the bootcamp expired the first of the year. We are awaiting a request to TACC to activate the account for this year. In the meantime we have added you to an allocation we have on the TACC Stampede2 system. Changes to the instructions posted previously are minimal and only effect the ssh command.

Note

The purpose of this exercise is to ensure that you are all ready to start programming at the start of the C part of the course. Because we will be spending time on parallel programming and showing how best to use Tapis, you will be using the **Frontera** system and they provide a comprehinsive set of usage notes . The following is a brief overview of it with Linux commands for this workshop.

  1. Using git on a daily basis to update the code base.

  2. Using ssh to login to Frontera from your terminal.

  3. Using Linux commands once logged in as Frontera is a Linux system.

  4. Compiling C code and running the compiled application on Frontera.

The following is a list of items you need to perform. For those of you who followed our Python course, steps 1 and 2 are not needed.

  1. In your browser you need to sign up for github. If you have difficulties they have a page devoted to signing up

  2. After signing up and logging in, navigate in your browser to the SimCenterBottcamp2020 git page. At the website, click on the Fork, button at top right. This will create a fork of the repo under your own github username and take you to the main page for that repo.

  3. Now under the Code pull down menu on this new page, copy the https address into your clipboard.

  4. Install and then pair the TACC Token app on your phone. Instructions can be found at the TACC website

  5. Now we login to TACC. From Powershell terminal if on Windows10 or a terminal window if using MacOS, enter the following (replacing of course your DesignSafe account name with YOUR_NAME) and provide your designsafe login and the TACC token. For the TACC token open the TACC Token app you have installed on your phone.

    ssh YOUR_NAME@stampede2.tacc.utexas.edu
    
  6. Now let us clone the repo that you just forked on github. To do so type the following:

    git clone https://github.com/YOUR GIT LOGIN/SimCenterBootcamp2020.git
    
  7. This last command has created a new folder in your current directory named SimCenterBootcamp2020. We now want you to cd (change directory) into that directory. This is done by you typing the following:

    cd SimCenterBootcamp2020
    
  8. Now we want you to issue the following command, which will add a pointer, called upstream, to the master SimCenterBootcamp2020 repo that you forked:

    git remote add upstream https://github.com/NHERI-SimCenter/SimCenterBootcamp2020.git
    
  9. Now let us go back to your home folder. Here we will create a new folder named hello and get you to create your first C program in that folder.

    cd ~
    mkdir hello
    cd hello
    emacs hello.c
    
  10. The last command you issues, emacs starts one of the few editors available to you on Frontera and opens up a file named hello.c. We now want you to place in that file the following:

    #include <stdio.h>
    int main(int argc, char **argv) {
       printf("Hello World\n");
    }
    
  11. To save the file enter the following

    <Control> x <Control> s
    
  12. To quit emacs, enter now the following:

    <Control> x <Control> c
    
  13. Now we want you to compile the file to create an application called a.out. To do this type the following

    icc hello.c
    
  14. To test the code and be responsible users while doing so, we want you to start an interactive session on a compute node. To do this type the following:

    idev
    
  15. Once the session has started, you can run the application by typing the following:

    ./a.out
    
  16. Application should run and output “Hello World” to the screen. You are done and have succesfully compiled and run your first C program. To now exit the interactive environment and also exit your sesssion at TACC type the following:

    exit
    exit
    

Warning

  1. Your TACC login name is the same as your DesignSafe login. If you do not have one yet, you need to obtain one from their website.

  2. If you cannot log into Frontera, send us an email with your designsafe login as we have not added your login name to our allocation.

  3. If you have problems compiling the code, try and use the compiler messages to see what you did wrong.