On Tue, Feb 03 2015, Julia Lawall <[email protected]> wrote:

> OK, I'm not sure to understand everything the script does, but could it be
> that you are passing all of the file names individually on the command
> line?   That is, are you trying to do something like
>
> spatch foo.cocci one.c two.c three.c four.c
>

Yes, that's how GNU parallel works (it's mostly xargs with lots of bells
and whistles), and the only way I could find to pass files to spatch
without letting it discover the files itself.

> If that is the case, then the memory usage is normal.  Putting
> multiple files on the command line means that you want them all to be
> handled at once.  For example, there may be some function in one.c
> whose properties should influence the transformation of four.c.  So it
> holds the parsed versions of all of the files in memory at once.

That kind of makes sense. But I would very much like an option to turn
off that behaviour, and make it process each file individually.

> Fortunately, we have finally implemented parallelism inside
> Coccinelle.  If you take version 1.0.0-rc24 from the web page, which I
> haven't had time to properly announce, you can use the argument -j NNN
> with spatch on a complete directory and it will work on the different
> files in parallel (with NNN instances).

Sounds good, but I think it would be nice with a somewhat more flexible
way of choosing the files to process, the most obvious being passing the
files explicitly, and for that an option as above seems to be absolutely
essential if one passes more than around 100 files. Moreover, I will
probably continue to use a wrapper script around spatch, to handle
tedious things such as passing appropriate -I options, extracting the //
Options: line etc. Handling the parallelism in that wrapper is then no
big deal.

Thanks,
Rasmus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to