[R-sig-hpc] Rmpi on NetBSD with OpenMPI

Dirk Eddelbuettel edd at debian.org
Wed May 19 00:16:21 CEST 2010


Kevin, Aleksej,

Sorry for jumping here late but ...

On 19 May 2010 at 09:56, Kevin.Buckley at ecs.vuw.ac.nz wrote:
| Aleksej writes
| 
| > Ideally, R should allow installation of software into place outside
| > its PREFIX, this is good anyway, since user may have no permissions
| > to access anything within PREFIX.
| 
| R does.
| 
| I am not an R user but I have been involved in the development and
| deployment of packages for users of R and I am aware you can put
| the libraries where you want at package install time by using
| --library and then adding a "lib.loc=" when you load the package.
| 
| For example I've been using:
| 
| R CMD INSTALL --library=/vol/grid/pkg/R/Rlibs Rmpi \
|   --configure-args=--with-Rmpi-type=OPENMPI \
|   --configure-args=--with-Rmpi-libpath=/usr/pkg/lib/openmpi \
|   --configure-args=--with-Rmpi-include=/usr/pkg/include
| 
| to get the Rmpi installed library where I want it, within the confines
| of the SGE grid, I am working with and then I add a
| 
| lib.loc="/vol/grid/pkg/R/Rlibs"
| 
| clause to the library(Rmpi) loading in the Rprofile that gets sourced
| to actually load it and set it up.
| 
| But I am not sure that's the issue here.
| 
| What we are talking about here is overcoming the vaguries of
| cross-platform shared-library symbol visibility, when shared
| libraries are chain-loaded, by explicitly pre-loading a library
| (libmpi.so) that you will need anayway, whether the platform
| needs it loaded explicitly or not.

... we had very similar issues with Open MPI 1.2.* and the global visibility
of symbols which lead Hao Yu (Rmpi's author) and myself (Debian Rmpi
maintainer, and at one time also Debian openmpi co-maintainer) to do a lot of
tests.  You can probably find old posts of mine on the openmpi lists.

I believe that for us, the 'winning' change was 

#ifdef OPENMPI
	dlopen("libmpi.so.0", RTLD_GLOBAL | RTLD_LAZY);
#endif

after which we were golden.  *Bsd may well be different. Sorry if cannot be
of more help here.  But symbol visibility and loading should be problem
common to *Bsd and may get pointes from other projects.  

Dirk
 
| My contention, for maintainer of Rmpi, is that if you did explicitly
| load it so as to facilitate platforms that have a "local scope"
| for symbol visibility, you would not break anything for the platforms
| with global scope BUT you would give platforms that might need to play
| around with the code a place at which to do so.
| 
| As things stand, because Rmpi assumes that there a global scoping
| in operation, and that libmpi.so will be loaded with any issues,
| there is no obvious patch for systems, like NetBD, where that is
| not true.
| 
| If Rmpi's installtion process explicitly looked for libmpi.so
| and provided the R code to explicitly load it, then any platform
| which needed to could provide a patch.
| 
| Because the loading of libmpi.so is currently implicit, as in, left
| to the chaining by anothe OpenMPI library,there is no clear way to
| proceed, for folks working in NetBSD-land.
| 
| As with many of these cross platform issues, it comes down to "making
| things explicit".
| 
| That's my understanding of it anyway: you'll appreciate this has
| pretty much crept up on me over the last month or so,
| Kevin
| 
| -- 
| Kevin M. Buckley                                  Room:  CO327
| School of Engineering and                         Phone: +64 4 463 5971
|  Computer Science
| Victoria University of Wellington
| New Zealand
| 
| _______________________________________________
| R-sig-hpc mailing list
| R-sig-hpc at r-project.org
| https://stat.ethz.ch/mailman/listinfo/r-sig-hpc

-- 
  Regards, Dirk



More information about the R-sig-hpc mailing list