Last active
October 5, 2016 08:40
-
-
Save julianthome/161e6734c36611fcf03c91c9f76ebd5a to your computer and use it in GitHub Desktop.
Revisions
-
Julian Thomé revised this gist
Oct 5, 2016 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,9 +6,6 @@ export FINALRES="result" export WPSIZE=5 export JOBLOG="joblog" function getfiles() { find ./* -name "*.txt" } @@ -24,7 +21,11 @@ function worker() { # make function worker known to gnu parallel export -f worker if [ ! -e "${JOBLOG}" ]; then getfiles | parallel --joblog "${JOBLOG}" -n"${WPSIZE}" -j +0 worker >> "${FINALRES}" else getfiles | parallel --resume --joblog "${JOBLOG}" -n"${WPSIZE}" -j +0 worker >> "${FINALRES}" fi echo "all jobs are finished" -
Julian Thomé revised this gist
Oct 2, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ function worker() { exit 0 } # make function worker known to gnu parallel export -f worker getfiles | parallel --joblog "${JOBLOG}" -n"${WPSIZE}" -j +0 worker >> "${FINALRES}" -
Julian Thomé revised this gist
Oct 2, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function getfiles() { find ./* -name "*.txt" } function worker() { [ ${#@} -eq 0 ] && exit 0 for fil in "${@}"; do echo "process $fil" -
Julian Thomé revised this gist
Oct 2, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ # gnu parallel export FINALRES="result" export WPSIZE=5 export JOBLOG="joblog" # setup fifos and files [ ! -e "${FINALRES}" ] && touch "${FINALRES}" -
Julian Thomé revised this gist
Oct 2, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/bin/bash # make variables available in function started by # gnu parallel export FINALRES="result" export WPSIZE=5 export JOBLOG="z3.log" -
Julian Thomé revised this gist
Oct 2, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ function getfiles() { function worker () { [ ${#@} -eq 0 ] && exit 0 for fil in "${@}"; do echo "process $fil" done exit 0 } -
Julian Thomé created this gist
Oct 2, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/bin/bash # make variables available in function started by # gnu semaphore export FINALRES="result" export WPSIZE=5 export JOBLOG="z3.log" # setup fifos and files [ ! -e "${FINALRES}" ] && touch "${FINALRES}" function getfiles() { find ./* -name "*.txt" } function worker () { [ ${#@} -eq 0 ] && exit 0 for fil in "${@}"; do echo "process $fil" done exit 0 } # make function worker known to gnu semaphore export -f worker getfiles | parallel --joblog "${JOBLOG}" -n"${WPSIZE}" -j +0 worker >> "${FINALRES}" echo "all jobs are finished" exit 0