Statistical software¶
This documentation page provides a comprehensive guide on how to use the software installed on our Kristiania-HPC. It also includes instructions for accessing the software on a Kristiania-HPC cluster via SSH.
1. Accessing Stata on HPC¶
Launch Stata¶
To run Stata in interactive mode:
stata
To run Stata in batch mode, create a .do
file and execute it:
stata -b do script.do
This will execute the commands in script.do
and save the output to script.log
.
Forward GUI for Stata (Optional)¶
If you want to use Stata’s graphical interface, enable X11 forwarding:
Install an X server on your local machine:
Connect to the HPC with X11 forwarding:
ssh -X username@hpc_server_ip
Launch Stata GUI:
xstata
2. Accessing RStudio on HPC¶
Set Up SSH Tunnel for RStudio¶
To securely access RStudio Server, create an SSH tunnel:
ssh -L 8787:localhost:8787 username@hpc_server_ip
Replace
username
with your HPC username.Replace
hpc_server_ip
with the HPC cluster’s IP address.
This forwards the HPC’s RStudio port (8787
) to your local machine.
Access RStudio in Your Browser¶
Open a web browser on your local machine.
Navigate to:
http://localhost:8787
Log in using your HPC credentials.
3. [Optional] Mounting HPC Storage to Your Local System¶
You can mount HPC storage to your local system for easy file access.
macOS¶
Install macFUSE:
Download and install from macFUSE.
Use
sshfs
to mount the HPC storage:brew install sshfs mkdir ~/hpc_mount sshfs username@hpc_server_ip:/path/to/hpc/storage ~/hpc_mount
Windows¶
Linux¶
Ensure
sshfs
is installed:sudo apt install sshfs
Mount the HPC storage:
mkdir ~/hpc_mount sshfs username@hpc_server_ip:/path/to/hpc/storage ~/hpc_mount
4. [Alternative to 3] Accessing Remote Folders Using VS Code
¶
You can use Visual Studio Code’s Remote - SSH extension to access HPC remote folders seamlessly.
Steps to Configure¶
Install VS Code:
Download and install Visual Studio Code from code.visualstudio.com.
Install the Remote - SSH Extension:
Open VS Code.
Go to the Extensions view (
Ctrl+Shift+X
orCmd+Shift+X
on macOS).Search for “Remote - SSH” and install the extension.
Configure SSH in VS Code:
Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
on macOS).Type “Remote-SSH: Add New SSH Host” and select it.
Enter the SSH command to connect to the HPC, e.g.:
ssh username@hpc_server_ip
Choose the SSH configuration file where this should be saved (usually
~/.ssh/config
).
Connect to the HPC:
Open the Command Palette.
Type “Remote-SSH: Connect to Host” and select your HPC entry.
A new VS Code window will open, connected to the HPC.
Access Remote Folders:
In the new window, use the File Explorer to browse and edit remote files.
For assistance, contact your HPC system administrator.