Hello,


If what you want to measure happens to be the execution of a parloop kernel, since they are in C, you can just add the macros there. To modify generated code manually, locate the kernel in the PyOP2 disk cache, modify the C file, recompile the modified C file with the instructions in the .log file, which will create a .so.tmp file, which is to replace the .so file. Once you have done this, at the next execution Firedrake will pick up your manually modified .so file.


If this is not sufficient, you could use Cython to write a Python context manager which refers to the appropriate C macros in its __enter__ and __exit__ methods.


Regards,

Miklos


From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of Justin Chang <jychang48@gmail.com>
Sent: 23 August 2017 23:44:17
To: firedrake
Subject: [firedrake] Using Intel's SDE and VTune for Firedrake/Python
 
Hi guys,

I want to measure AI using the procedure described here on the NERSC website:

http://www.nersc.gov/users/application-performance/measuring-arithmetic-intensity/

Basically they obtain FLOPs from Intel's SDE and the bytes from VTune. And in their C code example, they inserted macros to indicate where to start and stop the measurements.

Does anyone here know how to do something similar for Python-based programs? Or if there's a "hack" to allow me to insert these C macros into the firedrake code somewhere?

Thanks,
Justin