3
$\begingroup$

I would like to write a Compiled function which is listable only in the first argument, because this allow fast and easy parallelization. How is it possible to do it?

In the following way it does not work

Compile[{{tt, _Real, 0}, {eVal0, _Complex, 1}, {eVec0, _Complex, 
   2}, {nf, _Integer, 0}, {dx, _Real, 0}},(...),CompilationTarget -> "C", RuntimeOptions -> "Speed",RuntimeAttributes -> {Listable}, Parallelization -> True]
$\endgroup$
2
  • $\begingroup$ Probably, this gets solved by increasing the ranks of all the other argument arrays by 1. But it is hard to say without a concrete example. $\endgroup$ Commented Jul 6, 2018 at 10:22
  • $\begingroup$ I would very much like to answer this question, but as Henrik too, I'm not sure I understand the problem of the OP. In general, you can use a listable, compiled function and call it in a way that it is only parallelized for one argument. But to be certain, we need a concrete example and more information. $\endgroup$
    – halirutan
    Commented Jul 16, 2018 at 12:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.