Boolean-Cayley-graphs / boolean_cayley_graphs / __pycache__ / classify_in_mpi_parallel.cpython-39-pytest-6.2.5.pyc
22144 viewsa �Ul_� � @ s~ d Z ddlZddlm mZ ddlmZ ddl m Z ddlmZ ddl mZ ddlmZ ddlmZ dd d �Zddd �ZdS )a Classification in parallel using MPI ==================================== The ``classify_in_mpi_parallel`` module defines functions that use MPI to save Cayley graph classifications or partial classifications in parallel. AUTHORS: - Paul Leopardi (2017-10-13) � N)�log)�BooleanFunction)� Function_ceil)�BentFunction)�save_one_classification)�save_one_class_partc C sl | � � }| �� }|dkr t|�}t|| ||�D ]6}|d t|� } t|| �jdd�} t| | |d� q0dS )a� Using MPI, construct and save a number of Cayley graph classifications corresponding to a list of bent functions. INPUT: - ``comm`` -- MPI communicator. - ``name_prefix`` -- String. Name prefix to use with ``save_mangled`` to save each classification. - ``list_of_f`` -- List of forms or bent functions. - ``start`` -- Integer. Default=0. Index of start position in the list. - ``stop`` -- Integer. Default=None. Index after end position, or ``None`` if whole remaining list. - ``directory`` -- string, optional. The directory where the object is to be saved. Default is None, meaning the current directory. OUTPUT: None. EFFECT: Uses ``name`` to save the classifications corresponding to ``list_of_f``. N�_�hex)�format)� directory)�Get_rank�Get_size�len�range�strr �truth_tabler )�comm�name_prefixZ list_of_f�start�stopr �rank�size�n�name�form� r �R/home/user/Boolean-Cayley-graphs/boolean_cayley_graphs/classify_in_mpi_parallel.py� save_classifications_in_parallel s �r � c C s� | � � }| �� }t|�}|�� }d| } t� } | | d | �}||krX|| }|d } n|}|} | t|d��}t|| |�D ]8}dj||d�}t|d | ||| ||d |d� qzd S ) a� Using MPI, construct a complete list of the partial Cayley graph classifications corresponding to a given bent function or algebraic normal form. INPUT: - ``comm`` -- MPI communicator. - ``name_prefix`` -- String. Name prefix to use with ``save_mangled`` to save each class part. - ``form`` -- A bent function or an algebraic normal form. - ``c_len`` -- Integer. Default=1. The number of values of `c` to use in each class part. - ``directory`` -- string, optional. The directory where the object is to be saved. Default is None, meaning the current directory. OUTPUT: None. EFFECT: Uses ``name_prefix`` to save all partial classifications corresponding to ``bentf``. � g �?r � z {0:0={width}})�widthr )r �bentf�c_start�c_stopr N) r r r � nvariablesr r r r r )r r r �c_lenr r r r"