parallel: tcsh does not allow 'nice -n19', so use full path for nice.

This commit is contained in:
Ole Tange 2011-11-15 01:15:23 +01:00
parent a1b5341afa
commit 4612f69097
5 changed files with 59 additions and 48 deletions

View file

@ -144,17 +144,17 @@ http://nd.gd/2j Watch the intro video http://nd.gd/0s
https://savannah.gnu.org/news/?group=parallel https://savannah.gnu.org/news/?group=parallel
# Obsolete: Now use @GnuParallel
# Only 350 requests per hour: 1 tweet = 3 requests # # Only 350 requests per hour: 1 tweet = 3 requests
# 119 tweets/hour = sleep 30 per tweet (40 to be safe) # # 119 tweets/hour = sleep 30 per tweet (40 to be safe)
# The above is not enough. # # The above is not enough.
# Went over the limit at number 132 (sleep 40) # # Went over the limit at number 132 (sleep 40)
# https://support.twitter.com/entries/15364-about-twitter-limits-update-api-dm-and-following # # https://support.twitter.com/entries/15364-about-twitter-limits-update-api-dm-and-following
# says 250 direct msg per day = 86400/250 = sleep 345 # # says 250 direct msg per day = 86400/250 = sleep 345
cat twitters | grep -iv removed | # cat twitters | grep -iv removed |
parallel -j1 sleep 354\; echo @{} You have shown interest in GNU Parallel. \ # parallel -j1 sleep 354\; echo @{} You have shown interest in GNU Parallel. \
New version: http://nd.gd/2j This is the last message: Follow @GnuParallel \ # New version: http://nd.gd/2j This is the last message: Follow @GnuParallel \
'|' ttytter # '|' ttytter
@ -182,49 +182,33 @@ cc:Sandro Cazzaniga <kharec@mandriva.org>,
Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>, Jesse Alama Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>, Jesse Alama
<jesse.alama@gmail.com> <jesse.alama@gmail.com>
Subject: GNU Parallel 20111022 ('Steve Ritchie') released Subject: GNU Parallel 20111122 ('Silvio') released
GNU Parallel 20111022 ('Steve Ritchie') has been released. It is GNU Parallel 20111122 ('Silvio') has been released. It is
available for download at: http://ftp.gnu.org/gnu/parallel/ available for download at: http://ftp.gnu.org/gnu/parallel/
New in this release: New in this release:
* --tag prepends lines with the argument(s). If used with --(n)onall * GNU Parallel package for Fedora.
the line will be prepended with the sshlogin instead. https://admin.fedoraproject.org/pkgdb/acls/name/parallel
* --shellquote does not run the command but quotes it using \'s. * GNU Parallel is now part of ppbs.
Useful for making quoted composed commands. http://physiology.med.cornell.edu/faculty/mason/lab/ppbs/introduction/introduction.html
* --profile can now be repeated merging multiple profiles. * Blog post in Polish.
http://blog.tiger.com.pl/2011/01/05/gnu-parallel/
* --bibtex now gives the BibTeX entry. * Blog post on using GNU Parallel of Mac OS X.
Thanks to Aleksandr Levchuk for testing. http://www.0xcb0.com/2011/10/19/running-parallel-bash-tasks-on-os-x/
* Makefile for simple .deb package. * Blog post in English about using zip with GNU Parallel.
cd packager/debian; make http://nuclear-imaging.info/site_content/2011/05/11/gnu-parallel/
* sql: --list-databases lists the databases. * Blog post in English by researcher.
http://zandyware.wordpress.com/2011/10/15/gnu-parallell-make-best-use-of-your-multicore-computer/
* GNU Parallel officially in Fedora 16 * Blog entry in Chinese.
http://www.spinics.net/lists/fedora-package-announce/msg67130.html http://blog.csdn.net/tossense/article/details/6889026
* Blog post on recompression FLAC audio.
http://blog.oxplot.com/2011/08/reflac-flac-cleanser.html
* The most complex use of ::: I a seen so far.
http://agentzlerich.blogspot.com/2011/09/following-up-on-previous-failures-ive.html
* Example of using GNU Parallel with sudo.
http://loopkid.net/articles/2011/10/07/recursive-chmod-and-chown-on-files
* Use wget and gnu parallel to download mp3s at rocket speed.
http://sdbrain.posterous.com/use-wget-and-gnu-parallel-to-download-mp3s-at
* First CV referring to GNU Parallel.
http://www.peopleperhour.com/freelancers/stephen_/internet_researcher_and_protocol_develop/140602
* Cartwright labs usage of GNU Parallel.
http://cartwrightlab.wikispaces.com/The+Most+Bang+for+Your+Buck
* Bug fixes and man page updates. * Bug fixes and man page updates.

