An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120316/7d19cc3f/attachment.pl>
64 bit version for linux and build huge matrix
5 messages · Shengyun Peng, Rich Shepard, Steve Lianoglou +2 more
On Fri, 16 Mar 2012, Shengyun Peng wrote:
I downloaded R from http://cran.cnr.berkeley.edu/, with the linux version. But after compile, I don't know how to start 64 bit R, as there is only one R executable under bin folder, not alike windows version which have two executables.
If your system has a 64-bit version of the distribution installed then that's how applications are built. You start it by typing 'R' (without the quotes) on the command line. Linux is not Microsoft.
Other than that, I want to build a matrix 65536 rows by 65536 columns, but the system tells me: Error in matrix(0, 65536, 65536) : too many elements specified. So, I want to know if there's anything I can do to achieve that and that's one reason I need 64 bit R.
How much memory do you have installed? Rich
Hi,
On Thu, Mar 15, 2012 at 4:02 PM, Shengyun Peng <psy106616 at 163.com> wrote:
Hello: I downloaded R from http://cran.cnr.berkeley.edu/, with the linux version. But after compile, I don't know how to start 64 bit R, as there is only one R executable under bin folder, not alike windows version which have two executables.
Are you sure it's not running 64bit already? What is the value of `.Machine$sizeof.pointer`? If it's 8, then your work is done. -steve
Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
On Mar 15, 2012, at 3:19 PM, Rich Shepard wrote:
On Fri, 16 Mar 2012, Shengyun Peng wrote:
I downloaded R from http://cran.cnr.berkeley.edu/, with the linux version. But after compile, I don't know how to start 64 bit R, as there is only one R executable under bin folder, not alike windows version which have two executables.
Windows and OSX pre-compiled binaries on CRAN are built with both 32 bit and 64 bit executables. Building from source will typically default to your system architecture.
If your system has a 64-bit version of the distribution installed then that's how applications are built. You start it by typing 'R' (without the quotes) on the command line. Linux is not Microsoft.
To verify, use: .Machine$sizeof.pointer If it comes back with 8, you are running 64 bit R.
Other than that, I want to build a matrix 65536 rows by 65536 columns, but the system tells me: Error in matrix(0, 65536, 65536) : too many elements specified. So, I want to know if there's anything I can do to achieve that and that's one reason I need 64 bit R.
How much memory do you have installed? Rich
That won't matter here. R uses signed 32 bit signed integers for indexing and a matrix, more generally an array, is essentially a vector with dimensions. Thus, you can only have (2^31) - 1 elements in a vector/matrix/array and 64k^2 is larger than that...It is the case whether you are running 32 bit or 64 bit R.
(65536 * 65536) < (2 ^ 31) - 1
[1] FALSE There are others here with hands-on experience that can comment, but a starting place to look for potential solutions would be the High Performance Computing Task View (http://cran.r-project.org/web/views/HighPerformanceComputing.html) under "Large memory and out-of-memory data". HTH, Marc Schwartz
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- project.org] On Behalf Of Rich Shepard Sent: Thursday, March 15, 2012 1:19 PM To: r-help Subject: Re: [R] 64 bit version for linux and build huge matrix On Fri, 16 Mar 2012, Shengyun Peng wrote:
I downloaded R from http://cran.cnr.berkeley.edu/, with the linux
version.
But after compile, I don't know how to start 64 bit R, as there is
only
one R executable under bin folder, not alike windows version which
have
two executables.
If your system has a 64-bit version of the distribution installed then that's how applications are built. You start it by typing 'R' (without the quotes) on the command line. Linux is not Microsoft.
Other than that, I want to build a matrix 65536 rows by 65536
columns, but
the system tells me: Error in matrix(0, 65536, 65536) : too many
elements
specified. So, I want to know if there's anything I can do to achieve
that
and that's one reason I need 64 bit R.
How much memory do you have installed? Rich
The problem is not the amount of memory, it is the number of elements you are trying to put in the matrix (as the error message states). A matrix is just a vector with a dimension attribute. The maximum length of a vector or a list is 2^31-1. You are trying to put twice that many elements in the matrix. It is not going to happen regardless of the amount of memory available. You will need to solve your problem in some other way. If your matrix is sparse, you may be able to use techniques for manipulating sparse matrices. Hope this is helpful, Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204