Translations:Python/76/en

  1. Install py-spy in a virtualenv in your home
  2. Attach to the running job, using srun --pty --jobid JOBID bash
  3. Use htop -u $USER to find the process ID of your python script
  4. Activate the virtualenv where py-spy is installed
  5. Run py-spy top --pid PID to see live feedback about where your code is spending time
  6. Run py-spy dump --pid PID to get a traceback of where your code is currently at.