HPC Grid tutorial: How to run PyCharm OnDemand

How to run PyCharm OnDemand

  1. You must have an account to access the Grid. Submit a ticket to request a new account.
  2. To connect to the Grid OnDemand, you must use the Wayne State University Virtual Private Network (VPN). If you do already have the VPN configured, download and set up Palo Alto GlobalProtect to connect. Note: If you have a desktop with a static IP, you can request to have it approved by emailing us at hpc@wayne.edu.
  3. Open a browser window for Chrome or Firefox (OnDemand is only supported through these browsers) and go to ondemand.grid.wayne.edu.

    Image

  4. On the homepage, click Login to OnDemand. You will be prompted with a login window. Enter your AccessID and password. Click Sign In.

    Image

  5. You should now be logged on to the OnDemand dashboard. Go to the Interactive Apps menu and select PyCharm.

    Image

    Image

    Image

  6. Adjust the default options if desired and click Launch. Note: More is not always better, e.g. higher core count systems often have slower CPU core speeds. If your application is unable to utilize multiple threads, it will be a waste of resources and run your application on slower cores.

    Image


  7. Wait for your resources to be allocated. Once the job starts, the button Launch PyCharmwill appear. Click Launch PyCharm. A new tab will open launching PyCharm.


    Image

    Image


How to create a PyCharm project

The first time you run PyCharm you need to configure the PyCharm interpreter with python 3.7 because PyCharm defaults to the Grids base interpreter.

  1. On the welcome screen, select New Project.

    Image

  2. Set the interpreter type to Custom environment. The first time you launch PyCharm, set the environment to Generate new, set the type to Virtualenv, and set the base python to /usr/bin/python3.6. Once this is done, click Create. Note: Despite it saying the base python is 3.6, it will update to the 3.7 interpreter.

    Image

  3. Now that 3.7 is configured, for future projects please choose the Custom environment interpreter, and set the environment to Select existing. There you will be able to select Python 3.7.3 for your python path. Lastly, select Create.Image

How to create a python file in a PyCharm project

  1. In the Project tool window, right-click the root project folder. Click New and then click Python File.

    Image

  2. Enter the name of your python file and start coding.

    Image

    Image

How to open an existing project

There are two ways to open an existing project.

  1. Click a recent project displayed on the welcome screen or;

    Image

  2. Click Open, open your project path, click Ok, and then click Trust Project.

    Image

    Image


How to use Conda Environment in PyCharm Project

  1. List all of your Conda environments on the grid with the command Conda info --envs and then copy the directory you want.


Image

  1. On the welcome screen, select New Project.
  2. Set the interpreter type to Custom environment, set the environment to Select existing, and set the type to Python, and then paste the Conda environment path you copied into the python path and add /bin/python to the end of it. Click Create.

    Image