RRZE-HPC / pylikwid

Python interface for the LIKWID C API (https://github.com/RRZE-HPC/likwid)
GNU General Public License v2.0
43 stars 13 forks source link

getclock() always returns zero? #15

Open carstenbauer opened 3 years ago

carstenbauer commented 3 years ago

https://github.com/RRZE-HPC/pylikwid/blob/master/pylikwid.c#L861:

static PyObject *
likwid_getClock(PyObject *self, PyObject *args)
{
    TimerData timer;
    uint64_t start,stop;
    if (!PyArg_ParseTuple(args, "KK", &start, &stop))
    {
        Py_RETURN_NONE;
    }
    if (timer_initialized == 0)
    {
        timer_init();
        timer_initialized = 1;
    }
    return Py_BuildValue("d", timer_print(&timer));
}

Unless I'm overlooking something this function doesn't even use the input arguments start and stop in timer_print and, depending on the initialization of TimerData, will always return zero.

Same for likwid_getClockCycles.