In this tutorial, you will run XStata on SLURM. Make sure you have FastX open and are logged in to one of the fx nodes, see Getting Started with Slurm Interactive Jobs.
To run interactive jobs, we have use the srun
command to log in to an interactive job node. You can see what nodes are available using sinfo
:
For GPU tasks, you should use one of the gpu nodes as shown on the left column: either comp7gpu1 or turingvm. You can specify what node to use using the --nodelist=comp7gpu1
parameter in srun
.
For now, we will not request a specific node.
srun --pty --mem=8gb --time=1:00:00 --cpus-per-task=1 --nodes=1 /bin/bash
srun
: Command to submit a job to the Slurm scheduler.--pty
: Allocate a pseudo-terminal for interactive job execution.--mem=8gb
: Request 8 gigabytes of memory for the job.--time=1:00:00
: Set a time limit of 1 hour for the job’s execution.--cpus-per-task=1
: Request 1 CPU core per task.--nodes=1
: Request 1 compute node for the job./bin/bash
: Execute the Bash shell as the job’s command.
You will see that you are logged in to one of the interactive nodes.
Check what modules are installed:
module av
# OR
# module avail
To load XStata, type in the following command:
module load xstata-se/17.0
Now run the following command to load XStata:
xstata
Running Stata code
You can type in the code in the command line at the bottom of the window. Press “Enter” to execute the code.
The code executes successfully. It also shows up on the left under Commands. In this way, you can chain commands and create a program. For larger, more complicated programs, we recommend creating a .do script and importing that in XStata.