View file

@ -502,7 +502,7 @@ sub get_options_from_array {
sub parse_options { sub parse_options {
# Returns: N/A # Returns: N/A
# Defaults: # Defaults:
$Global::version = 20111022; $Global::version = 20111115;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$Global::infinity = 2**31; $Global::infinity = 2**31;
$Global::debug = 0; $Global::debug = 0;
@ -3829,7 +3829,7 @@ sub len {
# Worse than worst case: every char needs to be quoted with \ # Worse than worst case: every char needs to be quoted with \
$len *= 2; $len *= 2;
} }
if($::opt_nice) { if($::opt_shellquote) {
# Pessimistic length if --shellquote is set # Pessimistic length if --shellquote is set
# Worse than worst case: every char needs to be quoted with \ twice # Worse than worst case: every char needs to be quoted with \ twice
$len *= 4; $len *= 4;
@ -3923,10 +3923,11 @@ sub replaced {
} }
} }
if($::opt_nice) { if($::opt_nice) {
# Prepend nice -n19 bash -c # Prepend nice -n19 $SHELL -c
# and quote # and quote
$self->{'replaced'} = "nice -n" . $::opt_nice $self->{'replaced'} = nice() ." -n" . $::opt_nice . " "
. " bash -c " . ::shell_quote_scalar($self->{'replaced'}); . $ENV{SHELL}." -c "
. ::shell_quote_scalar($self->{'replaced'});
} }
if($::opt_shellquote) { if($::opt_shellquote) {
# Prepend echo # Prepend echo
@ -3943,6 +3944,22 @@ sub replaced {
return $self->{'replaced'}; return $self->{'replaced'};
} }
sub nice {
# Returns:
# path to nice
# Needed because tcsh's built-in nice does not support 'nice -n19'
if(not $Global::path_to_nice) {
$Global::path_to_nice = "nice";
for my $n ((split/:/, $ENV{'PATH'}), "/bin", "/usr/bin") {
if(-x $n."/nice") {
$Global::path_to_nice = $n."/nice";
last;
}
}
}
return $Global::path_to_nice;
}
sub replace_placeholders { sub replace_placeholders {
my $self = shift; my $self = shift;
my $target = shift; my $target = shift;

View file

@ -3134,6 +3134,10 @@ make them by something like B<seq 1000000>>B<file>.
=back =back
If you suspect the error is dependent on your distribution, please see
if you can reproduce the error on one of these distibutions:
http://sourceforge.net/projects/virtualboximage/files/
=head1 AUTHOR =head1 AUTHOR

View file

@ -19,3 +19,6 @@ echo "$CHAR/$LINES" | bc
echo '### Bug before 2009-08-26 causing regexp compile error or infinite loop' echo '### Bug before 2009-08-26 causing regexp compile error or infinite loop'
echo a | parallel -qX echo "'"{}"' " echo a | parallel -qX echo "'"{}"' "
echo a | parallel -qX echo "'{}'" echo a | parallel -qX echo "'{}'"
echo '### nice and tcsh and Bug #33995: Jobs executed with sh instead of $SHELL'
seq 1 2 | SHELL=tcsh stdout parallel -k --nice 8 setenv a b\;echo \$SHELL

View file

@ -13,3 +13,6 @@ Chars per line: 116300
### Bug before 2009-08-26 causing regexp compile error or infinite loop ### Bug before 2009-08-26 causing regexp compile error or infinite loop
'a' 'a'
'a' 'a'
### nice and tcsh and Bug #33995: Jobs executed with sh instead of $SHELL
tcsh 1
tcsh 2