Makes sense -- What are your thoughts on adding a parameter such as
".exportifmissing" that will push an environment object to a worker if 1)
it has not already been exported or 2) the parallel backend doesn't support
"persistent" environments?  This would allow foreach to keep general
functionality while taking advantage of certain capabilities of some
backends?  The less attractive alternative (if I am trying to write general
code that takes advantage of foreach, while letting the user choose the
backend) would be to write a set of if/then statements querying the backend
type.

Cheers!

--jonathan


On Fri, Mar 22, 2013 at 3:03 PM, Rich Calaway <
richcalaway@revolutionanalytics.com> wrote:

> Hi, Jonathan,
>
> As with most things about foreach, it depends on the parallel backend. For
> most of them,
> where R sessions are initialized beforehand and hang around waiting for
> work to do, the answer is "Yes". Remember, all that .export is trying to do
> is make sure the things you need to run are available on the workers. So,
> for those backends that are running R sessions just waiting for your jobs
> to come to them, it is certainly possible to assign things into those
> individual sessions and have them waiting for later commands. The odd duck
> I know about is Revolution's own doRSR, where R sessions are initiated as
> needed and don't stick around from one invocation of foreach to the next.
>
> Cheers,
> Rich
>
> On Fri, Mar 22, 2013 at 11:52 AM, Jonathan Greenberg <jgrn@illinois.edu>wrote:
>
>> I've been successfully using foreach for some basic problems, but I've run
>> into a new wrinkle that I think is due to me ignoring the .export and
>> .noexport flags.  My question is: is there any easy way to have foreach
>> ONLY export specific variables (ignoring all else) without having to
>> manually list them all in .noexport?
>>
>> Also, once a variable has been .export 'ed in foreach, can it be used in
>> subsequent foreach calls  without calling a new .export (can I pre-load a
>> variable for use with multiple foreach'es)?
>>
>> Thanks!
>>
>> --jonathan
>>
>> --
>> Jonathan A. Greenberg, PhD
>> Assistant Professor
>> Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
>> Department of Geography and Geographic Information Science
>> University of Illinois at Urbana-Champaign
>> 607 South Mathews Avenue, MC 150
>> Urbana, IL 61801
>> Phone: 217-300-1924
>> http://www.geog.illinois.edu/~jgrn/
>> AIM: jgrn307, MSN: jgrn307@hotmail.com, Gchat: jgrn307, Skype: jgrn3007
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-hpc mailing list
>> R-sig-hpc@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
>>
>
>
>
> --
> Rich Calaway
> Documentation Manager
> Revolution Analytics, Inc.
> 1505 Westlake Ave North Suite 300
> Seattle, WA 98109
> richcalaway@revolutionanalytics.com
> 206-456-6086 (Direct Phone)
> 855-GET-REVO x6086 (Toll-free)




-- 
Jonathan A. Greenberg, PhD
Assistant Professor
Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
Department of Geography and Geographic Information Science
University of Illinois at Urbana-Champaign
607 South Mathews Avenue, MC 150
Urbana, IL 61801
Phone: 217-300-1924
http://www.geog.illinois.edu/~jgrn/
AIM: jgrn307, MSN: jgrn307@hotmail.com, Gchat: jgrn307, Skype: jgrn3007

	[[alternative HTML version deleted]]

