Memory problem of symmetric groups

asked 2022-04-22 08:26:42 +0200

lijr07 gravatar image

updated 2022-04-22 08:29:34 +0200

In my program I need to use all elements of a symmetric group $S_n$. In the case of $n=15$, it is said that there is memory problem. I sent the codes to a computer cluster and obtained the following error:

Traceback (most recent call last):
  File "/home/fs71797/lij21/", line 3426, in <module>
  File "/home/fs71797/lij21/", line 74, in ChTUsingKLPolynomialInSage

My code is as follows:


with Pool() as p: below action to as many cores as available
    bb = p.starmap(ChTUsingKLPolynomialInSageHalf,[(k,l[i],w0,w,W,T1) for i in range(len(l))])

W is $S_n$. I do not need to store list(W) but only need to take every element of list(W).

The slurm script I used is as follows:


#SBATCH -n 48
#SBATCH -N 1  
#SBATCH -t 3-0:00  
#SBATCH --mem=96000  
#SBATCH -o clusterGr49.o  
#SBATCH -e clusterGr49.e   

module load sage
sage chTGr49.sage

Is there some way to solve this memory problem? Thank you very much.

edit retag flag offensive close merge delete



Use iterators, do not create a full list. Go and see any basic python manual.

FrédéricC gravatar imageFrédéricC ( 2022-04-22 08:37:33 +0200 )edit

"I do not need to store list(W)" - then why do you create this list?

Max Alekseyev gravatar imageMax Alekseyev ( 2022-04-22 16:19:46 +0200 )edit

@FrédéricC, @max, thanks a lot! I tried to remove list(W) and use iter(W) in the loop

bb = p.starmap(ChTUsingKLPolynomialInSageHalf,[(k,i,w0,w,W,T1) for i in iter(W)])

Maybe it will work. I will try to run it on the computer cluster.

lijr07 gravatar imagelijr07 ( 2022-04-22 16:46:04 +0200 )edit

You could in fact just try for i in W.

John Palmieri gravatar imageJohn Palmieri ( 2022-04-22 16:58:46 +0200 )edit