/usr/lib/python2.7/dist-packages/PySPH-1.0a4.dev0-py2.7-linux-x86_64.egg/pysph/parallel/parallel_manager.pxd is in python-pysph 0~20160514.git91867dc-4build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | # Numpy
cimport numpy as np
from cpython cimport dict
from cpython cimport list
# PyZoltan
from pyzoltan.core.carray cimport UIntArray, IntArray, DoubleArray, LongArray
from pyzoltan.core.zoltan cimport PyZoltan, ZoltanGeometricPartitioner
from pyzoltan.core.zoltan_comm cimport ZComm
from pyzoltan.czoltan.czoltan_types cimport ZOLTAN_ID_TYPE, ZOLTAN_ID_PTR, ZOLTAN_OK
# PySPH imports
from pysph.base.nnps cimport NNPSParticleArrayWrapper
from pysph.base.particle_array cimport ParticleArray
from pysph.base.point cimport *
cdef class ParticleArrayExchange:
############################################################################
# Data Attributes
############################################################################
cdef public int msglength_tag_remote # msg length tag for remote_exchange
cdef public int data_tag_remote # data tag for remote_exchange
cdef public int msglength_tag_lb # msg length tag for lb_exchange
cdef public int data_tag_lb # data tag for lb_exchange
cdef public int pa_index # Particle index
cdef public ParticleArray pa # Particle data
cdef public NNPSParticleArrayWrapper pa_wrapper # wrapper to exchange data
# flags to indicate whether data needs to be exchanged
cdef public bint lb_exchange
cdef public bint remote_exchange
cdef public size_t num_local # Total number of particles
cdef public size_t num_global # Global number of particles
cdef public size_t num_remote # Number of remote particles
cdef public size_t num_ghost # Number of ghost particles
# mpi.Comm object and associated rank and size
cdef public object comm
cdef public int rank, size
# list of load balancing props
cdef public list lb_props
cdef public int nprops
# Import/Export lists for particles
cdef public UIntArray exportParticleGlobalids
cdef public UIntArray exportParticleLocalids
cdef public IntArray exportParticleProcs
cdef public int numParticleExport
cdef public UIntArray importParticleGlobalids
cdef public UIntArray importParticleLocalids
cdef public IntArray importParticleProcs
cdef public int numParticleImport
############################################################################
# Member functions
############################################################################
# exchange data given send and receive lists
cdef exchange_data(self, ZComm zcomm, dict sendbufs, int count)
# base class for all parallel managers
cdef class ParallelManager:
############################################################################
# Data Attributes
############################################################################
# mpi comm, rank and size
cdef public object comm
cdef public int rank
cdef public int size
cdef public np.ndarray dt_sendbuf # array for global reduction
cdef public np.ndarray dt_recvbuf # for time step calculation
cdef public int lb_freq # load balancing frequency
cdef public int lb_count # counter for current lb step
cdef public int ncells_local # number of local cells
cdef public int ncells_remote # number of remote cells
cdef public int ncells_total # total number of cells
cdef public list cell_list # list of cells
cdef public dict cell_map # index structure
cdef public int ghost_layers # BOunding box size
cdef public double cell_size # cell size used for binning
# list of particle arrays, wrappers, exchange and nnps instances
cdef public list particles
cdef public list pa_wrappers
cdef public list pa_exchanges
# number of local and remote particles
cdef public list num_local
cdef public list num_remote
cdef public list num_global
cdef public double radius_scale # Radius scale for kernel
cdef public bint initial_update
cdef public bint update_cell_sizes
# number of arrays
cdef int narrays
# boolean for parallel
cdef bint in_parallel
# Min and max across all processors
cdef np.ndarray minx, miny, minz # min and max arrays used
cdef np.ndarray maxx, maxy, maxz # for MPI Allreduce
cdef np.ndarray maxh # operations
cdef public double mx, my, mz # global min and max values
cdef public double Mx, My, Mz, Mh
# global indices for the cells
cdef UIntArray cell_gid
# cell coordinate values
cdef DoubleArray cx, cy, cz
# Import/Export lists for cells
cdef public UIntArray exportCellGlobalids
cdef public UIntArray exportCellLocalids
cdef public IntArray exportCellProcs
cdef public int numCellExport
cdef public UIntArray importCellGlobalids
cdef public UIntArray importCellLocalids
cdef public IntArray importCellProcs
cdef public int numCellImport
############################################################################
# Member functions
############################################################################
# Index particles given by a list of indices. The indices are
# assumed to be of type unsigned int and local to the NNPS object
cdef _bin(self, int pa_index, UIntArray indices)
# Compute the cell size across processors. The cell size is taken
# as max(h)*radius_scale
cpdef compute_cell_size(self)
# compute global bounds for the particle distribution. The bounds
# are the min and max coordinate values across all processors and
# the maximum smoothing length needed for parallel binning.
cdef _compute_bounds(self)
# nearest neighbor search routines taking into account multiple
# particle arrays
cpdef get_nearest_particles(self, int src_index, int dst_index,
size_t d_idx, UIntArray nbrs)
# Zoltan based parallel cell manager for SPH simulations
cdef class ZoltanParallelManager(ParallelManager):
############################################################################
# Data Attributes
############################################################################
cdef public int changes # logical (0,1) if the partition changes
cdef public PyZoltan pz # the PyZoltan wrapper for lb etc
# Class of geometric load balancers
cdef class ZoltanParallelManagerGeometric(ZoltanParallelManager):
pass
|