On Sun, 21 Nov 2010, Vasiliy Kulikov wrote:

> Hi,
> 
> Is there any way to distribute spatch between 2+ CPU cores?  If I do
> "spatch -dir" then it runs on one core.  The solution - get the list
> of files and distribute it between 2+ independend instances of spatch
> "cat list1 | xargs spatch -sp_file xxx.cocci" - works _very_ slow,
> much slower than even one instance of spatch -dir .

There is a program spatch_linux.c to do that in the tools/distributed 
directory.  Kees Cook posted the following a little while ago:

#!/bin/bash
set -e
MAX=$(getconf _NPROCESSORS_ONLN)
dir=$(mktemp -d)
for i in $(seq 0 $(( MAX - 1 )) ); do
    spatch -max $MAX -index $i -very_quiet "$@" > $dir/$i.out &
done
wait
cat $dir/*.out
rm -f $dir/*.out
rmdir $dir


You might not want to use the -very_quiet option and instead put the 
standard error in a file.

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to