What does the ubuntu command line utility 'top' say about your system
while this is running? Also, how much memory do you have on your
system?
Looking at the mechanics of the computation on a different machine:
$PanDigS
3628800 10
timespacex '{{10 base"1 each 3 box\"1 i.y,10}}3'
4.5e_5 33600
timespacex '{{10 base"1 each 3 box\"1 i.y,10}}36'
0.000541 361920
timespacex '{{10 base"1 each 3 box\"1 i.y,10}}362'
0.003622 3.62333e6
timespacex '{{10 base"1 each 3 box\"1 i.y,10}}3628'
0.043213 3.63452e7
timespacex '{{10 base"1 each 3 box\"1 i.y,10}}36288'
0.422218 3.65596e8
You probably need about 40 gigabytes of memory to complete this
operation, and if you had enough physical memory that would probably
take almost a minute to complete. If you rely on virtual memory it
might take up to thousands of times longer.
(It's perhaps worth noting that Linux allocates memory
"optimistically" -- which is to say that the operating system does not
guarantee that there will be physical memory when it allocates memory
to a process. Instead, if it runs out of memory, it starts killing
processes somewhat arbitrarily. The reason for this is that many
popular programs allocate more memory than they actually use.)
If you are interested in the results, it would be more memory
efficient to skip the boxing and directly calculate the result:
timespacex '{{3 (10 base ])\"1 i.y,10}}36288'
0.246229 8.3929e6
(Also, as people have noted, digits range from 0 to 9, not 1 to 10.)
I hope this helps,
--
Raul
On Sun, Feb 7, 2021 at 6:33 AM Francesco Pedulla' <[email protected]> wrote:
>
> The following piece of code does not work on Ubuntu 20.04.
>
> load 'primitives'
>
> perm =: i.@! A. i.
>
> PanDigS =: (perm 10) from (1 + i.10)
>
> PanDigT =: 10 base"1 each 3 box\"1 PanDigS
>
>
> The effect is variable: crash of the J interpreter, freeze of the Qt
> interface or even of the whole system. It shows up both on J807 and J902.
>
> The dataset is quite large:
>
>
> 7!:5 <'PanDigS'
>
> 5.36871e8
>
>
> and the process crashes (or the system freezes) after several seconds.
> Hence, I suspect an issue with memory management.
>
> Any idea or suggestion on how to bypass the problem?
>
> Thanks,
>
>
> Francesco
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm