-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
5,105 additions
and
1,767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,123 @@ | ||
# Copyright (C) 2014-2015 Lindley Graham and Steven Mattis | ||
|
||
""" | ||
This module provides a workaround for people without mpi4py installed | ||
This module provides a workaround for people without mpi4py installed | ||
to run BET. | ||
""" | ||
|
||
class comm_for_no_mpi4py: | ||
|
||
class comm_for_no_mpi4py(object): | ||
|
||
""" | ||
Provides a fake MPI.COMM_WORLD implementation so that the user need not | ||
install mpi4py. | ||
""" | ||
|
||
def __init__(self): | ||
""" | ||
Initialization | ||
""" | ||
pass | ||
|
||
def Get_size(self): | ||
""" | ||
:rtype: int | ||
:returns: 1 | ||
""" | ||
return 1 | ||
|
||
def Get_rank(self): | ||
return 0 | ||
def allgather(self,val): | ||
""" | ||
:rtype: int | ||
:returns 0 | ||
""" | ||
return 0 | ||
|
||
def allgather(self, val): | ||
""" | ||
:param object val: object to allgather | ||
:rtype: object | ||
:returns: val | ||
""" | ||
return val | ||
def allreduce(self,val1, op=None): | ||
|
||
def allreduce(self, val1, op=None): | ||
""" | ||
:param object val1: object to allreduce | ||
:rtype: object | ||
:returns: val1 | ||
""" | ||
return val1 | ||
def bcast(self,val, root=0): | ||
return val | ||
def Allgather(self,val): | ||
|
||
def bcast(self, val, root=0): | ||
""" | ||
:param object val: object to broadcast | ||
:param int root: 0 | ||
:rtype: object | ||
:returns: val | ||
""" | ||
return val | ||
def Allreduce(self,val1, val2, op=None): | ||
|
||
def Allgather(self, val): | ||
""" | ||
:param object val: object to Allgather | ||
:rtype: object | ||
:returns: val | ||
""" | ||
return val | ||
|
||
def Allreduce(self, val1, val2, op=None): | ||
""" | ||
:param object val1: object to Allreduce | ||
:param object val2: object to Allreduce | ||
:param op: None | ||
:rtype: object | ||
:returns: val1 | ||
""" | ||
return val1 | ||
def Bcast(self,val, root=0): | ||
|
||
def Bcast(self, val, root=0): | ||
""" | ||
:param object val: object to gather | ||
:param int root: 0 | ||
:rtype: object | ||
:returns: val | ||
""" | ||
return val | ||
|
||
def Scatter(self, val1, val2, root=0): | ||
""" | ||
:param object val1: object to Scatter | ||
:param object val2: object to Scatter | ||
:param int root: 0 | ||
:rtype: object | ||
:returns: val1 | ||
""" | ||
return val1 | ||
|
||
class MPI_for_no_mpi4py: | ||
|
||
class MPI_for_no_mpi4py(object): | ||
|
||
""" | ||
Provides a fake MPI implementation so that the user need not install | ||
mpi4py. | ||
""" | ||
|
||
def __init__(self): | ||
""" | ||
Initialization | ||
""" | ||
self.SUM = None | ||
self.DOUBLE = float | ||
self.INT = int | ||
|
||
self.BOOL = bool | ||
|
||
try: | ||
from mpi4py import MPI | ||
comm = MPI.COMM_WORLD | ||
except ImportError: | ||
MPI = MPI_for_no_mpi4py() | ||
comm = comm_for_no_mpi4py() | ||
|
||
size = comm.Get_size() | ||
rank = comm.Get_rank() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# Copyright (C) 2014-2015 Lindley Graham and Steven Mattis | ||
|
||
__all__ = ['sampling', 'calculateP', 'postProcess', 'loadBalance', 'util','Comm'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
r""" | ||
This subpackage provides classes and methods for calulating the probability | ||
measure :math:`P_{\Lambda}`. | ||
# Copyright (C) 2014-2015 Lindley Graham and Steven Mattis | ||
|
||
* :mod:`~bet.calculateP.calculateP` provides methods for approximating probability | ||
densities | ||
* :mod:`~bet.calculateP.simpleFunP` provides methods for creating simple function | ||
approximations of probability densisties | ||
r""" | ||
This subpackage provides classes and methods for calulating the | ||
probability measure :math:`P_{\Lambda}`. | ||
* :mod:`~bet.calculateP.calculateP` provides methods for approximating | ||
probability densities | ||
* :mod:`~bet.calculateP.simpleFunP` provides methods for creating simple | ||
function approximations of probability densisties | ||
* :mod:`~bet.calculateP.voronoiHistogram` provides methods for creating the | ||
generating points for cells that define a regular grid for use by | ||
:meth:`numpy.histogramdd` and for determining their volumes, etc. This | ||
module is only for use by :mod:`~bet.calculateP.simpleFunP`. | ||
""" | ||
__all__ = ['calculateP', 'simpleFunP', 'voronoiHistogram'] |
Oops, something went wrong.