Bugfix: --eta/--progress with 0 jobs gave division by zero.

Bugfix in Makefile by Piotr Jaroszyński <p dot jaroszynski at gmail dot com>
This commit is contained in:
Ole Tange 2010-08-26 20:03:59 +02:00
parent 0541bdf9ce
commit b26dbadcc0
7 changed files with 46 additions and 49 deletions

View file

@ -64,8 +64,8 @@
'AM_SET_LEADING_DOT' => 1, 'AM_SET_LEADING_DOT' => 1,
'AM_SET_DEPDIR' => 1, 'AM_SET_DEPDIR' => 1,
'_AM_DEPENDENCIES' => 1, '_AM_DEPENDENCIES' => 1,
'm4_include' => 1,
'AM_PROG_INSTALL_SH' => 1, 'AM_PROG_INSTALL_SH' => 1,
'm4_include' => 1,
'_AC_AM_CONFIG_HEADER_HOOK' => 1, '_AC_AM_CONFIG_HEADER_HOOK' => 1,
'AU_DEFUN' => 1, 'AU_DEFUN' => 1,
'AM_MAKE_INCLUDE' => 1 'AM_MAKE_INCLUDE' => 1
@ -83,25 +83,25 @@
'configure.ac' 'configure.ac'
], ],
{ {
'AM_PROG_F77_C_O' => 1,
'_LT_AC_TAGCONFIG' => 1, '_LT_AC_TAGCONFIG' => 1,
'AC_INIT' => 1, 'AM_PROG_F77_C_O' => 1,
'm4_pattern_forbid' => 1, 'm4_pattern_forbid' => 1,
'AC_CANONICAL_TARGET' => 1, 'AC_INIT' => 1,
'_AM_COND_IF' => 1, '_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1, 'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1, 'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1, 'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1, 'AC_FC_SRCEXT' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_PROG_LIBTOOL' => 1, 'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1, 'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1, 'AC_CONFIG_SUBDIRS' => 1,
'AM_AUTOMAKE_VERSION' => 1, 'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1, 'LT_CONFIG_LTDL_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_REQUIRE_AUX_FILE' => 1, 'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1, 'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1, 'm4_sinclude' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_MAINTAINER_MODE' => 1, 'AM_MAINTAINER_MODE' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'_m4_warn' => 1, '_m4_warn' => 1,
@ -114,17 +114,17 @@
'include' => 1, 'include' => 1,
'AM_GNU_GETTEXT' => 1, 'AM_GNU_GETTEXT' => 1,
'AC_LIBSOURCE' => 1, 'AC_LIBSOURCE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1, 'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_BUILD' => 1,
'AC_FC_FREEFORM' => 1, 'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1, 'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1, '_AM_SUBST_NOTMAKE' => 1,
'AM_PROG_CC_C_O' => 1, 'AC_CONFIG_AUX_DIR' => 1,
'm4_pattern_allow' => 1,
'sinclude' => 1, 'sinclude' => 1,
'AM_CONDITIONAL' => 1, 'm4_pattern_allow' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_CANONICAL_SYSTEM' => 1, 'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
'AC_CONFIG_HEADERS' => 1, 'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1,
'm4_include' => 1, 'm4_include' => 1,

View file

@ -1,3 +1,6 @@
Bugfix: --eta/--progress with 0 jobs gave division by zero.
Bugfix in Makefile by Piotr Jaroszyński <p dot jaroszynski at gmail dot com>
fex syntax for splitting fields fex syntax for splitting fields
http://www.semicomplete.com/projects/fex/ http://www.semicomplete.com/projects/fex/
sql :foo 'select * from bar' | parallel --fex '|{1,2}' do_stuff {2} {1} sql :foo 'select * from bar' | parallel --fex '|{1,2}' do_stuff {2} {1}

View file

@ -98,32 +98,8 @@ download at: http://ftp.gnu.org/gnu/parallel/
New in this release: New in this release:
* Counting semaphore functionality: start a job in the background. If * First community generated bugfixes
N jobs are already running, wait for one to complete. Examples: Piotr Jaroszyński <p.jaroszynski@gmail.com>
sem 'sleep 2; echo foo'; sem 'sleep 1; echo bar'; sem --wait
sem -j2 'sleep 2; echo foo'; sem -j2 'sleep 1; echo bar'; sem --wait
* With --colsep a table can be used as input. Example:
cat tab_sep_table | parallel --colsep '\t' echo col1 {1} col2 {2}
* --trim can remove white space around arguments.
* --sshloginfile '..' means use ~/.parallel/sshloginfile
* Zero install package. Thanks to Tim Cuthbertson <tim3d dot junk at
gmail dot com>
* OpenSUSE package. Thanks to Markus Ammer <mkmm at gmx-topmail dot
de>
* NixOS package. Thanks to Ludovic Courtès <ludo at gnu dot org>
* Web review http://oentend.blogspot.com/2010/08/gnu-parallel.html
Thanks to Pavel Nuzhdin <pnzhdin at gmail dot com>
* Web review http://psung.blogspot.com/2010/08/gnu-parallel.html
Thanks to Phil Sung <psung at alum dot mit dot edu>
= About GNU Parallel = = About GNU Parallel =

View file

@ -453,14 +453,14 @@ sem.1: sem.pod Makefile
parallel.html: parallel Makefile parallel.html: parallel Makefile
pod2html $(srcdir)/parallel > $(srcdir)/parallel.html pod2html $(srcdir)/parallel > $(srcdir)/parallel.html
rm $(srcdir)/pod2htm* rm -f $(srcdir)/pod2htm*
sem.html: sem.pod Makefile sem.html: sem.pod Makefile
pod2html $(srcdir)/sem.pod > $(srcdir)/sem.html pod2html $(srcdir)/sem.pod > $(srcdir)/sem.html
rm $(srcdir)/pod2htm* rm -f $(srcdir)/pod2htm*
sem: parallel sem: parallel
ln -s parallel sem ln -fs parallel sem
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View file

@ -3458,13 +3458,15 @@ sub progress {
$status = $eta . $status = $eta .
join(" ",map join(" ",map
{ {
my $completed = ($Global::host{$_}{'completed'}||0); if($Global::total_started) {
my $running = $Global::host{$_}{'no_of_running'}; my $completed = ($Global::host{$_}{'completed'}||0);
my $time = $completed ? (time-$^T)/($completed) : "0"; my $running = $Global::host{$_}{'no_of_running'};
sprintf("%s:%d/%d/%d%%/%.1fs ", my $time = $completed ? (time-$^T)/($completed) : "0";
$sshlogin{$_}, $running, $completed, sprintf("%s:%d/%d/%d%%/%.1fs ",
($running+$completed)*100 $sshlogin{$_}, $running, $completed,
/ $Global::total_started, $time); ($running+$completed)*100
/ $Global::total_started, $time);
}
} @workers); } @workers);
} }
if(length $status > $termcols) { if(length $status > $termcols) {

View file

@ -3,5 +3,11 @@
echo '### Test of --eta' echo '### Test of --eta'
seq 1 10 | stdout parallel --eta "sleep 1; echo {}" | wc -l seq 1 10 | stdout parallel --eta "sleep 1; echo {}" | wc -l
echo '### Test of --eta with no jobs'
stdout parallel --eta "sleep 1; echo {}" < /dev/null
echo '### Test of --progress' echo '### Test of --progress'
seq 1 10 | stdout parallel --progress "sleep 1; echo {}" | wc -l seq 1 10 | stdout parallel --progress "sleep 1; echo {}" | wc -l
echo '### Test of --progress with no jobs'
stdout parallel --progress "sleep 1; echo {}" < /dev/null

View file

@ -1,4 +1,14 @@
### Test of --eta ### Test of --eta
16 16
### Test of --eta with no jobs
Computers / CPU cores / Max jobs to run
1:local / - / 9
### Test of --progress ### Test of --progress
16 16
### Test of --progress with no jobs
Computers / CPU cores / Max jobs to run
1:local / - / 9