parallel processing in q function called from python

249 Views Asked by At

From q reference:

In order to execute in parallel, q must be started with multiple slaves, using -s in the command line, and the \s system command.

Is it possible to make use of peach in a q function which is called from pyq (python)?

from pyq import q
q('\l myscript.q')
q('foo[]')         / peach inside

I'm using Jupyter Notebook with pyq kernel.

1

There are 1 best solutions below

0
Alexander Belopolsky On

Is it possible to make use of peach in a q function which is called from pyq (python)?

Yes, when you start pyq, you can pass q options to the underlying q process after a special -- argument, so you can run pyq with say 4 slaves as follows:

pyq -- -s 4

I'm using Jupyter Notebook with pyq kernel

When using pyq kernel, you can specify q arguments in the kernel.json file. You can find the location of the kernel.json file using the following command:

jupyter kernelspec list | grep pyq

To specify 4 slaves, append "-s", "4" to the end of the "argv" list.