# Path: blond/utils/bmath.py
# def use_mpi():
# def mpiMode():
# def use_fftw():
# def use_precision(_precision='double'):
# def update_active_dict(new_dict):


import sys
import os
import numpy as np
import logging
from functools import wraps
from ..utils import bmath as bm
from mpi4py import MPI
        print('[{}] Library: {}'.format(self.rank, MPI.get_vendor()))

    # class sequential_context:
    #     class SkipWithBlock(Exception):
    #         pass

    #     def __init__(self, beam, split_args={}, gather_args={}):
    #         self.beam = beam
    #         self.split_args = split_args
    #         self.gather_args = gather_args

    #     def __enter__(self):
    #         self.beam.split(**self.split_args)
    #         if not worker.isMaster:
    #             # Do some magic
    #             sys.settrace(lambda *args, **keys: None)
    #             frame = sys._getframe(1)
    #             frame.f_trace = self.trace

    #     def trace(self, fname, event, arg):
    #         raise self.SkipWithBlock()

    #     def __exit__(self, type, value, traceback):
    #         self.beam.gather(**self.gather_args)
    #         if type is None:
    #             return
    #         if issubclass(type, self.SkipWithBlock):
    #             return True



# Path: blond/utils/bmath.py
# def use_mpi():
# def mpiMode():
# def use_fftw():
# def use_precision(_precision='double'):
# def update_active_dict(new_dict):


# Path: blond/utils/mpi_config.py
import sys
import os
import numpy as np
import logging
from functools import wraps
from ..utils import bmath as bm
from mpi4py import MPI

        print('[{}] Library: {}'.format(self.rank, MPI.get_vendor()))

    # class sequential_context:
    #     class SkipWithBlock(Exception):
    #         pass

    #     def __init__(self, beam, split_args={}, gather_args={}):
    #         self.beam = beam
    #         self.split_args = split_args
    #         self.gather_args = gather_args

    #     def __enter__(self):
    #         self.beam.split(**self.split_args)
    #         if not worker.isMaster:
    #             # Do some magic
    #             sys.settrace(lambda *args, **keys: None)
    #             frame = sys._getframe(1)
    #             frame.f_trace = self.trace

    #     def trace(self, fname, event, arg):
    #         raise self.SkipWithBlock()

    #     def __exit__(self, type, value, traceback):
    #         self.beam.gather(**self.gather_args)
    #         if type is None:
    #             return
    #         if issubclass(type, self.SkipWithBlock):
    #             return True



class MPILog(object):