Skip to content

Commit

Permalink
Merged in reduce-boost (pull request #128)
Browse files Browse the repository at this point in the history
Reduce boost::python dead code, fewer warnings, major C++ cleanup.

Approved-by: Bradley Dice <bdice@bradleydice.com>
Approved-by: Vyas Ramasubramani <vramasub@umich.edu>
  • Loading branch information
bdice authored and vyasr committed Feb 10, 2018
2 parents e009fb7 + 8ff5599 commit 63e8ef9
Show file tree
Hide file tree
Showing 350 changed files with 2,458 additions and 82,492 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ references:

get_requirements_ubuntu: &get_requirements_ubuntu
run:
name: install dependencies
name: Install dependencies
command: |
pip install --user -r requirements.txt
pip3 install --user -r requirements.txt
get_requirements_arch: &get_requirements_arch
run:
name: install dependencies
name: Install dependencies
command: |
pip install --user -r requirements.txt
Expand All @@ -50,13 +50,13 @@ references:
test_ubuntu: &test_ubuntu
run:
name: run tests
name: Run unit tests
command: |
${NOSE} ~/ci/freud/tests/
test_arch: &test_arch
run:
name: run tests
name: Run unit tests
command: |
cd /
${NOSE} -v ~/ci/freud/tests/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "extern/fsph"]
path = extern/fsph
url = https://bitbucket.org/glotzer/fsph.git
[submodule "extern/Eigen"]
path = extern/Eigen
url = https://github.com/glotzerlab/eigen-git-mirror.git
81 changes: 0 additions & 81 deletions cpp/bond/BondingAnalysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,85 +73,6 @@ BondingAnalysis::~BondingAnalysis()
delete m_bond_increment_array;
}

// void BondingAnalysis::reduceArrays()
// {
// Index2D transition_indexer = Index2D((m_num_bonds+1), (m_num_bonds+1));
// // set all values in the transition matrix to 0
// memset((void*)m_transition_matrix.get(), 0, sizeof(unsigned int)*(m_num_bonds+1)*(m_num_bonds+1));
// // clear out bond lifetime arrays; don't need to resize cause they are already appropriately sized
// for (std::vector< std::vector<unsigned int> >::iterator it = m_bond_lifetime_array.begin();
// it != m_bond_lifetime_array.end(); ++it)
// {
// (*it).clear();
// }
// for (std::vector< std::vector<unsigned int> >::iterator it = m_overall_lifetime_array.begin();
// it != m_overall_lifetime_array.end(); ++it)
// {
// (*it).clear();
// }
// // I do not use parallel reduction in this case due to data structures not being thread safe...
// // transfer data into bond_lifetime array
// // for each pidx
// for (unsigned int i = 0; i < m_num_bonds; i++)
// {
// // for each thread local memory
// for (tbb::enumerable_thread_specific< std::vector< std::vector< unsigned int > > >::const_iterator local_lifetime = m_local_bond_lifetime_array.begin();
// local_lifetime != m_local_bond_lifetime_array.end(); ++local_lifetime)
// {
// for (std::vector< std::vector< unsigned int > >::const_iterator outer_it = (*local_lifetime).begin();
// outer_it != (*local_lifetime).end(); ++outer_it)
// {
// for (std::vector< unsigned int >::const_iterator inner_it = (*outer_it).begin();
// inner_it != (*outer_it).end(); ++inner_it)
// {
// printf("%u ", (*inner_it));
// m_bond_lifetime_array[i].push_back((*inner_it));
// }
// }
// }
// }
// for (unsigned int i = 0; i < m_num_bonds; i++)
// {
// std::vector< unsigned int >::iterator it;
// for (it = m_bond_lifetime_array[i].begin(); it != m_bond_lifetime_array[i].end(); ++it)
// {
// printf("%u ", (*it));
// }
// printf("\n");
// }
// // transfer data into overall_lifetime array
// // for each pidx
// for (unsigned int i = 0; i < m_num_bonds; i++)
// {
// // for each thread local memory
// for (tbb::enumerable_thread_specific< std::vector< std::vector< unsigned int > > >::const_iterator local_lifetime = m_local_overall_lifetime_array.begin();
// local_lifetime != m_local_overall_lifetime_array.end(); ++local_lifetime)
// {
// for (std::vector< std::vector< unsigned int > >::const_iterator outer_it = (*local_lifetime).begin();
// outer_it != (*local_lifetime).end(); ++outer_it)
// {
// for (std::vector< unsigned int >::const_iterator inner_it = (*outer_it).begin();
// inner_it != (*outer_it).end(); ++inner_it)
// {
// m_overall_lifetime_array[i].push_back((*inner_it));
// }
// }
// }
// }
// // transfer into transition matrix
// for (unsigned int i = 0; i < (m_num_bonds+1); i++)
// {
// for (unsigned int j = 0; j < (m_num_bonds+1); j++)
// {
// for (tbb::enumerable_thread_specific< unsigned int *>::const_iterator local_transition = m_local_transition_matrix.begin();
// local_transition != m_local_transition_matrix.end(); ++local_transition)
// {
// m_transition_matrix.get()[transition_indexer(i, j)] += (*local_transition)[transition_indexer(i, j)];
// }
// }
// }
// }

