Your First Job - vsevolod-ivanov/Ivanov-Group-Wiki GitHub Wiki
Before you begin, make sure you can log into TinkerCliffs and have access to the group compute and storage allocation. If you do not have access, send an email to the Professor. Also, it might be very helpful to read the tutorials on Unix and the Slurm job manager.
(Method 1). You can create the file directly using VIM (It may be helpful to do the VIM tutorial first):
vim test_job.sh
Press the "i" key and write the following lines:
#!/bin/bash
#SBATCH -J hello-world
#SBATCH --account=vtqm
#SBATCH --partition=dev_q
#SBATCH --nodes=1 --ntasks-per-node=1 --cpus-per-task=1 # this requests 1 node, 1 core.
#SBATCH --time=0-00:10:00 # 10 minutes
echo "The job worked!"
hostname
Now, press the "ESC" key and type ":wq" to save the file.
(Method 2). First, transfer the "test_job.sh" file to the cluster (you'll have to enter your password). You can do this using Globus or with the scp command. To use the scp command, open terminal (or cmd), and navigate to the directory (here the Downloads folder is used) where you downloaded the file using the command "cd." Make sure to replace with your own username!
cd Downloads
scp test_job.sh <username>@tinkercliffs1.arc.vt.edu:/home/<username>/
Log in, and use the "ls" command to check that the "test_job.sh" file is in your Home directory:
ssh <username>@[email protected]
ls –al
(Method 3). Alternatively, you can get the file from the group directory on TinkerCliffs:
cp /projects/vtqm/Examples/test_job.sh .
ls –al
Make a work directory and put the job into it:
mkdir work
mv test_job.sh work
cd work
Submit the job into the queue so that it runs, and check to see your running jobs:
sbatch test_job.sh
squeue --me
List the files in the directory, and then see what's inside your output file (you will have to replace ### with the number of the slurm file that will appear in the directory):
ls
cat slurm ###.out
If you see the phrase "The job worked!" then you were successful!