On Tue, 15 Nov 2011 00:47:35 +0100
Ole Tange <[email protected]> wrote:
> On Mon, Nov 14, 2011 at 6:48 PM, <[email protected]> wrote:
>
> > I have emailed the admin on that system, and apparently they
> > normally do have flock enabled, but after their latest reboot that
> > flag was not set for some reason. They'll fix that manually.
> >
> > I'll see what would work for a flock replacement, but I may not be
> > able to do it (time pressure). In the meantime, could parallel be
> > modified to not enter an infinite loop when flock returns ENOSYS?
>
> As you are the only one I know of who has this problem, it is probably
> easier for you to change and test the code. It is in the while loop
> around line 4900 where you should test if the return value is ENOSYS,
> print a warning and leave the while loop.
See attached patch 'parallel-20110802.enosys.patch'.
> > Also, if you make each of the html files depend on a previous html
> > file, then 'make -j' will serialize them and the pod2html problem
> > goes away. This unfortunately means that someone who just wants to
> > build one html file may get more than they want, but that's a
> > smaller group than the group of people who type 'make -j'
> > indiscriminately. :-)
>
> The actual program 'parallel' is a single, very portable perl script.
> You should be able to copy that to any UNIX-like machine and it will
> run. So you should have no problem installing GNU Parallel on another
> machine and simply copy the 'parallel' program to the target machine.
See attached patch 'parallel-20110802.pod2html.patch'.
>
> /Ole
/Bugs
diff -ru parallel-20110822/src/sem parallel-20110822.new/src/sem
--- parallel-20110822/src/sem 2011-08-21 16:17:43.000000000 -0700
+++ parallel-20110822.new/src/sem 2011-11-14 16:12:32.000000000 -0800
@@ -4743,6 +4743,7 @@
chmod 0666, $self->{'lockfile'}; # assuming you want it a+rw
$Global::use{"Fcntl"} ||= eval "use Fcntl qw(:DEFAULT :flock);";
while(not flock $self->{'lockfh'}, LOCK_EX()|LOCK_NB()) {
+ if ($! =~ m/Function not implemented/) {die("flock: $!");}
::debug("Cannot lock $self->{'lockfile'}");
# TODO if timeout: last
$sleep = ($sleep < 1000) ? ($sleep * 1.1) : ($sleep);
diff -ru parallel-20110822/src/Makefile.in parallel-20110822.new/src/Makefile.in
--- parallel-20110822/src/Makefile.in 2011-08-21 16:05:46.000000000 -0700
+++ parallel-20110822.new/src/Makefile.in 2011-11-14 16:19:42.000000000 -0800
@@ -464,20 +464,16 @@
--section=1 $(srcdir)/niceload.pod > $(srcdir)/niceload.1
parallel.html: parallel Makefile sem
- ./sem --fg --id pod2html pod2html $(srcdir)/parallel.pod > $(srcdir)/parallel.html
- ./sem --fg --id pod2html rm -f $(srcdir)/pod2htm*
+ pod2html $(srcdir)/parallel.pod > $(srcdir)/parallel.html
-sem.html: sem.pod Makefile sem
- ./sem --fg --id pod2html pod2html $(srcdir)/sem.pod > $(srcdir)/sem.html
- ./sem --fg --id pod2html rm -f $(srcdir)/pod2htm*
-
-sql.html: sql Makefile sem
- ./sem --fg --id pod2html pod2html $(srcdir)/sql > $(srcdir)/sql.html
- ./sem --fg --id pod2html rm -f $(srcdir)/pod2htm*
-
-niceload.html: niceload.pod Makefile sem
- ./sem --fg --id pod2html pod2html $(srcdir)/niceload.pod > $(srcdir)/niceload.html
- ./sem --fg --id pod2html rm -f $(srcdir)/pod2htm*
+sem.html: sem.pod Makefile parallel.html
+ pod2html $(srcdir)/sem.pod > $(srcdir)/sem.html
+
+sql.html: sql Makefile sem.html
+ pod2html $(srcdir)/sql > $(srcdir)/sql.html
+
+niceload.html: niceload.pod Makefile sql.html
+ pod2html $(srcdir)/niceload.pod > $(srcdir)/niceload.html
sem: parallel
ln -fs parallel sem