Open with one click!
1
r"""
2
"""
3
#*****************************************************************************
4
# Copyright (C) 2017 Paul Leopardi [email protected]
5
#
6
# Distributed under the terms of the GNU General Public License (GPL)
7
# as published by the Free Software Foundation; either version 2 of
8
# the License, or (at your option) any later version.
9
# http://www.gnu.org/licenses/
10
#*****************************************************************************
11
12
import sys
13
14
from mpi4py import MPI
15
from sage.all_cmdline import *
16
17
from boolean_cayley_graphs.classify_in_mpi_parallel import save_class_parts_in_parallel
18
19
r"""
20
"""
21
# Check that the correct number of arguments exist.
22
if len(sys.argv) != 4:
23
print("Usage: save_dim_in_mpi_parallel dim fnbr c_len")
24
sys.exit(1)
25
26
# Convert the arguments to int.
27
dim = int(sys.argv[1])
28
fnbr = int(sys.argv[2])
29
c_len = int(sys.argv[3])
30
31
# Get our MPI rank.
32
comm = MPI.COMM_WORLD
33
rank = comm.Get_rank()
34
35
# Load the required bent function.
36
load("bent_function_extended_affine_representative_polynomials.sage")
37
list_of_f = bent_function_extended_affine_representative_polynomials(dim)
38
bentf = list_of_f[fnbr]
39
40
# Save the classification in parts with c_len matrix rows each.
41
save_class_parts_in_parallel(comm, "p"+str(dim)+"_"+str(fnbr), bentf, c_len=c_len)
42
sys.exit(0)
43
44