Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

palinear can't process more than 2 millions SNPs in a dosage file #1

Open
lckarssen opened this issue Nov 4, 2015 · 0 comments
Open

Comments

@lckarssen
Copy link
Member

This is a 'liftover' of bug #2437 from the R-forge bug tracker.

Error message:

mematrix(nr,nc): cannot allocate memory (1148,2582783)

Input: 1148 individuals, dosage file with 2582783 SNPs.

Cause:
In mematr1.h file lines:

20: data = new (nothrow) DT [ncol*nrow];
165: data = new (nothrow) DT [ncol*nrow];

The ncol and nrow are of type int. The result ncol*nrow is stored in int, which is not enough to represent big number and becomes negative. The allocation fails.

When changed to data = new (nothrow) DT [(unsigned int)ncol*nrow], the memory is allocated successfully.

Another crucial thing is to change nelements variable from int to unsigned int.

lckarssen pushed a commit that referenced this issue Nov 18, 2015
A cleaner autotools implementation of the gzip reading code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant