If you use the normal splitting with geng, it might become more even if you go to a higher number of parts. However, it will never be completely even.
If you want to split he output of geng evenly than all graphs will have to be generated anyway, because there is no other way to guarantee this. Therefore it is simpler to split the output after it has been generated by geng. The code below is a possibility, but I would strongly advice you the focus on the second part of your computations. As was mentioned by other people as well: the thing that is slowing everything down is Sandpile and not geng. geng 12 | awk "NR % 6000 == 0 {print $1}" This splits the output of geng in 6000 parts and outputs part 0 (i.e. the first part). Replace the 0 by a number in the range 0-5999 to get all parts. This will be split as evenly as possible. Op vr 22 mrt. 2019 om 16:38 schreef Ai Bo <boaisp...@gmail.com>: > It is very true that I am not familiar with geng, nor sagemath. I just > installed on my machine a few days ago. > > The reason I want to modify geng.c is I don't have a way to partition the > output of "geng 12". I have finished up to "geng 11" so far, mostly with > manual work. I know how many "geng 12" generates. > > With "geng 12", the output, if written to a file, is too large for my > machine to handle. I can write to about 300G, not anything like 1500G. > > That is why I am looking at res/mod, but it seems I can't easily control > how large the output will be (or I just don't know how). > > So if I can modify "geng" program, I can control the output range. Any > other suggestion? > > > > On Friday, March 22, 2019 at 12:28:32 AM UTC-7, nvcleemp wrote: >> >> Why would you want to modify geng.c? From your previous comments I get >> the impression that you are not familiar with the algorithm that geng uses. >> You're not even familiar with the way geng encodes graphs. In that case it >> is almost guaranteed that you will break something if you modify it. >> >> So again, why would you want to modify it? If it is to obtain an even >> split, then you can only do this by generating all graphs and then >> splitting the output. The commands to do this without translating the >> intermediate graphs to the Sage data structure have been shown in the other >> thread. For anything larger than 12 this will still be too slow since there >> are just so many graphs. >> >> The builtin splitting in geng works by generating the graphs and at a >> certain depth in the generation tree counting the branches and only >> proceeding if the number modulo mod is equal to res. This way not >> everything is generated and if this is done at a suitable depth then the >> splitting will be fairly equal. >> >> Cheers >> Nico >> >> Op vr 22 mrt. 2019 om 06:06 schreef Ai Bo <boai...@gmail.com>: >> >>> Sorry for not being clear. >>> I meant I used geng —help. >>> Apparently, the equal divide doesn’t help in my example case. >>> Where is this geng.c file? If I modify geng.c, how should I build geng? >>> >>> On Thu, Mar 21, 2019 at 9:58 PM John H Palmieri <jhpalm...@gmail.com> >>> wrote: >>> >>>> >>>> >>>> On Thursday, March 21, 2019 at 9:38:03 PM UTC-7, Ai Bo wrote: >>>>> >>>>> Saw this in the document: >>>>> res/mod : only generate subset res out of subsets 0..mod-1 >>>>> >>>> >>>> It would help if you gave some context for this. I'm guessing that most >>>> Sage users won't know what "geng" is. I certainly didn't. I found by >>>> searching the source code that you found this help message in the method >>>> "nauty_geng" in graph_generators.py: you should have said this at the start >>>> instead of just "saw this in the document". This makes it look like the >>>> program "geng" comes from nauty. Now look at the nauty source code (there >>>> is a tar file in the "upstream" directory, if you have a source code >>>> version of Sage, also available at >>>> http://files.sagemath.org/spkg/upstream/nauty/index.html). The nauty >>>> manual says >>>> >>>> res/mod : only generate subset res out of subsets 0..mod-1 >>>> >>>> and >>>> >>>> See program text for much more information. >>>> >>>> The file geng.c says >>>> >>>> mod, res = a way to restrict the output to a subset. >>>> All the graphs in G(n,mine..maxe) are divided >>>> into >>>> disjoint classes C(0,mod),C(1,mod),...,C(mod-1, >>>> mod), >>>> of very approximately equal size. >>>> Only the class C(res,mod) is written. >>>> >>>> If the -x or -X switch is used, they must have >>>> the >>>> same value for different values of res; >>>> otherwise >>>> the partitioning may not be valid. In this >>>> case >>>> (-x,-X with constant value), the usual >>>> relationships >>>> between modulo classes are obeyed; for example >>>> C(3,4) = C(3,8) union C(7,8). This is not true >>>> if 3/8 and 7/8 are done with -x or -X values >>>> different from those used for 3/4. >>>> >>>> >>>> >>>>> >>>>> How is the output divided? >>>>> >>>>> I tried with : ../sage-8.6/local/bin/geng 6 -C 0/7 >>>>> and then I iterated from 0/7, 1/7, 2/7, 3/7.... >>>>> Why the output is 27, 21, 7, 1, 0, 0, ... >>>>> >>>>> How is the subset generated? >>>>> >>>>> Thank you. >>>>> >>>> -- >>>> You received this message because you are subscribed to a topic in the >>>> Google Groups "sage-devel" group. >>>> To unsubscribe from this topic, visit >>>> https://groups.google.com/d/topic/sage-devel/FJZoODSZK3Q/unsubscribe. >>>> To unsubscribe from this group and all its topics, send an email to >>>> sage-devel+...@googlegroups.com. >>>> To post to this group, send email to sage-...@googlegroups.com. >>>> Visit this group at https://groups.google.com/group/sage-devel. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "sage-devel" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to sage-devel+...@googlegroups.com. >>> To post to this group, send email to sage-...@googlegroups.com. >>> Visit this group at https://groups.google.com/group/sage-devel. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.