Automatic disk Read/Write when numbers exceed available RAM

18 views
Skip to first unread message

Gaj Satha

unread,
May 26, 2020, 12:37:03 AM5/26/20
to mpir-devel
The problem I have is that numbers have become so big that I can’t store them in my RAM. Is there a way I can smartly write portions of my number to the hard disk and load them when needed?

Essentially what I want is that when the RAM is full, just write to the disk and load is automatically without me writing the logic of disk read/write.

Bill Hart

unread,
May 26, 2020, 5:35:27 AM5/26/20
to mpir-devel
No, unfortunately there is no automatic facility to do this other than
the swapping mechanism of your OS.

On Tue, 26 May 2020 at 06:37, Gaj Satha <gaj....@gmail.com> wrote:
>
> The problem I have is that numbers have become so big that I can’t store them in my RAM. Is there a way I can smartly write portions of my number to the hard disk and load them when needed?
>
> Essentially what I want is that when the RAM is full, just write to the disk and load is automatically without me writing the logic of disk read/write.
>
> --
> You received this message because you are subscribed to the Google Groups "mpir-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mpir-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mpir-devel/1e4ba4af-3dc8-46f7-ac60-3bd9410bc89b%40googlegroups.com.

degski

unread,
May 27, 2020, 7:23:48 AM5/27/20
to mpir-...@googlegroups.com
On Tue, 26 May 2020 at 04:35, 'Bill Hart' via mpir-devel <mpir-...@googlegroups.com> wrote:
No, unfortunately there is no automatic facility to do this other than
the swapping mechanism of your OS.

But in the OP's code!. One can allocate the mpz_t directly into virtual memory using your os'es facilities (VirtualAlloc/mmap) or use Boost.Interprocess to achieve the same in a cross-platform way. Wrapping an mpz_t (putting it in vm) is the way I think).

degski
--
@systemdeg
"We value your privacy, click here!" Sod off! - degski
"Anyone who believes that exponential growth can go on forever in a finite world is either a madman or an economist" - Kenneth E. Boulding
"Growth for the sake of growth is the ideology of the cancer cell" - Edward P. Abbey
Reply all
Reply to author
Forward
0 new messages