Replies: 9 comments
-
Second-to-last parameter needs to be a uintptr_t pointer, to accept the pgr_alloc_cacheline_ct return value. |
Beta Was this translation helpful? Give feedback.
-
Thank you, that helps a lot.
…On Tue, Mar 4, 2025 at 8:42 AM Christopher Chang ***@***.***> wrote:
Second-to-last parameter needs to be a uintptr_t pointer, to accept the
pgr_alloc_cacheline_ct return value.
—
Reply to this email directly, view it on GitHub
<#293 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD5FASQRTQZ7IP65TDDBA5T2SW3XHAVCNFSM6AAAAABYJV4PNGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMZYHE2DGMQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
P.S. The program works great where variant count is less than the chunk
size. Otherwise, it does a core dump now. I'll take it from here now though
-- I appreciate your time up to here.
…On Tue, Mar 4, 2025 at 9:06 AM Shawn Halayka ***@***.***> wrote:
Thank you, that helps a lot.
On Tue, Mar 4, 2025 at 8:42 AM Christopher Chang ***@***.***>
wrote:
> Second-to-last parameter needs to be a uintptr_t pointer, to accept the
> pgr_alloc_cacheline_ct return value.
>
> —
> Reply to this email directly, view it on GitHub
> <#293 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AD5FASQRTQZ7IP65TDDBA5T2SW3XHAVCNFSM6AAAAABYJV4PNGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMZYHE2DGMQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
It's working now. As far as I can tell, I was not allocating enough space
for the genovecs array.
https://github.com/sjhalayka/pgenlib_reader
…On Tue, Mar 4, 2025 at 9:09 AM Shawn Halayka ***@***.***> wrote:
P.S. The program works great where variant count is less than the chunk
size. Otherwise, it does a core dump now. I'll take it from here now though
-- I appreciate your time up to here.
On Tue, Mar 4, 2025 at 9:06 AM Shawn Halayka ***@***.***> wrote:
> Thank you, that helps a lot.
>
> On Tue, Mar 4, 2025 at 8:42 AM Christopher Chang <
> ***@***.***> wrote:
>
>> Second-to-last parameter needs to be a uintptr_t pointer, to accept the
>> pgr_alloc_cacheline_ct return value.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#293 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AD5FASQRTQZ7IP65TDDBA5T2SW3XHAVCNFSM6AAAAABYJV4PNGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMZYHE2DGMQ>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
>
|
Beta Was this translation helpful? Give feedback.
-
fyi, the genovecs array should have NypCtToWordCt(sample_ct) elements. |
Beta Was this translation helpful? Give feedback.
-
I tried that and it gives me a core dump because genovec is too small.
Thanks for helping though! I sincerely appreciate it.
…On Tue, Mar 4, 2025 at 11:52 PM Christopher Chang ***@***.***> wrote:
fyi, the genovecs array should have NypCtToWordCt(sample_ct) elements.
—
Reply to this email directly, view it on GitHub
<#293 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD5FASU3SSADW57HVSIP7UL2S2GJNAVCNFSM6AAAAABYJV4PNGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMZZGY4DEMA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I found a happy medium:
uintptr_t* genovec = (uintptr_t*)malloc(sizeof(uintptr_t) * 64);
I'm absolutely stumped as to why it works, but the absolute minimum number
of elements in the genovec array seems to be 64. I allocated more than
that, filled it with the sentinel value -9999, and ran it through the
PgrGet function. After that I printed out the genovec array and found that
the overwritten size is always 64, regardless of the sample and variant
counts and chunk_size. Why 64 though, I wonder?
- Shawn
…On Wed, Mar 5, 2025 at 10:04 AM Shawn Halayka ***@***.***> wrote:
I tried that and it gives me a core dump because genovec is too small.
Thanks for helping though! I sincerely appreciate it.
On Tue, Mar 4, 2025 at 11:52 PM Christopher Chang <
***@***.***> wrote:
> fyi, the genovecs array should have NypCtToWordCt(sample_ct) elements.
>
> —
> Reply to this email directly, view it on GitHub
> <#293 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AD5FASU3SSADW57HVSIP7UL2S2GJNAVCNFSM6AAAAABYJV4PNGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMZZGY4DEMA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
I should have clarified that NypCtToWordCt(sample_ct) is the number of uintptr_ts. You need to multiply that number by sizeof(uintptr_t) to get the correct number of bytes. sizeof(uintptr_t) * 64 will stop working when you start testing with larger sample_ct. |
Beta Was this translation helpful? Give feedback.
-
Ok, I will revert to not using 64. Thank you for all of your guidance.On Mar 5, 2025, at 10:41 AM, Christopher Chang ***@***.***> wrote:
I should have clarified that NypCtToWordCt(sample_ct) is the number of uintptr_ts. You need to multiply that number by sizeof(uintptr_t) to get the correct number of bytes.
sizeof(uintptr_t) * 64 will stop working when you start testing with larger sample_ct.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I am using PGENLIB.
I have a code to read the data from the input files, but it segfaults when I call PgfiInitPhase2 on line 55 of main.cpp in the repository https://github.com/sjhalayka/pgenlib_reader
I compile using the command: g++ *.cc main.cpp -fpermissive
Are there any glaring errors in main.cpp that I'm missing? Thanks for any time that you can provide. I changed line 56 from 1 to 0, but it doesn't help. I also tried dummy files from plink2, instead of my files, and it still segfaults.
Beta Was this translation helpful? Give feedback.
All reactions