std::vector< std::vector< unsigned int> > BondingAnalysis::getBondLifetimes()
{
return m_bond_lifetime_array;
Expand Down Expand Up @@ -416,5 +337,3 @@ void BondingAnalysis::compute(unsigned int* frame0,
}

}; }; // end namespace freud::bond


24 changes: 12 additions & 12 deletions cpp/bond/BondingR12.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,22 @@ class BondingR12
}

private:
box::Box m_box; //!< Simulation box the particles belong in
float m_r_max; //!< Maximum r at which to determine neighbors
float m_t_max; //!< Maximum theta at which to determine neighbors
box::Box m_box; //!< Simulation box where the particles belong
float m_r_max; //!< Maximum r at which to determine neighbors
float m_t_max; //!< Maximum theta at which to determine neighbors
float m_dr;
float m_dt1;
float m_dt2;
unsigned int m_nbins_r; //!< Number of x bins to compute bonds
unsigned int m_nbins_t1; //!< Number of y bins to compute bonds
unsigned int m_nbins_t2; //!< Number of y bins to compute bonds
unsigned int m_n_bonds; //!< number of bonds to track
unsigned int *m_bond_map; //!< pointer to bonding map
unsigned int m_nbins_r; //!< Number of r bins to compute bonds
unsigned int m_nbins_t2; //!< Number of t2 bins to compute bonds
unsigned int m_nbins_t1; //!< Number of t1 bins to compute bonds
unsigned int m_n_bonds; //!< number of bonds to track
unsigned int *m_bond_map; //!< pointer to bonding map
unsigned int *m_bond_list;
std::map<unsigned int, unsigned int> m_list_map; //! maps bond index to list index
std::map<unsigned int, unsigned int> m_rev_list_map; //! maps list index to bond index
unsigned int m_n_ref; //!< Last number of points computed
unsigned int m_n_p; //!< Last number of points computed
std::map<unsigned int, unsigned int> m_list_map; //! maps bond index to list index
std::map<unsigned int, unsigned int> m_rev_list_map; //! maps list index to bond index
unsigned int m_n_ref; //!< Last number of points computed
unsigned int m_n_p; //!< Last number of points computed

std::shared_ptr<unsigned int> m_bonds;
};
Expand Down
10 changes: 5 additions & 5 deletions cpp/bond/BondingXY2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ class BondingXY2D
}

private:
box::Box m_box; //!< Simulation box the particles belong in
box::Box m_box; //!< Simulation box where the particles belong
float m_r_max; //!< Maximum r at which to determine neighbors
float m_x_max; //!< Maximum r at which to determine neighbors
float m_y_max; //!< Maximum theta at which to determine neighbors
float m_dx;
float m_dy;
unsigned int m_nbins_x; //!< Number of x bins to compute bonds
unsigned int m_nbins_y; //!< Number of y bins to compute bonds
unsigned int m_n_bonds; //!< number of bonds to track
unsigned int *m_bond_map; //!< pointer to bonding map
unsigned int m_n_bonds; //!< number of bonds to track
unsigned int *m_bond_map; //!< pointer to bonding map
unsigned int *m_bond_list;
std::map<unsigned int, unsigned int> m_list_map; //! maps bond index to list index
std::map<unsigned int, unsigned int> m_rev_list_map; //! maps list index to bond index
std::map<unsigned int, unsigned int> m_list_map; //! maps bond index to list index
std::map<unsigned int, unsigned int> m_rev_list_map; //! maps list index to bond index
unsigned int m_n_ref; //!< Last number of points computed
unsigned int m_n_p; //!< Last number of points computed

