Oh this actually does make a lot of sense. The kicker is that Rmpi doesn't like to use OMPI and really loves to use LAM so I have to use R in batch mode by running mpirun -np 12 and specify the host file. I have a bad feeling that this is loading the library 12 times, once for each R namespace. While this is annoying, not having Rmpi working was far more so and ram is cheap. I do agree whole heatedly that dynamic libraries are far superior to static ones but I wonder if setting the configuration by default to build both would allow those applications which require the static libraries to compile to compile but at the same time getting the applications which use dynamic loading libraries to exist side by side. I don't plan on writing applications which require -libmpi but I know that there are developers not nearly in tune with this line of thinking or know the difference between static and dynamic libraries.
On Apr 5, 2012, at 9:07 PM, Benedict Holland wrote:This makes sense. You were falling victim to the fact that R dlopens libmpi as a dynamic library in a private namespace. Hence, when Open MPI then dlopens its own plugins, it can't find libmpi's symbols. This is a generic problem with any system that opens plugins that, themselves, open plugns. I wish there was a better solution to this -- the OS guys need to give us a better mechanism here. :-(
> Oh how interesting and I hope this helps someone. Following another link, I had to use:
> ./configure --prefix /usr --enable-shared --enable-static
OMPI's --enable-static option does two things:
- it builds libmpi.a (vs. libmpi.so)
- it slurps all of OMPI's plugins into libmpi.a (so it doesn't need to dlopen anything at run-time)
It's the latter point that is saving you.
Note that you could also just --disable-dlopen (vs. --disable-shared --enable-static), which just does the latter of the above things (meaning: OMPI still builds libmpi.so), and it should also work for you.
Among other reasons, shared libraries generally help save memory at run time. This is somewhat important as core counts go up. If you "mpirun -np 32" on a single, 32-core machine, would you rather have 32 independent copies of libmpi.a loaded into RAM, or just one copy that all processes share?
> when compiling this for Rmpi. Just curious, why isn't --enable-static a default option?
Using libmpi.so enables the latter option.
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/
devel mailing list