-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup for parallel construction of braces with SCSCP
- Loading branch information
Alexander Konovalov
committed
Aug 2, 2019
1 parent
e1f38a7
commit 3fca5f7
Showing
5 changed files
with
459 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
Quickstart guide for parallel braces enumeration with SCSCP package | ||
|
||
The file `count.g` is the original file containing `AllSkewbraces` | ||
function which calculates skew braces enumerating all groups of a | ||
given order. | ||
|
||
It was extended by `AllSkewbracesByGroupId` function which takes one | ||
group id `[size,nr]` and produces all skew braces that originate from | ||
that group id. | ||
|
||
Obviously, this can be performed independently, and this is where | ||
one can use the SCSCP package. | ||
|
||
To set up parallel distributed calculation do the following: | ||
|
||
1. Edit server configuration file `myserver.g` as needed (e.g. to | ||
update filenames and paths). | ||
|
||
2. Edit part 1 of the `gapd.sh` script to update the way how GAP | ||
starts and the location of the server configuration file. | ||
|
||
3. Edit `gapfarm.sh` script to specify GAP workers, each listening | ||
to a specific port. The number of workers depend on the number of | ||
cores on your computer. | ||
|
||
4. Start GAP workers with | ||
|
||
./gapfarm.sh | ||
|
||
5. Start a GAP session and execute the following commands: | ||
|
||
Load SCSCP package: | ||
|
||
gap> LoadPackage("scscp"); | ||
|
||
Inform GAP which server to use (port numbers must be the same | ||
as in `gapfarm.sh`): | ||
|
||
gap> SCSCPservers:=List([26133..26136], i -> ["localhost",i]); | ||
[ [ "localhost", 26133 ], [ "localhost", 26134 ], [ "localhost", 26135 ], [ "localhost", 26136 ] ] | ||
|
||
Generate the list of tasks (each task is a group id): | ||
|
||
todo:=List([1..NrSmallGroups(16)],i->[16,i]); | ||
[ [ 16, 1 ], [ 16, 2 ], [ 16, 3 ], [ 16, 4 ], [ 16, 5 ], [ 16, 6 ], [ 16, 7 ], [ 16, 8 ], [ 16, 9 ], [ 16, 10 ], [ 16, 11 ], [ 16, 12 ], [ 16, 13 ], [ 16, 14 ] ] | ||
|
||
Start parallel computation: | ||
|
||
gap> ParListWithSCSCP(todo,"AllSkewbracesByGroupId"); | ||
#I 1/14:master --> localhost:26133 | ||
#I 2/14:master --> localhost:26134 | ||
#I 3/14:master --> localhost:26135 | ||
#I 4/14:master --> localhost:26136 | ||
#I 5/14:master --> localhost:26133 | ||
#I 6/14:master --> localhost:26133 | ||
#I 7/14:master --> localhost:26134 | ||
#I 8/14:master --> localhost:26133 | ||
#I 9/14:master --> localhost:26134 | ||
#I 10/14:master --> localhost:26134 | ||
#I 11/14:master --> localhost:26133 | ||
#I 12/14:master --> localhost:26135 | ||
#I 13/14:master --> localhost:26136 | ||
#I 14/14:master --> localhost:26136 | ||
[ 8, 83, 191, 190, 66, 66, 80, 144, 80, 161, 227, 118, 152, 39 ] | ||
|
||
Each of the workers will produce output files with the name in the | ||
format `SBsizeX_Y.dat` in their current directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,236 @@ | ||
ConstructBrace := function(hol, subgroup) | ||
local ab, p, f, g, a, b; | ||
|
||
ab := Image(Embedding(hol, 2)); | ||
|
||
p := []; | ||
f := IsomorphismPermGroup(ab); | ||
g := IsomorphismPermGroup(subgroup); | ||
|
||
for a in ab do | ||
if Number(subgroup, x->x*a in Image(Embedding(hol, 1))) <> 1 then | ||
return fail; | ||
else | ||
Add(p, [Image(f,a), Image(g, First(subgroup, x->x*a in Image(Embedding(hol, 1))))]); | ||
fi; | ||
od; | ||
|
||
return p; | ||
end; | ||
|
||
Brace := function(p) | ||
local ab, gr; | ||
|
||
ab := Group(List(p, x->x[1])); | ||
gr := Group(List(p, x->x[2])); | ||
|
||
return rec( | ||
size := Size(ab), | ||
ab := ab, | ||
gr := gr, | ||
p := MappingByFunction(ab, gr, x->First(p, y->IsOne(y[1]*Inverse(x)))[2]), | ||
); | ||
end; | ||
|
||
BracesWithAdditiveGroup:= function(ab) | ||
local aut, hol, c, s , p, l, f, used, m, max; | ||
|
||
aut := AutomorphismGroup(ab); | ||
hol := SemidirectProduct(aut, ab); | ||
|
||
l := []; | ||
used := []; | ||
|
||
for c in ConjugacyClassesSubgroups(hol) do | ||
|
||
if Size(Representative(c)) <> Size(ab) then | ||
continue; | ||
fi; | ||
|
||
p := ConstructBrace(hol, Representative(c)); | ||
|
||
if not p = fail then | ||
Add(l, p); | ||
fi; | ||
od; | ||
|
||
return l; | ||
end; | ||
|
||
BracesWithAbelianGroupMAXIMAL:= function(ab) | ||
local aut, hol, c, s, p, l, f, used, m, max; | ||
|
||
aut := AutomorphismGroup(ab); | ||
hol := SemidirectProduct(aut, ab); | ||
|
||
l := []; | ||
used := []; | ||
|
||
max := ConjugacyClassesMaximalSubgroups(hol); | ||
Print("There are ", Size(max), " conjugacy classes of maximal subgroups\n"); | ||
|
||
for m in max do | ||
Print("Checking maximal: ", Position(max, m), " of size ", Size(Representative(m))); | ||
|
||
if Size(Representative(m)) mod Size(ab) <> 0 or IsSolvable(Representative(m)) = false then | ||
Print(" - Skipped!\n"); | ||
continue; | ||
else | ||
Print("\n"); | ||
fi; | ||
|
||
f := Filtered(ConjugacyClassesSubgroups(Representative(m)), x->Size(Representative(x)) = Size(ab)); | ||
for c in f do | ||
for s in c do | ||
|
||
if ForAny(used, x->IsConjugate(Image(Embedding(hol, 1)), s, x)) then | ||
continue; | ||
fi; | ||
|
||
Add(used, s); | ||
p := ConstructBrace(hol, s); | ||
|
||
if not p = fail then | ||
Add(l, p); | ||
fi; | ||
od; | ||
od; | ||
od; | ||
Print("--\n"); | ||
return l; | ||
end; | ||
|
||
BracesWithAbelianGroup2 := function(ab) | ||
local gr, aut, hol, c, s, p, l, f, used; | ||
|
||
aut := AutomorphismGroup(ab); | ||
hol := SemidirectProduct(aut, ab); | ||
|
||
l := []; | ||
used := []; | ||
|
||
for gr in AllGroups(Size, Size(ab), IsSolvable, true) do | ||
f := List(IsomorphicSubgroups(hol, gr), x->Image(x)); | ||
|
||
for s in f do | ||
|
||
if ForAny(used, x->IsConjugate(Image(Embedding(hol, 1)), s, x)) then | ||
continue; | ||
fi; | ||
|
||
Add(used, s); | ||
p := ConstructBrace(hol, s); | ||
|
||
if not p = fail then | ||
Add(l, p); | ||
fi; | ||
od; | ||
od; | ||
return l; | ||
end; | ||
|
||
MakeList := function(n, l) | ||
local k, x; | ||
|
||
Print("## size ", n, "\n"); | ||
Print("BRACES[", n, "] := rec( total := -1, implemented := ", -1, ", size := ", n, ", brace := [] );\n"); | ||
for k in [1..Size(l)] do | ||
Print("BRACES[", n, "].brace[", k, "] := rec ( size := ", n, ", perms :=\n", l[k] ); | ||
Print("\n);\n\n"); | ||
od; | ||
return Size(l); | ||
end; | ||
|
||
AllSkewbraces := function(size) | ||
local t, x, l, k, ad; | ||
|
||
k := 1; | ||
t := 0; | ||
|
||
for ad in AllGroups(Size, size) do | ||
Print("id: ", IdGroup(ad), "\n"); | ||
l := BracesWithAdditiveGroup(Image(IsomorphismPermGroup(ad))); | ||
for x in l do | ||
LogTo(); | ||
LogTo(Concatenation("SBsize", String(size), "_", String(k), ".dat")); | ||
MakeList(size, l); | ||
LogTo(); | ||
Print("found ", Size(l), "\n"); | ||
t := t+1; | ||
od; | ||
k := k+1; | ||
od; | ||
return t; | ||
end; | ||
|
||
AllSkewbracesByGroupId := function( id ) | ||
local t, x, l, ad, size, nr; | ||
|
||
size := id[1]; | ||
nr := id[2]; | ||
t := 0; | ||
|
||
ad :=SmallGroup( id ); | ||
Print("id: ", IdGroup(ad), "\n"); | ||
l := BracesWithAdditiveGroup(Image(IsomorphismPermGroup(ad))); | ||
for x in l do | ||
LogTo(); | ||
LogTo(Concatenation("SBsize", String(size), "_", String(nr), ".dat")); | ||
MakeList(size, l); | ||
LogTo(); | ||
Print("found ", Size(l), "\n"); | ||
t := t+1; | ||
od; | ||
|
||
return t; | ||
end; | ||
|
||
|
||
AllBraces := function(size) | ||
local x, l, ab; | ||
|
||
l := []; | ||
|
||
for ab in AllGroups(Size, size, IsAbelian, true) do | ||
Print("id: ", IdGroup(ab), "\n"); | ||
for x in BracesWithAdditiveGroup(Image(IsomorphismPermGroup(ab))) do | ||
Add(l, x); | ||
od; | ||
od; | ||
|
||
return l; | ||
end; | ||
|
||
#IsYB := function(group) | ||
# local f, s, ab, hol, aut, used; | ||
# | ||
# if not IsSolvable(group) then | ||
# return false; | ||
# fi; | ||
# | ||
# for ab in AllGroups(Size, Size(group), IsAbelian, true) do | ||
# | ||
# aut := AutomorphismGroup(ab); | ||
# hol := SemidirectProduct(aut, ab); | ||
# | ||
# used := []; | ||
# | ||
# f := IsomorphicSubgroups(hol, group); | ||
# | ||
# if f <> [] then | ||
# for s in List(f, x->Image(x)) do | ||
# | ||
# if ForAny(used, x->IsConjugate(Image(Embedding(hol, 1)), s, x)) then | ||
# continue; | ||
# fi; | ||
# | ||
# Add(used, s); | ||
# | ||
# if ForAll(Image(Embedding(hol, 2)), a->Number(s, x->x*a in Image(Embedding(hol, 1)))=1) then | ||
# return true; | ||
# fi; | ||
# od; | ||
# fi; | ||
# od; | ||
# return false; | ||
#end; |
Oops, something went wrong.