From c54c38c5bf48ef06b7c0bc425299ad6b529e71bc Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 1 Sep 2015 10:23:50 -0400 Subject: [PATCH] simplify indent script - find can filter by extension - xargs does parallel invocation - fair grouping improves performance --- contrib/utilities/indent | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/contrib/utilities/indent b/contrib/utilities/indent index c9e299a6e9..ca5c34f32f 100755 --- a/contrib/utilities/indent +++ b/contrib/utilities/indent @@ -40,17 +40,9 @@ fi -# loop over all directories in which we may have source files; -# collect a list of files and then spawn a parallel process to -# indent all of them +# collect all header and source files and process them in batches of 50 files +# with up to 10 in parallel echo "--- Indenting all deal.II header and source files" -for dir in tests include/deal.II/* source/* examples ; do - files=`find $dir | egrep '\.(cc|h)$'` ; - if test -n "$files" ; then - (astyle --options=contrib/utilities/astyle.rc $files ) & - fi -done - -# now wait for all of these processes to finish -wait + +find tests include source examples \( -name '*.cc' -o -name '*.h' \) -print | xargs -n 50 -P 10 astyle --options=contrib/utilities/astyle.rc -- 2.39.5