Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apachedex
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
apachedex
Commits
14e3c000
Commit
14e3c000
authored
Apr 09, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bash scripts for parallel execution.
parent
7521f4cf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
0 deletions
+47
-0
MANIFEST.in
MANIFEST.in
+2
-0
README
README
+4
-0
parallel_parse.sh
parallel_parse.sh
+34
-0
parallel_parse_helper.sh
parallel_parse_helper.sh
+7
-0
No files found.
MANIFEST.in
View file @
14e3c000
...
@@ -2,3 +2,5 @@ include README
...
@@ -2,3 +2,5 @@ include README
include TODO
include TODO
include COPYING
include COPYING
include apachedex/jquery*.js
include apachedex/jquery*.js
include parallel_parse.sh
include parallel_parse_helper.sh
README
View file @
14e3c000
...
@@ -170,6 +170,10 @@ For better performance...
...
@@ -170,6 +170,10 @@ For better performance...
wait
wait
apachedex "$@" --out access.html --state-file access.*.json
apachedex "$@" --out access.html --state-file access.*.json
If you have bash and have an xargs implementation supporting `-P`, you may
want to use `parallel_parse.sh` (which needs `parallel_parse_helper.sh`)
available in source distribution or from repository.
Notes
Notes
=====
=====
...
...
parallel_parse.sh
0 → 100755
View file @
14e3c000
#!/bin/sh
usage
()
{
echo
"Usage:"
echo
" find [...] -print0 |
$0
\\
"
echo
" path_to_helper parallelism state_dir out_file command [arg1 [...]]"
echo
"Reads filenames to process from stdin, null-delimited."
}
if
[
$1
=
'-h'
-o
$1
=
'--help'
]
;
then
usage
exit
0
fi
HELPER
=
$1
if
[
!
-x
"
$HELPER
"
]
;
then
echo
"
$HELPER
cannot be executed"
exit
1
fi
shift
PARALLELISM
=
$1
shift
STATE_DIR
=
$1
mkdir
-p
"
$STATE_DIR
"
||
exit
$?
shift
OUT_FILE
=
$1
shift
if
[
$#
-eq
0
]
;
then
usage
exit
1
fi
xargs
-0
-r
-n
1
-P
$PARALLELISM
-I
"@FILE@"
"
$HELPER
"
"@FILE@"
"
$STATE_DIR
"
"
$@
"
"
$@
"
--out
"
$OUT_FILE
"
--state-file
"
$STATE_DIR
"
/
*
parallel_parse_helper.sh
0 → 100755
View file @
14e3c000
#!/bin/bash
INFILE
=
$1
shift
STATE_DIR
=
$1
shift
echo
-n
'.'
exec
"
$@
"
-Q
--format
json
--out
"
$STATE_DIR
/
$(
sed
s:/:@:g
<<<
"
$INFILE
"
)
.json"
"
$INFILE
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment