![]() |
Shamrock 2025.10.0
Astrophysical Code
|
MPI string gather / allgather helpers (declarations; implementations in shamalgs/src/collective/gather_str.cpp). More...
Include dependency graph for string_histogram.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Namespaces | |
| namespace | shamalgs |
| namespace to contain everything implemented by shamalgs | |
Functions | |
| std::unordered_map< std::string, int > | shamalgs::collective::string_histogram (const std::vector< std::string > &inputs, std::string delimiter, bool hash_based) |
| Constructs a histogram from a vector of strings, counting occurrences of each unique string. | |
| std::unordered_map< std::string, int > | shamalgs::collective::all_string_histogram (const std::vector< std::string > &inputs, std::string delimiter, bool hash_based) |
| same as string_histogram but with result return on every rank | |
MPI string gather / allgather helpers (declarations; implementations in shamalgs/src/collective/gather_str.cpp).
Definition in file string_histogram.hpp.
| std::unordered_map< std::string, int > shamalgs::collective::all_string_histogram | ( | const std::vector< std::string > & | inputs, |
| std::string | delimiter, | ||
| bool | hash_based | ||
| ) |
same as string_histogram but with result return on every rank
Definition at line 141 of file string_histogram.cpp.
Here is the call graph for this function:| std::unordered_map< std::string, int > shamalgs::collective::string_histogram | ( | const std::vector< std::string > & | inputs, |
| std::string | delimiter, | ||
| bool | hash_based | ||
| ) |
Constructs a histogram from a vector of strings, counting occurrences of each unique string.
This function takes a vector of strings, concatenates them into a single string using the specified delimiter, and then splits the concatenated string back into individual strings. It then counts the occurrences of each unique string and returns a histogram as an unordered map.
| inputs | A vector of strings to process. |
| delimiter | A string used to concatenate and split the inputs. Defaults to a newline character. |
Definition at line 131 of file string_histogram.cpp.
Here is the call graph for this function: