Jeff, Thank you for your response. Upon your suggestion, I sent the connection info to the slaves as:
mpi.bcast.Robj2slave(sqlUser) mpi.bcast.Robj2slave(sqlPass) mpi.bcast.Robj2slave(sqlDBname) mpi.bcast.Robj2slave(sqlHost) and then inserted the following command in the slave task: con <- dbConnect(MySQL(), dbname=sqlDBname, user=sqlUser, password=sqlPass, host=sqlHost) The slaves are executing the tasks before this command. However, they failed to perform the tasks after this and even failed to run simple SQL queries. I also tried inserting a direct R command into the slave task as: con <- dbConnect(MySQL(), dbname="XXXXX", user="XXXX", password="XXXX", host="localhost") But it is of no use. Please let me know if any one has suggestion for this problem. Thank you, Krishna. > Subject: Re: [R] RMySQL and RMPI together > From: jdnew...@dcn.davis.ca.us > Date: Mon, 19 Jul 2010 07:53:24 -0700 > To: kdbondalap...@jacks.sdstate.edu; r-help@r-project.org > > 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. > > kdbondalap...@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@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:<jdnew...@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. [[alternative HTML version deleted]] ______________________________________________ R-help@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.