[R] RMySQL and RMPI together

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Mon Jul 19 16:53:24 CEST 2010


Don't send the open connection object... send the connection info (database name, username, password, etc.) and create new connections as part of the slave task. The master connection object is not valid on the slaves.

kdbondalapati at jacks.sdstate.edu wrote:

>
>Dear R-users,
>
>I got problem when using both RMPI and RMySQL together and I thought some body in this forum can help me.
>
>I have a huge data set (more than 300,000 rows) and I would like to modify only few observations. I wrote the modifications in a function form and able to send the function to slaves using Robj2slaves from RMPI package. However the function needs MySQL data base name to extract the required observations. I used the following ways to transfer the data base name to salves: 
>
>con <- dbConnect(MySQL(), dbname="XXXXX", user="XXXX", password="XXXX",
>host="localhost")
>
>Method 1: mpi.bcast.cmd(con)
>
>Method 2: mpi.bcast.cmd(con <- dbConnect(MySQL(), dbname="XXXXX", user="XXXX",
>password="XXXX", host="localhost"))
>
>
>But both didn't work. I can not send the complete table in my data base to all slaves as it takes so much memory. In addition, the funtion had SQL queries to extract the required observations to perform the analysis and to send them back to the data base. Since I am not able to send the data base name ('con' in this case) to slaves, slaves are not executing the function.
>
>Thank you,
>Krishna.
>
>
>
>
>
>Krishna D Bondalapati
>Research Associate 
>
>Plant Science Department
>
>South Dakota State University
>
>
>
>
> 
>
>
> 		 	   		  
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list