-
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 open 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 the Add Python Interpreter window, choose Python in the selected Anaconda folder. (/kuacc/apps/anaconda/version/bin/python)
-
Then, hit Finish.
-
On the Settings screen, Python Interpreter will be as follows.
-
Then, hit the “New Project” button and create a new project with the previously configured interpreter.
-
Please choose a project location in your KUACC home. Your codes will be stored in this location. Hit Create
-
The project will be as seen in the screenshot.
-
You can see the compute node settings at the “External Libraries” Tab.
-
If you run the default code, you can check if the setup is working. “Hi, PyCharm” message is seen on the Run screen.