Skip to content

Profiling PySlurm

Giovanni Torres edited this page Aug 19, 2017 · 2 revisions

In order to see how pyslurm was performing it was profiled following the [Cython Profiling] (http://docs.cython.org/src/tutorial/profiling_tutorial.html) instructions with 10k+ jobs in the queue but on a quiet server. The script used was a modified jobs_list.py but without the python display function call :

   Mon Dec 12 17:33:25 2011    profile_tmp

     289896 function calls in 0.304 CPU seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   109956    0.118    0.000    0.118    0.000 pyslurm.pyx:1997(__get_select_jobinfo)
        1    0.088    0.088    0.264    0.264 pyslurm.pyx:1886(__get)
    49980    0.042    0.000    0.042    0.000 slurm.pxd:41(listOrNone)
        1    0.024    0.024    0.024    0.024 pyslurm.pyx:1850(__load)
        1    0.014    0.014    0.304    0.304 <string>:1(<module>)
   119952    0.010    0.000    0.010    0.000 slurm.pxd:46(stringOrNone)
     9996    0.005    0.000    0.005    0.000 pyslurm.pyx:3601(__get_licenses)
        1    0.002    0.002    0.002    0.002 pyslurm.pyx:1778(__destroy)
        1    0.000    0.000    0.287    0.287 jobs_list.py:42(main)
        1    0.000    0.000    0.287    0.287 pyslurm.pyx:1874(get)
        1    0.000    0.000    0.287    0.287 {method 'get' of 'pyslurm.pyslurm.job' objects}
        1    0.000    0.000    0.002    0.002 pyslurm.pyx:1775(__dealloc__)
        1    0.000    0.000    0.000    0.000 {len}
        1    0.000    0.000    0.000    0.000 pyslurm.pyx:2070(__cpus_allocated_on_node)
        1    0.000    0.000    0.000    0.000 pyslurm.pyx:1766(__cinit__)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}

So a summary of the times is approximately :

  • 0.024 seconds to load (__load) slurm job data
  • 0.264 seconds to retrieve the (__get) slurm data from C data structures and convert to Python data types
  • 0.118 seconds for the __get_select_jobinfo routine called by the get method - hopefully this can be improved
Clone this wiki locally