r"""1"""2#*****************************************************************************3# Copyright (C) 2017 Paul Leopardi [email protected]4#5# Distributed under the terms of the GNU General Public License (GPL)6# as published by the Free Software Foundation; either version 2 of7# the License, or (at your option) any later version.8# http://www.gnu.org/licenses/9#*****************************************************************************1011import sys1213from mpi4py import MPI14from sage.all_cmdline import *1516from boolean_cayley_graphs.classify_in_mpi_parallel import save_class_parts_in_parallel1718r"""19"""20# Check that the correct number of arguments exist.21if len(sys.argv) != 4:22print("Usage: save_cast128_in_mpi_parallel bnbr fnbr c_len")23sys.exit(1)2425# Convert the arguments to int.26bnbr = int(sys.argv[1]) # S-box number27fnbr = int(sys.argv[2]) # Function number within S-box28c_len = int(sys.argv[3]) # Number of c values per class part.2930# Get our MPI rank.31comm = MPI.COMM_WORLD32rank = comm.Get_rank()3334# Load the required bent function.35load("read_cast_128_s_boxes.sage")36s_boxes = read_s_boxes_file()37bentf = s_boxes[bnbr][fnbr]3839# Save the classification in parts with c_len matrix rows each.40save_class_parts_in_parallel(41comm,42"cast128_"+str(bnbr)+"_"+str(fnbr),43bentf,44c_len=c_len)45sys.exit(0)464748