Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions lib/serre.gi
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ end;
# method to get irreducibles from that. Uses orthonormal basis for
# C_rho if given.
IrreducibleDecompositionCollectedHybrid@ := function(rho)
local irreps, G, irred_decomp, do_decompose, parallel;
local irreps, G, irred_decomp, do_decompose, parallel, ParListByFork;
G := Source(rho);
irreps := ValueOption("irreps");
if irreps = fail then
Expand All @@ -352,6 +352,12 @@ IrreducibleDecompositionCollectedHybrid@ := function(rho)
IrrepCanonicalSummand@(rho,
irrep));
parallel := ValueOption("parallel");
if IsBoundGlobal("ParListByFork") then
ParListByFork := ValueGlobal("ParListByFork");
elif parallel <> fail then
Error("The GAP package IO must be loaded to use the parallel option!");
fi;

if IsInt(parallel) then
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := parallel));
elif parallel <> fail then
Expand All @@ -364,7 +370,7 @@ IrreducibleDecompositionCollectedHybrid@ := function(rho)
end;

InstallMethod( REPN_ComputeUsingSerre, "for linear reps", [ IsGroupHomomorphism ], function(rho)
local irreps, irr_chars, centralizer_basis, irred_decomp, new_bases, basis, basis_change, diag_rho, char_rho_basis, all_sizes, sizes, centralizer_blocks, G, parallel, do_decompose;
local irreps, irr_chars, centralizer_basis, irred_decomp, new_bases, basis, basis_change, diag_rho, char_rho_basis, all_sizes, sizes, centralizer_blocks, G, parallel, do_decompose, ParListByFork;

G := Source(rho);

Expand Down Expand Up @@ -394,20 +400,18 @@ InstallMethod( REPN_ComputeUsingSerre, "for linear reps", [ IsGroupHomomorphism
end;

parallel := ValueOption("parallel");
if IsBoundGlobal("ParListByFork") then
ParListByFork := ValueGlobal("ParListByFork");
elif parallel <> fail then
Error("The GAP package IO must be loaded to use the parallel option!");
fi;

if parallel <> fail then
# if the parallel option is set
if IsPackageMarkedForLoading("IO", ">= 4.7.0") then
if IsInt(parallel) then
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := parallel));
else
# we default the number of jobs to 4 since everyone
# has 4 threads, at least
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := 4));
fi;
else
Error("I need the package IO >= 4.7.0 to use the parallel option!");
fi;
if IsInt(parallel) then
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := parallel));
elif parallel <> fail then
# we default the number of jobs to 4 since everyone
# has 4 threads, at least
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := 4));
else
irred_decomp := List(irreps, do_decompose);
fi;
Expand Down