mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-25 20:45:35 -04:00
Load the serialized representation from file once
The previous implementation had each sampling run reading from the serialized file. This introduced a large I/O overhead and the performance was much slower than the equivalent run with the unserialized source.
This commit is contained in:
parent
d4e7fa5d87
commit
175d57c126
2 changed files with 10 additions and 2 deletions
|
|
@ -99,7 +99,13 @@ SourceDistribution::SourceDistribution(pugi::xml_node node)
|
|||
}
|
||||
|
||||
if (check_for_node(node, "serialization")) {
|
||||
serialization = get_node_value(node, "serialization", false, true);
|
||||
// If the source is serialized then make sure we only load it from file once, otherwise there will
|
||||
// be a significant I/O overhead.
|
||||
pugi::xml_document doc;
|
||||
doc.load_file(get_node_value(node, "serialization", false, true).c_str());
|
||||
std::stringstream ss;
|
||||
doc.print(ss);
|
||||
serialization = ss.str();
|
||||
}
|
||||
} else {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue