On 02/03/16 14:04, Colin Cotter wrote:
Just to translate this more meaningfully, I think Lawrence at some point implemented an optional argument to pass a path to a C library to link against when compiling a kernel - maybe on a branch, it would be good if this could make it into the trunk version (Ali reports that it isn't).
It already works. Quoth the documentation:
Documentation for parloops.par_loop:
par_loop(kernel, measure, args, **kwargs)
A :func:`par_loop` is a user-defined operation which reads and writes :class:`.Function`\s by looping over the mesh cells or facets and accessing the degrees of freedom on adjacent entities.
:arg kernel: is a string containing the C code to be executed. :arg measure: is a UFL :class:`~ufl.measure.Measure` which determines the manner in which the iteration over the mesh is to occur. Alternatively, you can pass :data:`direct` to designate a direct loop. :arg args: is a dictionary mapping variable names in the kernel to :class:`.Function`\s or components of mixed :class:`.Function`\s and indicates how these :class:`.Function`\s are to be accessed. :arg kwargs: additional keyword arguments are passed to the :class:`~pyop2.op2.Kernel` constructor
So you can pass any additional arguments to your kernel by passing kwargs: par_loop(..., ldargs=["list" "of "things" "for" "the" "linker"]) Lawrence