Optimized so that new_from_old mappings are not sent for subtables.

This commit is contained in:
Dongryeol Lee
2011-02-01 04:46:47 +00:00
parent 8063d2651e
commit e50a8dfcd6
3 changed files with 3 additions and 17 deletions
@@ -49,8 +49,6 @@ class TableExchange {
std::vector< typename TableType::OldFromNewIndexType *> old_from_new_cache_;
std::vector<int *> new_from_old_cache_;
/** @brief The circular buffer that acts as the cache of received
* subtables.
*/
@@ -118,11 +116,9 @@ class TableExchange {
if(old_from_new_cache_[i] != NULL) {
if(core::table::global_m_file_) {
core::table::global_m_file_->DestroyPtr(old_from_new_cache_[i]);
core::table::global_m_file_->DestroyPtr(new_from_old_cache_[i]);
}
else {
delete[](old_from_new_cache_[i]);
delete[](new_from_old_cache_[i]);
}
}
}
@@ -163,7 +159,6 @@ class TableExchange {
// Preallocate the point cache.
point_cache_.resize(world.size());
old_from_new_cache_.resize(world.size());
new_from_old_cache_.resize(world.size());
received_subtables_.resize(world.size());
for(int i = 0; i < world.size(); i++) {
received_subtables_[i].set_capacity(subtable_cache_size_per_process);
@@ -180,16 +175,9 @@ class TableExchange {
typename TableType::OldFromNewIndexType > (
distributed_table.local_n_entries(i)) :
new OldFromNewIndexType[ distributed_table.local_n_entries(i)];
new_from_old_cache_[i] =
(core::table::global_m_file_) ?
core::table::global_m_file_->ConstructArray <
int > (
distributed_table.local_n_entries(i)) :
new int[ distributed_table.local_n_entries(i)];
}
else {
old_from_new_cache_[i] = NULL;
new_from_old_cache_[i] = NULL;
}
}
}
@@ -256,7 +244,7 @@ class TableExchange {
if(receive_requests[j].size() > 0) {
received_subtables_in_this_round[j].push_back(
j, point_cache_[j], old_from_new_cache_[j],
new_from_old_cache_[j], max_num_levels_to_serialize);
max_num_levels_to_serialize);
}
}
@@ -436,7 +436,6 @@ class SubTable {
void Init(
int rank_in, core::table::DenseMatrix &data_alias_in,
OldFromNewIndexType *old_from_new_alias_in,
int *new_from_old_alias_in,
int max_num_levels_to_serialize_in) {
table_ = (core::table::global_m_file_) ?
core::table::global_m_file_->Construct<TableType>() :
@@ -448,7 +447,7 @@ class SubTable {
table_->set_rank(rank_in);
// Alias the incoming mappings.
table_->Alias(old_from_new_alias_in, new_from_old_alias_in);
table_->Alias(old_from_new_alias_in, (int *) NULL);
// Finalize the intialization.
this->Init(table_, (TreeType *) NULL, max_num_levels_to_serialize_in);
@@ -86,11 +86,10 @@ class SubTableList {
void push_back(
int rank_in, core::table::DenseMatrix &data_alias_in,
OldFromNewIndexType *old_from_new_alias_in,
int *new_from_old_alias_in,
int max_num_levels_to_serialize_in) {
list_.resize(list_.size() + 1);
list_[list_.size() - 1].Init(
rank_in, data_alias_in, old_from_new_alias_in, new_from_old_alias_in,
rank_in, data_alias_in, old_from_new_alias_in,
max_num_levels_to_serialize_in);
}