Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions arcane/src/arcane/mesh/ItemInternalMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,18 @@ class ARCANE_MESH_EXPORT ItemInternalMap
return (m_new_impl.find(key) != m_new_impl.end());
}

//! Resizes the hash table
void resize([[maybe_unused]] Int32 new_size, [[maybe_unused]] bool use_prime = false)
/*!
* \brief Makes room for \a new_size entries.
*
* Called before a batch of insertions by a family that knows how many items it
* is about to add, so that the table is sized once instead of growing by
* doubling and rehashing at each step. \a use_prime belonged to the previous
* implementation and is ignored.
*/
void resize(Int32 new_size, [[maybe_unused]] bool use_prime = false)
{
if (new_size > 0)
m_new_impl.reserve(static_cast<uint64_t>(new_size), false);
}

/*!
Expand Down
6 changes: 5 additions & 1 deletion arcane/src/arcane/std/CartesianMeshGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,11 @@ generateMesh()

// Création hash-table des noeuds et préparation de leurs uid
UniqueArray<Int64> nodes_unique_id(CheckedConvert::toInteger(own_nb_node_xyz));
HashTableMapT<Int64, NodeInfo> nodes_infos(CheckedConvert::toInteger(own_nb_node_xyz), true);
// The size of a HashTableMapT is a number of buckets and not a number of
// entries: it rehashes as soon as its count passes 0.85 * nb_bucket, so the
// table is sized for the load factor and holds every node without rehashing.
const Int64 wanted_bucket = static_cast<Int64>(own_nb_node_xyz / 0.85) + 1;
HashTableMapT<Int64, NodeInfo> nodes_infos(CheckedConvert::toInteger(wanted_bucket), true);

// Calcule des infos blocs et des offset associés à tous les sub_domain_id
IntegerUniqueArray sd_x_ibl, sd_x_obl; // Numéro et offset dans le bloc
Expand Down
Loading