parallel/doc/FUTURE_IDEAS
2010-06-10 00:39:35 +02:00

81 lines
2.1 KiB
Plaintext

Ved første ssh til hosten:
if not -B kopieret:
kopier
tilføj til cleanup
Ved afslutning:
if cleanup:
for each cleanup: cleanup
=head1 IDEAS
Kan vi lave flere ssh'er, hvis vi venter lidt?
En ssh med 20% loss og 900 ms delay, så kan login nås på 15 sek.
Test if -0 works on filenames ending in '\n'
Transfer scriptfile before first job. Remove it when last job done.
monitor to see which jobs are currently running
http://code.google.com/p/ppss/
If there are nomore jobs (STDIN is closed) then make sure to
distribute the arguments evenly if running -X.
=head1 options
One char options not used: F G J K P Q Y
Skilletegn i sshlogin:
#=item B<--sshlogin> I<[ncpu/]sshlogin[,[ncpu/]sshlogin[,...]]> (beta testing)
# Skilletegn:
# No: "#!&()?\<>|;*'~ shellspecial
# No: @.- part of user@i.p.n.r i.p.n.r host-name
# No: , separates different sshlogins
# No: space Will make it hard to do: 8/server1,server2
# Maybe: / 8//usr/bin/myssh,//usr/bin/ssh
# %/=:_^
=head2 mutex
mutex -b -n -l lockid -m max_locks [command]
mutex -u lockid
-b run command in background
-l lockfile will lock using the lockid
-n nonblocking
-m maximal number of locks (default 1)
-u unlock
If command given works like: mutex -l lockfile -n number_of_locks ; command; mutex -u lockfile
If -b given works like: mutex -l lockfile -n number_of_locks ; (command; mutex -u lockfile)&
Kan vi finde på lockid som giver mening?
Parallelize so this can be done:
mdm.screen find dir -execdir mdm-run cmd {} \;
Maybe:
find dir -execdir par$ --communication-file /tmp/comfile cmd {} \;
find dir -execdir mutex -j4 -b cmd {} \;
=head2 Comfile
This will put a lock on /tmp/comfile. The number of locks is the number of running commands.
If the number is smaller than -j then it will start a process in the background ( cmd & ),
otherwise wait.
par$ --wait /tmp/comfile will wait until no more locks on the file
=head1 Unlikely
Accept signal INT instead of TERM to complete current running jobs but
do not start new jobs. Print out the number of jobs waiting to
complete on STDERR. Accept sig INT again to kill now. This seems to be
hard, as all foreground processes get the INT from the shell.