3.3. Exercises#

These exercises cover basic Linux and bash scripting skills.

3.3.1. Exercise 1#

First, log in to PACE ICE (VIP) or PACE Hive (grad students) using your GTID in your terminal of choice. Do not cheat this set of exercises by using a built-in file explorer such as Microsoft Visual Studio! You can learn more from the PACE documentation site (https://pace.gatech.edu/pace-user-documentation).

Next, create a folder called “Training” in scratch storage. Navigate to the Training folder and create a Python script file called “test.py” that prints the phrase “Hello world!” as below.

3.3.2. Exercise 2#

In your Training folder, create a bash script that submits your test Python script to the scheduler. Explicitly allocate one core and one node for 5 minutes. Specify an output file called “test.out” to save the results of running your Python file. Submit the job using the sbatch command and check to be sure your code printed “Hello world!” to “test.out”. As a reminder, you can check the status of a submitted job by running the command “squeue -u <GT USERNAME>” in the terminal.

3.3.3. Exercise 3#

In your Training folder, create a subdirectory called “Storage” and move your Python script into “Storage” using Linux commands. As a reminder, you can view the path to your current directory using the “pwd” (print working directory) command. Next, create a new Python script called “Example.py.” in the Storage subdirectory. There should be two Python scripts in this subdirectory at the end of this exercise. You do not need to write any code in Example.py.

3.3.4. Exercise 4#

Lastly, navigate to the root Training directory. Using only one block of Linux commands, navigate into the Storage subdirectory and delete all Python scripts. Check to ensure that you were successful. It is important that you delete both files using one set of commands. Do not individually delete each Python script; use bash loops instead!