Re: [R] multiple R sessions from one working directory using GNU screen

2010-08-04 Thread david.jessop
Olga

There was a presentation at the London R user group about doing what you
ask using the bigmemory package
(http://www.londonr.org/LondonR-20090331/realtimeR.pdf).  I believe you
can do the same thing with ff.   This wouldn't share the whole workspace
but just the objects you choose. 

Regards

David

-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Steven McKinney
Sent: 03 August 2010 21:05
To: Olga Lyashevska; r-help@r-project.org
Subject: Re: [R] multiple R sessions from one working directory using
GNU screen

Dear Olga

An R session is conducted entirely in the RAM memory of your computer,
and each invocation of R will have its own memory space, not shared with
any other application, including another R session.

You will have to architect a scheme to allow one R session to find out
about events and objects in another R session.  This might involve
writing files to disk from session R1, having session R2 check the
directory for new files every now and then, and so on.  (save.image()
saves objects from one R session to a file on disk, but there can be
other items in the saved file such as environments that are not
straightforward to manipulate or investigate from another R session.)

Your situation is similar to cluster computing, where a task is broken
up into independent pieces and each piece is handled by a separate R
process.
Reading about cluster computing with R might help you figure out
strategies to share bits of data and information across multiple R
sessions.

HTH


Steven McKinney

From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On
Behalf Of Olga Lyashevska [o...@herenstraat.nl]
Sent: August 3, 2010 8:04 AM
To: r-help@r-project.org
Cc: Olga Lyashevska
Subject: [R] multiple R sessions from one working directory using GNU
screen

Dear all,

I am using GNU screen to run multiple R sessions from one working
directory in order to split task, however I noticed that dataset is not
synchronized e.g. if I have two sessions R1 and R2, and I remove an
object from R1, R2 doesn't change as expected or change at random.
I have tried to save.image(), q() and then restart both sessions, but it
does not help.


Any suggestions?

Many thanks
Olga

R version 2.11.1 (2010-05-31)
2010 x86_64 GNU/Linux
Ubuntu 10.04.1 LTS
Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
MemTotal: 4050180 kB

__
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.

__
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.

Issued by UBS AG or affiliates to professional investors...{{dropped:30}}

__
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.


Re: [R] multiple R sessions from one working directory using GNU screen

2010-08-04 Thread Olga Lyashevska
Dear Steven,

Thanks for your post. It explains a lot.
The reason I wanted to use multiple sessions simultaneously is that
because when I run something it usually takes quite a while (calculating
distance matrices), meaning that I have to wait before R can handle the
next task. Also RAM is reaching its limits quite often resulting in
shutdown, so I wanted to split one task into pieces which indeed similar
to cluster computing. I will check documentation on this topic. 

Kind regards,
Olga
  

On Tue, 2010-08-03 at 13:04 -0700, Steven McKinney wrote: 
 Dear Olga

 An R session is conducted entirely in the RAM memory of your computer,
 and each invocation of R will have its own memory space, not shared
 with any other application, including another R session.
 
 You will have to architect a scheme to allow one R session to find out
 about events and objects in another R session.  This might involve writing
 files to disk from session R1, having session R2 check the directory
 for new files every now and then, and so on.  (save.image() saves
 objects from one R session to a file on disk, but there can be other items
 in the saved file such as environments that are not straightforward
 to manipulate or investigate from another R session.)
 
 Your situation is similar to cluster computing, where a task is broken up
 into independent pieces and each piece is handled by a separate R process.
 Reading about cluster computing with R might help you figure out
 strategies to share bits of data and information across multiple R sessions.
 
 HTH
 
 
 Steven McKinney
 
 From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf 
 Of Olga Lyashevska [o...@herenstraat.nl]
 Sent: August 3, 2010 8:04 AM
 To: r-help@r-project.org
 Cc: Olga Lyashevska
 Subject: [R] multiple R sessions from one working directory using GNU screen
 
 Dear all,
 
 I am using GNU screen to run multiple R sessions from one working
 directory in order to split task, however I noticed that dataset is not
 synchronized e.g. if I have two sessions R1 and R2, and I remove an
 object from R1, R2 doesn't change as expected or change at random.
 I have tried to save.image(), q() and then restart both sessions, but it
 does not help.
 
 
 Any suggestions?
 
 Many thanks
 Olga
 
 R version 2.11.1 (2010-05-31)
 2010 x86_64 GNU/Linux
 Ubuntu 10.04.1 LTS
 Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
 MemTotal: 4050180 kB
 
 __
 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.

__
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.


Re: [R] multiple R sessions from one working directory using GNU screen

2010-08-04 Thread Olga Lyashevska
Thanks David,

I looked briefly through the bigmemory package and it looks very
promising. As I mentioned in my previous post to Steven I am calculating
distance matrices, and if it is my bottleneck (I am nearly sure it is) I
believe that the bigmemory will be particularly useful as it is designed
to manage massive matrices with shared memory and memory-mapped files. 
Now I will try to see how it can be implemented in my code.

Many thanks
Olga

On Wed, 2010-08-04 at 13:51 +0100, david.jes...@ubs.com wrote: 
 Olga
 
 There was a presentation at the London R user group about doing what you
 ask using the bigmemory package
 (http://www.londonr.org/LondonR-20090331/realtimeR.pdf).  I believe you
 can do the same thing with ff.   This wouldn't share the whole workspace
 but just the objects you choose. 
 
 Regards
 
 David
 
 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Steven McKinney
 Sent: 03 August 2010 21:05
 To: Olga Lyashevska; r-help@r-project.org
 Subject: Re: [R] multiple R sessions from one working directory using
 GNU screen
 
 Dear Olga
 
 An R session is conducted entirely in the RAM memory of your computer,
 and each invocation of R will have its own memory space, not shared with
 any other application, including another R session.
 
 You will have to architect a scheme to allow one R session to find out
 about events and objects in another R session.  This might involve
 writing files to disk from session R1, having session R2 check the
 directory for new files every now and then, and so on.  (save.image()
 saves objects from one R session to a file on disk, but there can be
 other items in the saved file such as environments that are not
 straightforward to manipulate or investigate from another R session.)
 
 Your situation is similar to cluster computing, where a task is broken
 up into independent pieces and each piece is handled by a separate R
 process.
 Reading about cluster computing with R might help you figure out
 strategies to share bits of data and information across multiple R
 sessions.
 
 HTH
 
 
 Steven McKinney
 
 From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On
 Behalf Of Olga Lyashevska [o...@herenstraat.nl]
 Sent: August 3, 2010 8:04 AM
 To: r-help@r-project.org
 Cc: Olga Lyashevska
 Subject: [R] multiple R sessions from one working directory using GNU
 screen
 
 Dear all,
 
 I am using GNU screen to run multiple R sessions from one working
 directory in order to split task, however I noticed that dataset is not
 synchronized e.g. if I have two sessions R1 and R2, and I remove an
 object from R1, R2 doesn't change as expected or change at random.
 I have tried to save.image(), q() and then restart both sessions, but it
 does not help.
 
 
 Any suggestions?
 
 Many thanks
 Olga
 
 R version 2.11.1 (2010-05-31)
 2010 x86_64 GNU/Linux
 Ubuntu 10.04.1 LTS
 Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
 MemTotal: 4050180 kB
 
 __
 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.
 
 __
 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.
 
 Issued by UBS AG or affiliates to professional investors for
 information only and its accuracy/completeness is not guaranteed.
 All opinions may change without notice and may differ to
 opinions/recommendations expressed by other business areas of UBS.
 UBS may maintain long/short positions and trade in instruments
 referred to. Unless stated otherwise, this is not a personal
 recommendation, offer or solicitation to buy/sell and any
 prices/quotations are indicative only. UBS may provide investment
 banking and other services to, and/or its employees may be directors
 of, companies referred to. To the extent permitted by law, UBS does
 not accept any liability arising from the use of this communication.
 
  \251 UBS 2010.  All rights reserved. Intended for recipient only and
 not for further distribution without the consent of UBS.
 
 UBS Limited is a company registered in England  Wales under company
 number 2035362, whose registered office is at 1 Finsbury Avenue,
 London, EC2M 2PP, United Kingdom.
 
 UBS AG (London Branch) is registered as a branch of a foreign company
 under number BR004507, whose registered office is at
 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
 
 UBS Clearing and Execution Services Limited is a company registered
 in England  Wales under company number 03123037, whose registered
 office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
 
 UBS

Re: [R] multiple R sessions from one working directory using GNU screen

2010-08-03 Thread Wu Gong

I don't think one session can get information from another session, except
use load.

I simulate you situation within one session. Hope it helps.

#Simulate the first session
object1 - 1:10
save(object1,file=ob1)
rm(object1)
object1
#Simulate the second session
object2 - (1:10)*2
save(object2,file=ob2)
rm(object2)
object2
#Simulate the third session 
load(file=ob1)
load(file=ob2)
object1
object2


-
A R learner.
-- 
View this message in context: 
http://r.789695.n4.nabble.com/multiple-R-sessions-from-one-working-directory-using-GNU-screen-tp2312037p2312461.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


Re: [R] multiple R sessions from one working directory using GNU screen

2010-08-03 Thread Steven McKinney
Dear Olga

An R session is conducted entirely in the RAM memory of your computer,
and each invocation of R will have its own memory space, not shared
with any other application, including another R session.

You will have to architect a scheme to allow one R session to find out
about events and objects in another R session.  This might involve writing
files to disk from session R1, having session R2 check the directory
for new files every now and then, and so on.  (save.image() saves
objects from one R session to a file on disk, but there can be other items
in the saved file such as environments that are not straightforward
to manipulate or investigate from another R session.)

Your situation is similar to cluster computing, where a task is broken up
into independent pieces and each piece is handled by a separate R process.
Reading about cluster computing with R might help you figure out
strategies to share bits of data and information across multiple R sessions.

HTH


Steven McKinney

From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of 
Olga Lyashevska [o...@herenstraat.nl]
Sent: August 3, 2010 8:04 AM
To: r-help@r-project.org
Cc: Olga Lyashevska
Subject: [R] multiple R sessions from one working directory using GNU screen

Dear all,

I am using GNU screen to run multiple R sessions from one working
directory in order to split task, however I noticed that dataset is not
synchronized e.g. if I have two sessions R1 and R2, and I remove an
object from R1, R2 doesn't change as expected or change at random.
I have tried to save.image(), q() and then restart both sessions, but it
does not help.


Any suggestions?

Many thanks
Olga

R version 2.11.1 (2010-05-31)
2010 x86_64 GNU/Linux
Ubuntu 10.04.1 LTS
Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
MemTotal: 4050180 kB

__
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.

__
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.