[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MPICH 1.2 performance



Greetings!  update-alternatives used to update slave links when run in
config mode, but now doesn't.  This is a known bug (63287,51807).  In
addition, after being run in config mode, the alternative is not set
to manual.  The following patch, modified slightly from one submitted
to the BTS, works here against the latest potato update-alternatives.

Unfortunately, the dpkg bug list looks a little backlogged.  Could
someone volunteer to test this patch, and follow through if necessary
with email to the dpkg maintainer?

Take care,


=============================================================================
--- /usr/sbin/update-alternatives	Fri Aug  4 10:38:26 2000
+++ ./update-alternatives	Fri Aug  4 11:47:14 2000
@@ -117,6 +117,7 @@
 $mode || &badusage("need --display, --config, --install, --remove or --auto");
 $mode eq 'install' || !%slavelink || &badusage("--slave only allowed with --install");
 
+
 if (open(AF,"$admindir/$name")) {
     $manual= &gl("manflag");
     $manual eq 'auto' || $manual eq 'manual' || &badfmt("manflag");
@@ -201,7 +202,7 @@
 	&pr("No alternatives for $name.");
     } else {
 	&config_alternatives($name);
-	exit 0;
+#	exit 0;
     }
 }
 
@@ -510,6 +511,20 @@
 	    &quit("unable to make $altdir/$name.dpkg-tmp a symlink to $spath: $!");
 	rename_mv("$altdir/$name.dpkg-tmp","$altdir/$name") ||
 	    &quit("unable to install $altdir/$name.dpkg-tmp as $altdir/$name: $!");
+        # Link slaves...
+        for( my $slnum = 0; $slnum < @slavenames; $slnum++ ) {
+            my $slave = $slavenames[$slnum];
+	    if ($slavepath{$preferred,$slnum} ne '') {
+		checked_symlink($slavepath{$preferred,$slnum}, 
+				"$altdir/$slave.dpkg-tmp");
+		checked_mv("$altdir/$slave.dpkg-tmp", "$altdir/$slave");
+	    } else {
+		&pr("Removing $slave ($slavelinks[$slnum]), not appropriate with $versions[$preferred].")
+		    if $verbosemode > 0;
+		unlink("$altdir/$slave") || $! == &ENOENT ||
+		    &quit("unable to remove $altdir/$slave: $!");
+	    }		
+        }
     }
 }
 
@@ -529,6 +544,16 @@
 }
 sub rename_mv {
     return (rename($_[0], $_[1]) || (system(("mv", $_[0], $_[1])) == 0));
+}
+sub checked_symlink {
+       my ($filename, $linkname) = @_;
+       symlink($filename, $linkname) ||
+           &quit("unable to make $linkname a symlink to $filename: $!");
+}
+sub checked_mv {
+        my ($source, $dest) = @_;
+       rename_mv($source, $dest) ||
+           &quit("unable to install $source as $dest: $!");
 }
 exit(0);
=============================================================================



Junichi Uekawa <dancer@netfort.gr.jp> writes:

> In Wed, 2 Aug 2000 22:24:39 +0530 viral@seul.org cum veritate scripsit :
> 
> > I think the conflict is mainly because, both lam and mpich need 
> > /usr/include/mpi
> > 
> > removing lam2-dev would remove /usr/include/mpi and hence mpich installs
> > fine then.
> 
> How do you update alternatives? 
> 
> I did update-alternatives --config mpi, but
> that only updates the symlinks to /usr/include/mpi.
> 
> lam has includes in /usr/include/lam, and mpich has /usr/lib/mpich/include/,
> and usr/include/mpi is only a symbolic link (try "ls -ld /usr/include/mpi ")
> 
> Reading "man update-alternatives" I'm starting to realize that 
> alternatives system is not what I expected.
> 
> "update-alternatives --config mpi", and choosing mpich only updates the 
> master link (usr/include/mpi) and not the slave links (mpicc, etc.). This doesn't
> sound quite right...
> 
> 
> uekawa:/etc/alternatives# file mpif77.1.gz mpiCC.1.gz mpicc.1.gz mpif77 mpiCC mpicc libmpi.a mpi
> mpif77.1.gz: symbolic link to /usr/share/man/man1/mpif77_lam.1.gz
> mpiCC.1.gz:  symbolic link to /usr/share/man/man1/mpiCC_lam.1.gz
> mpicc.1.gz:  symbolic link to /usr/share/man/man1/mpicc_lam.1.gz
> mpif77:      symbolic link to /usr/bin/mpif77_lam
> mpiCC:       symbolic link to /usr/bin/mpiCC_lam
> mpicc:       symbolic link to /usr/bin/mpicc_lam
> libmpi.a:    symbolic link to /usr/lib/liblam.a
> mpi:         symbolic link to /usr/lib/mpich/include
> 
> 
> Now, the question is : 
> is a user of update-alternatives supposed to update-alternative --config
> every slave link to make a working system of mpich with lam installed?
> 
> 
> 
> regards,
> 	junichi
> 
> --
> University: ti0113@mail4.doshisha.ac.jp    Netfort: dancer@netfort.gr.jp
> dancer, a.k.a. Junichi Uekawa   http://www.netfort.gr.jp/~dancer
>  Dept. of Knowledge Engineering and Computer Science, Doshisha University.
> ... Long Live Free Software, LIBERTAS OMNI VINCIT.
> 
> 
> --  
> To UNSUBSCRIBE, email to debian-beowulf-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
> 
> 

-- 
Camm Maguire			     			camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



Reply to: