|
ADS-IDAC Engine 5.0.0
|
#include <BranchCluster.h>
Public Member Functions | |
| BranchCluster () | |
| Constructs an empty cluster: mother branch and mother cluster IDs 0, cluster ID, current branch number and RELAP5 restart count -1. More... | |
| virtual | ~BranchCluster () |
| void | setCurrentBranchNum (int) |
| Sets the index (within all_branch) of the most recently started alternative. Alternatives with a larger index have not been started yet; the tree traversal restarts a cluster while this index is below all_branch.size() - 1. More... | |
| int | getCurrentBranchNum () |
| void | calBranchProbability () |
| Recomputes the conditional probability of every alternative (BranchProbability::calculateProbability on each element of all_branch). More... | |
| void | setIDOfTheMotherBranch (int) |
| Sets the ID of the branch (PE node) this cluster hangs from. More... | |
| int | getIDOfTheMotherBranch () |
| void | saveInfoToFile () |
| Declared only; there is no definition. Use savePENodeToFile(). More... | |
| void | retrieveInfoFromFile (std::ifstream &) |
| Does nothing; the stream is not read. More... | |
| void | setIDOfThisBranchCluster (int) |
| int | getIDOfThisBranchCluster () |
| void | clearBranchCluster () |
| Destroys all alternatives held in all_branch. More... | |
| void | setNCountForRestartRELAP5 (long) |
| Stores the RELAP5 restart count (r5pars_.cncount) recorded at this branching point. More... | |
| int | getNCountForRestartRELAP5 () |
| BranchProbability * | findBranch (int) |
| Finds the alternative with the given branch ID, searching from the last alternative. More... | |
| void | copyBranchCluster (BranchCluster &) |
| Deep-copies the alternatives and all scalar fields of another cluster. The copies are appended to all_branch; call it on an empty cluster. More... | |
| void | saveBranchClusterToFile (std::ofstream &) |
| Writes the cluster as text: the five ID fields, the alternative count, every alternative, then the Time and Probability base parts. More... | |
| void | retrieveBranchClusterFromFile (std::ifstream &) |
| Reads the text layout written by saveBranchClusterToFile and appends the alternatives it reads to all_branch. More... | |
| void | setIDOfMotherCluster (int) |
| Sets the ID of the cluster that contains the mother branch. More... | |
| int | getIDOfMotherCluster () |
| void | savePENodeToFile () |
| Writes the PE nodes of this cluster under the scheduler's PE directory (Scheduler::getPEDirectory()). More... | |
| void | savePENodeToFile (std::string strDirName) |
| Writes one PE node per alternative of this cluster. More... | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Public Member Functions inherited from Time | |
| Time () | |
| virtual | ~Time () |
| double | getTimeAtWhichThisEventHappen () const |
| void | setTimeAtWhichThisEventHappen (double) |
| void | copyTime (Time &) |
| void | saveTimeToFile (std::ofstream &) |
| void | retrieveTimeFromFile (std::ifstream &) |
Public Member Functions inherited from Probability | |
| double | calculateProbability () |
| double | calculateSurvivalProbability (double) |
| double | gamma_log (double) |
| double | beta_cdf_inv (double, double, double) |
| double | beta_cdf (double, double, double) |
| double | beta_pdf (double, double, double) |
| double | beta_inc (double, double, double) |
| double | beta (double, double) |
| double | r8_huge () |
| double | r8_epsilon (void) |
| Probability () | |
| virtual | ~Probability () |
| void | setProbability (double) |
| double | getProbability () |
| void | setAlpha_Parameter (double) |
| double | getAlpha_Parameter () |
| void | setBeta_Parameter (double) |
| double | getBeta_Parameter () |
| void | copyProbability (Probability &) |
| void | saveProbabilityToFile (std::ofstream &) |
| void | retrieveProbabilityFromFile (std::ifstream &) |
| double | getFailureRate () const |
| void | setFailureRate (double failure_rate) |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Public Attributes | |
| std::vector< std::unique_ptr< BranchProbability > > | all_branch |
| The alternatives of this branching point; index 0 is the one the generating sequence continues on. More... | |
Private Attributes | |
| int | ID_of_the_mother_branch |
| int | ID_of_the_mother_cluster |
| int | Current_branch_num |
| int | ID_of_this_branch_cluster |
| long | n_count_for_restart_RELAP5 |
Friends | |
| class | boost::serialization::access |
Definition at line 33 of file BranchCluster.h.
| BranchCluster::BranchCluster | ( | ) |
Constructs an empty cluster: mother branch and mother cluster IDs 0, cluster ID, current branch number and RELAP5 restart count -1.
Definition at line 32 of file BranchCluster.cpp.
References Current_branch_num, ID_of_the_mother_branch, ID_of_the_mother_cluster, ID_of_this_branch_cluster, and n_count_for_restart_RELAP5.
|
virtual |
Definition at line 43 of file BranchCluster.cpp.
References clearBranchCluster().
| void BranchCluster::calBranchProbability | ( | ) |
Recomputes the conditional probability of every alternative (BranchProbability::calculateProbability on each element of all_branch).
Definition at line 53 of file BranchCluster.cpp.
References all_branch.
| void BranchCluster::clearBranchCluster | ( | ) |
Destroys all alternatives held in all_branch.
Definition at line 47 of file BranchCluster.cpp.
References all_branch.
Referenced by ~BranchCluster().
| void BranchCluster::copyBranchCluster | ( | BranchCluster & | _bc | ) |
Deep-copies the alternatives and all scalar fields of another cluster. The copies are appended to all_branch; call it on an empty cluster.
Definition at line 313 of file BranchCluster.cpp.
References all_branch, Probability::copyProbability(), Time::copyTime(), Current_branch_num, getCurrentBranchNum(), getIDOfMotherCluster(), getIDOfTheMotherBranch(), getIDOfThisBranchCluster(), getNCountForRestartRELAP5(), ID_of_the_mother_branch, ID_of_the_mother_cluster, ID_of_this_branch_cluster, and n_count_for_restart_RELAP5.
| BranchProbability * BranchCluster::findBranch | ( | int | _id | ) |
Finds the alternative with the given branch ID, searching from the last alternative.
| _id | Branch (PE node) ID. |
Definition at line 261 of file BranchCluster.cpp.
References all_branch, getIDOfThisBranchCluster(), and r5pars_.
Referenced by BranchRecord::addAnEndState(), BranchRecord::checkAndAddBranchCluster(), and AdsidacCallback::initiationForRestart().
| int BranchCluster::getCurrentBranchNum | ( | ) |
Definition at line 50 of file BranchCluster.cpp.
References Current_branch_num.
Referenced by copyBranchCluster(), AdsidacCallback::initiationForRestart(), and AdsidacCallback::restartForNewSequence().
| int BranchCluster::getIDOfMotherCluster | ( | ) |
Definition at line 328 of file BranchCluster.cpp.
References ID_of_the_mother_cluster.
Referenced by compute_ancestry_path(), copyBranchCluster(), AdsidacCallback::initiationForRestart(), and log_seq_fingerprint_mpi().
| int BranchCluster::getIDOfTheMotherBranch | ( | ) |
Definition at line 256 of file BranchCluster.cpp.
References ID_of_the_mother_branch.
Referenced by copyBranchCluster(), and AdsidacCallback::initiationForRestart().
| int BranchCluster::getIDOfThisBranchCluster | ( | ) |
Definition at line 258 of file BranchCluster.cpp.
References ID_of_this_branch_cluster.
Referenced by copyBranchCluster(), findBranch(), AdsidacCallback::initiationForRestart(), and AdsidacCallback::restartForNewSequence().
| int BranchCluster::getNCountForRestartRELAP5 | ( | ) |
Definition at line 260 of file BranchCluster.cpp.
References n_count_for_restart_RELAP5.
Referenced by copyBranchCluster(), AdsidacCallback::onBranchingPoint(), Client::parallel_restartforanewsequence_(), and AdsidacCallback::restartForNewSequence().
| void BranchCluster::retrieveBranchClusterFromFile | ( | std::ifstream & | ) |
Reads the text layout written by saveBranchClusterToFile and appends the alternatives it reads to all_branch.
Definition at line 297 of file BranchCluster.cpp.
References all_branch, Current_branch_num, ID_of_the_mother_branch, ID_of_the_mother_cluster, ID_of_this_branch_cluster, n_count_for_restart_RELAP5, Probability::retrieveProbabilityFromFile(), and Time::retrieveTimeFromFile().
| void BranchCluster::retrieveInfoFromFile | ( | std::ifstream & | ) |
Does nothing; the stream is not read.
Definition at line 253 of file BranchCluster.cpp.
| void BranchCluster::saveBranchClusterToFile | ( | std::ofstream & | ) |
Writes the cluster as text: the five ID fields, the alternative count, every alternative, then the Time and Probability base parts.
Definition at line 282 of file BranchCluster.cpp.
References all_branch, Current_branch_num, ID_of_the_mother_branch, ID_of_the_mother_cluster, ID_of_this_branch_cluster, n_count_for_restart_RELAP5, Probability::saveProbabilityToFile(), and Time::saveTimeToFile().
| void BranchCluster::saveInfoToFile | ( | ) |
Declared only; there is no definition. Use savePENodeToFile().
| void BranchCluster::savePENodeToFile | ( | ) |
Writes the PE nodes of this cluster under the scheduler's PE directory (Scheduler::getPEDirectory()).
Definition at line 182 of file BranchCluster.cpp.
References g_sim, Scheduler::getPEDirectory(), savePENodeToFile(), and SimulationContext::SScheduler.
Referenced by savePENodeToFile().
| void BranchCluster::savePENodeToFile | ( | std::string | strDirName | ) |
Writes one PE node per alternative of this cluster.
| strDirName | PE output directory, with a trailing path separator. |
Per-file layout (default): the node with identifier id is written to <strDirName>PEFolder_<id / subfolder size>/ZPENode_<id>.txt, where the subfolder size is BranchRecord::getSizeOfSubFolder(); the folder is created on demand and an existing file is overwritten. Aggregate layout (--aggregate-pe): the same bytes are appended as one #PE <id> <nbytes> record to the aggregate file in strDirName (see Global/PEOutput.h).
Node content: a header line PE_<id> <time> <id> <mother branch id> 0 <Branch type> <id> <cluster probability>, a line PE_BRANCH <alternative count> <index in cluster> <mother branch id> 0 <id of alternative 0>, then the child list (child types and child IDs; a single EndState child carries the end state ID). Only the node of alternative 0 also carries the conditional probabilities and the content (CommunicationPlace::saveInfoToFileAsBranchForADSV1) of every alternative; the other nodes write 0 for both lists.
A node whose bytes are identical to what this process last wrote for the same ID is skipped (size and hash are kept in g_sim.pe_file_state).
|
inline |
Definition at line 111 of file BranchCluster.h.
References all_branch, Current_branch_num, ID_of_the_mother_branch, ID_of_the_mother_cluster, ID_of_this_branch_cluster, and n_count_for_restart_RELAP5.
| void BranchCluster::setCurrentBranchNum | ( | int | n | ) |
Sets the index (within all_branch) of the most recently started alternative. Alternatives with a larger index have not been started yet; the tree traversal restarts a cluster while this index is below all_branch.size() - 1.
Definition at line 51 of file BranchCluster.cpp.
References Current_branch_num.
Referenced by AdsidacCallback::initiationForRestart(), and Client::parallel_restartforanewsequence_().
| void BranchCluster::setIDOfMotherCluster | ( | int | n | ) |
Sets the ID of the cluster that contains the mother branch.
Definition at line 327 of file BranchCluster.cpp.
References ID_of_the_mother_cluster.
| void BranchCluster::setIDOfTheMotherBranch | ( | int | n | ) |
Sets the ID of the branch (PE node) this cluster hangs from.
Definition at line 255 of file BranchCluster.cpp.
References ID_of_the_mother_branch.
| void BranchCluster::setIDOfThisBranchCluster | ( | int | n | ) |
Definition at line 257 of file BranchCluster.cpp.
References ID_of_this_branch_cluster.
| void BranchCluster::setNCountForRestartRELAP5 | ( | long | n | ) |
Stores the RELAP5 restart count (r5pars_.cncount) recorded at this branching point.
Definition at line 259 of file BranchCluster.cpp.
References n_count_for_restart_RELAP5.
|
friend |
Definition at line 109 of file BranchCluster.h.
| std::vector<std::unique_ptr<BranchProbability> > BranchCluster::all_branch |
The alternatives of this branching point; index 0 is the one the generating sequence continues on.
Definition at line 108 of file BranchCluster.h.
Referenced by BranchRecord::addCrewContentToExpandedBranch(), BranchRecord::addHWContentToExpandedBranch(), BranchRecord::addSSContentToExpandedBranch(), calBranchProbability(), clearBranchCluster(), compute_ancestry_path(), copyBranchCluster(), findBranch(), AdsidacCallback::initiationForRestart(), log_seq_fingerprint_mpi(), AdsidacCallback::onBranchingPoint(), AdsidacCallback::restartForNewSequence(), retrieveBranchClusterFromFile(), saveBranchClusterToFile(), serialize(), and Server::write_checkpoint().
|
private |
Definition at line 127 of file BranchCluster.h.
Referenced by BranchCluster(), copyBranchCluster(), getCurrentBranchNum(), retrieveBranchClusterFromFile(), saveBranchClusterToFile(), serialize(), and setCurrentBranchNum().
|
private |
Definition at line 125 of file BranchCluster.h.
Referenced by BranchCluster(), copyBranchCluster(), getIDOfTheMotherBranch(), retrieveBranchClusterFromFile(), saveBranchClusterToFile(), serialize(), and setIDOfTheMotherBranch().
|
private |
Definition at line 126 of file BranchCluster.h.
Referenced by BranchCluster(), copyBranchCluster(), getIDOfMotherCluster(), retrieveBranchClusterFromFile(), saveBranchClusterToFile(), serialize(), and setIDOfMotherCluster().
|
private |
Definition at line 128 of file BranchCluster.h.
Referenced by BranchCluster(), copyBranchCluster(), getIDOfThisBranchCluster(), retrieveBranchClusterFromFile(), saveBranchClusterToFile(), serialize(), and setIDOfThisBranchCluster().
|
private |
Definition at line 129 of file BranchCluster.h.
Referenced by BranchCluster(), copyBranchCluster(), getNCountForRestartRELAP5(), retrieveBranchClusterFromFile(), saveBranchClusterToFile(), serialize(), and setNCountForRestartRELAP5().