Expand Down
14 changes: 7 additions & 7 deletions cpp/bond/BondingXYT.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class BondingXYT
}

private:
box::Box m_box; //!< Simulation box the particles belong in
box::Box m_box; //!< Simulation box where the particles belong
float m_r_max; //!< Maximum r at which to determine neighbors
float m_x_max; //!< Maximum r at which to determine neighbors
float m_y_max; //!< Maximum theta at which to determine neighbors
Expand All @@ -87,13 +87,13 @@ class BondingXYT
unsigned int m_nbins_x; //!< Number of x bins to compute bonds
unsigned int m_nbins_y; //!< Number of y bins to compute bonds
unsigned int m_nbins_t; //!< Number of y bins to compute bonds
unsigned int m_n_bonds; //!< number of bonds to track
unsigned int *m_bond_map; //!< pointer to bonding map
unsigned int m_n_bonds; //!< number of bonds to track
unsigned int *m_bond_map; //!< pointer to bonding map
unsigned int *m_bond_list;
std::map<unsigned int, unsigned int> m_list_map; //! maps bond index to list index
std::map<unsigned int, unsigned int> m_rev_list_map; //! maps list index to bond index
unsigned int m_n_ref; //!< Last number of points computed
unsigned int m_n_p; //!< Last number of points computed
std::map<unsigned int, unsigned int> m_list_map; //! maps bond index to list index
std::map<unsigned int, unsigned int> m_rev_list_map; //! maps list index to bond index
unsigned int m_n_ref; //!< Last number of points computed
unsigned int m_n_p; //!< Last number of points computed

std::shared_ptr<unsigned int> m_bonds;
};
Expand Down
14 changes: 7 additions & 7 deletions cpp/bond/BondingXYZ.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class BondingXYZ
}

private:
box::Box m_box; //!< Simulation box the particles belong in
box::Box m_box; //!< Simulation box where the particles belong
float m_r_max; //!< Maximum r at which to determine neighbors
float m_x_max; //!< Maximum r at which to determine neighbors
float m_y_max; //!< Maximum theta at which to determine neighbors
Expand All @@ -88,13 +88,13 @@ class BondingXYZ
unsigned int m_nbins_x; //!< Number of x bins to compute bonds
unsigned int m_nbins_y; //!< Number of y bins to compute bonds
unsigned int m_nbins_z; //!< Number of y bins to compute bonds
unsigned int m_n_bonds; //!< number of bonds to track
unsigned int *m_bond_map; //!< pointer to bonding map
unsigned int m_n_bonds; //!< number of bonds to track
unsigned int *m_bond_map; //!< pointer to bonding map
unsigned int *m_bond_list;
std::map<unsigned int, unsigned int> m_list_map; //! maps bond index to list index
std::map<unsigned int, unsigned int> m_rev_list_map; //! maps list index to bond index
unsigned int m_n_ref; //!< Last number of points computed
unsigned int m_n_p; //!< Last number of points computed
std::map<unsigned int, unsigned int> m_list_map; //! maps bond index to list index
std::map<unsigned int, unsigned int> m_rev_list_map; //! maps list index to bond index
unsigned int m_n_ref; //!< Last number of points computed
unsigned int m_n_p; //!< Last number of points computed

std::shared_ptr<unsigned int> m_bonds;
};
Expand Down
2 changes: 1 addition & 1 deletion cpp/box/box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
using namespace std;
namespace freud { namespace box {

}; };
}; }; // end namespace freud::box

0 comments on commit 63e8ef9

Please sign in to comment.