How to Setup PyCharm?
How to setup PyCharm for KUACC HPC Cluster
Apply for professional account.
Download PyCharm Professional and install PyCharm on your laptop.
Note: Choose Professional version.
PyCharm Setup
First, you need to connect HPC cluster and add a preferred anaconda version with a virtual environment if you have one into /kuacc/users/username/.bashrc file.
vi /kuacc/users/username/.bashrc
module load anaconda/3.21.05
source activate virt_name
Then, reserve a node by salloc command.
salloc -A users -p mid--qos=users -c 4 --gres=gpu:1 --mem=64G --time=1-00 -w be12
By this command, a compute node is reserved with 64GB RAM, 4cores, one gpu for one day.
By w parameter, you can pick your node. If you pick a node, you won’t need to setup everytime you use PyCharm.
You can change slurm parameters by your needs. Please check HPC Cluster documents.
You need to keep terminal ope while you are working with PyCharm.
Find IP address of compute node on login. If you don’t choose a specific node, you also need to check which node was reserved.
squeue -u username
cat /etc/hosts|grep computename
Exp:
cat /etc/hosts|grep be12
172.20.242.112 be12 be12.kuacc.ku.edu.tr
After you reserve a compute node, open PyCharm.
Open All Settings under Customize
Open Python Interpreter
Check Settings icon next to Python Interpreter and choose “Add..”
In “Add Python Interpreter” window, choose “SSH Interpreter
Write Host=compute Node IP, your username and hit “Next”
Accept ssh key and continue.
Write your password and hit “Next”.
-In Add Python Interpreter window, choose python in selected anaconda folder. (/kuacc/apps/anaconda/version/bin/python)
Then,hit Finish.
On Settings screen, Python Interpreter will be as follows.
Then, hit “New Project” button and create new project with previously configured interpreter.
Please choose a project location in your KUACC home. Your codes will be stored in this location. Hit Create
Project will be as seen in screen shot.
You can see compute node settings at “External Libraries” Tab.
If you run default code, you can check if the setup is working. “Hi, PyCharm” message is seen on Run screen.