This guide outlines the workflow for effectively utilizing the CHPC resources at the University of Utah. It covers setting up your environment, connecting to CHPC, managing interactive sessions, and tips for efficient computation.
-
Log in to the CHPC User Portal:
- Navigate to https://www.chpc.utah.edu/role/user/edit_profile.php.
- Enter your UNID and password to log in.
-
Change Your Shell:
- Locate the "Shell in General Environment" option.
- Select "/bin/bash" from the dropdown menu.
- Click "Submit" to save your changes.
-
SSH URL Format:
- Use the following format to connect to CHPC clusters:
ssh unid@cluster[1,2].chpc.utah.edu
- Replace
unid
with your University of Utah ID. - Replace
cluster
with the name of the cluster you wish to access (e.g.,ash
ornotch
). - Optionally, specify
1
or2
to connect to a specific cluster (e.g.,cluster1
orcluster2
).
- Replace
- Use the following format to connect to CHPC clusters:
-
Examples:
- Connect to the default cluster (load balancer will assign you to the preferred cluster):
ssh [email protected]
- Connect to a specific cluster (e.g.,
cluster1
):ssh [email protected]
- Connect to the default cluster (load balancer will assign you to the preferred cluster):
-
GUI Alternative:
- For users who prefer a graphical interface, FastX is available. Visit https://www.chpc.utah.edu/ for more information.
-
Windows Users:
- Enable OpenSSH Client (built into Windows 10 and later).
- Alternatively, download and use PuTTY or FastX.
-
Open the Bash Profile:
- Use
nano
to edit your~/.bashrc
file:nano ~/.bashrc
- Use
-
Add the Interactive Helper Function:
- Scroll to the bottom of the file and paste the following function:
interactive ()
{
local DEFAULT_ARGS=(--account="$1" --partition="$2" --nodes=1 --ntasks-per-node=1 --cpus-per-task=4 --mem=64G --time="$3" --gres=gpu:l40s:1);
local EXTRA_ARGS=();
for ((i=1; i<=$#; i++))
do
if [[ "${!i}" == "--" ]]; then
EXTRA_ARGS=("${@:((i+1))}");
break;
fi;
done;
declare -A arg_map;
for arg in "${DEFAULT_ARGS[@]}";
do
key="${arg%%=*}";
arg_map["$key"]="$arg";
done;
for extra_arg in "${EXTRA_ARGS[@]}";
do
key="${extra_arg%%=*}";
arg_map["$key"]="$extra_arg";
done;
local final_args=();
for arg in "${!arg_map[@]}";
do
final_args+=("${arg_map[$arg]}");
done;
if [ -z ${DEBUG+x} ]; then
salloc "${final_args[@]}";
else
echo "salloc ${final_args[@]}";
fi
}
-
Save and Exit:
- Press
Ctrl + O
to save. - Press
Ctrl + X
to exit.
- Press
-
Apply Changes:
- Reload your Bash profile:
source ~/.bashrc
- Reload your Bash profile:
- Persistent Sessions: Tmux allows you to detach and reattach to your session, making it ideal for long-running jobs.
- Multiple Windows/ Panes: Tmux supports multiple windows and panes for organizing your workflow.
-
Create a New Session:
tmux new -s my_session
- Replace
my_session
with a meaningful name for your session.
- Replace
-
Detach from the Session:
- Press
Ctrl + B
, thenD
to detach.
- Press
-
Reattach to the Session:
tmux attach -t my_session
-
Inside a Tmux Session:
- Ensure you are inside your tmux session before requesting an interactive session.
-
Request Resources:
- Use the
interactive
function to request an interactive session:interactive my_account main_partition 01:00:00
- Replace:
my_account
with your CHPC account name.main_partition
with the partition (queue) you want to use.01:00:00
with your desired walltime inHH:MM:SS
format.
- Replace:
- Use the
-
Customize Resource Requests (Optional):
- Override default arguments by adding extra parameters:
interactive my_account main_partition 01:00:00 -- --nodes=2 --mem=128G
- Override default arguments by adding extra parameters:
-
Additonal Usage Instructions (Optional):
- See additional usage instructions here: https://gist.github.com/richbai90/a6f28ef8257335b38f89d3af07bb174a
-
Detach from Tmux Session:
- Press
Ctrl + B
, thenD
to detach from your tmux session.
- Press
-
Reattach Later:
- Reattach to your session when you are ready to resume work:
tmux attach -t my_session
- Reattach to your session when you are ready to resume work:
- Use
squeue -u unid
to monitor your job status. - Use
sacct
to view historical job information.
- Home Directory:
/uufs/chpc.utah.edu/common/home/unid
- Scratch Space: plan to use
/scratch
for temporary storage.
- Visit the CHPC Documentation for more resources.
- Contact CHPC support at [email protected].
By following this guide, you can efficiently utilize CHPC resources for your computational needs.