Skip to content

Commit 97865ff

Browse files
authored
Merge pull request #24 from gap-packages/ww/remove-syntax-warnings-when-no-IO
Avoid syntax warnings when IO is not loaded
2 parents 24ceb5d + 5ac62ce commit 97865ff

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

lib/serre.gi

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ end;
339339
# method to get irreducibles from that. Uses orthonormal basis for
340340
# C_rho if given.
341341
IrreducibleDecompositionCollectedHybrid@ := function(rho)
342-
local irreps, G, irred_decomp, do_decompose, parallel;
342+
local irreps, G, irred_decomp, do_decompose, parallel, ParListByFork;
343343
G := Source(rho);
344344
irreps := ValueOption("irreps");
345345
if irreps = fail then
@@ -352,6 +352,12 @@ IrreducibleDecompositionCollectedHybrid@ := function(rho)
352352
IrrepCanonicalSummand@(rho,
353353
irrep));
354354
parallel := ValueOption("parallel");
355+
if IsBoundGlobal("ParListByFork") then
356+
ParListByFork := ValueGlobal("ParListByFork");
357+
elif parallel <> fail then
358+
Error("The GAP package IO must be loaded to use the parallel option!");
359+
fi;
360+
355361
if IsInt(parallel) then
356362
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := parallel));
357363
elif parallel <> fail then
@@ -364,7 +370,7 @@ IrreducibleDecompositionCollectedHybrid@ := function(rho)
364370
end;
365371

366372
InstallMethod( REPN_ComputeUsingSerre, "for linear reps", [ IsGroupHomomorphism ], function(rho)
367-
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;
373+
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;
368374

369375
G := Source(rho);
370376

@@ -394,20 +400,18 @@ InstallMethod( REPN_ComputeUsingSerre, "for linear reps", [ IsGroupHomomorphism
394400
end;
395401

396402
parallel := ValueOption("parallel");
403+
if IsBoundGlobal("ParListByFork") then
404+
ParListByFork := ValueGlobal("ParListByFork");
405+
elif parallel <> fail then
406+
Error("The GAP package IO must be loaded to use the parallel option!");
407+
fi;
397408

398-
if parallel <> fail then
399-
# if the parallel option is set
400-
if IsPackageMarkedForLoading("IO", ">= 4.7.0") then
401-
if IsInt(parallel) then
402-
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := parallel));
403-
else
404-
# we default the number of jobs to 4 since everyone
405-
# has 4 threads, at least
406-
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := 4));
407-
fi;
408-
else
409-
Error("I need the package IO >= 4.7.0 to use the parallel option!");
410-
fi;
409+
if IsInt(parallel) then
410+
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := parallel));
411+
elif parallel <> fail then
412+
# we default the number of jobs to 4 since everyone
413+
# has 4 threads, at least
414+
irred_decomp := ParListByFork(irreps, do_decompose, rec(NumberJobs := 4));
411415
else
412416
irred_decomp := List(irreps, do_decompose);
413417
fi;

0 commit comments

Comments
 (0)