|
ADS-IDAC Engine 5.0.0
|
Shared declarations for MPI parallel execution: message tags, utilities, Fortran callbacks. More...
#include "../Global/SimulationContext.h"#include <fstream>#include <sstream>#include <filesystem>#include <iostream>#include <cstdlib>#include <lz4.h>#include <cstring>#include <boost/serialization/vector.hpp>#include <boost/serialization/string.hpp>Go to the source code of this file.
Classes | |
| struct | SequenceReport |
| Report sent by client when a sequence completes (for DET visualization). More... | |
| struct | SequenceOutputEvent |
| Lightweight PE event record (extracted from AnalysisInfoContainerUnit). More... | |
| struct | SequenceOutputEndState |
| Lightweight end state record (extracted from BranchEndState). More... | |
| struct | SequenceOutputData |
| Per-sequence output payload sent from client to server via MPI. More... | |
Namespaces | |
| namespace | PG |
| Parallel globals namespace — MPI rank/size and message tag definitions. | |
Enumerations | |
| enum | { PG::server_branch_this , PG::server_done_simulating , PG::client_simulate_this , PG::client_restart_run , PG::client_shutdown , PG::client_debug_resume , PG::server_branch_meta , PG::client_peer_assign , PG::client_peer_restart , PG::client_send_to_peer , PG::client_run_held , PG::server_send_complete , PG::server_done_with_report , PG::server_output_data , PG::client_checkpoint } |
| MPI message tags for Server/Client communication. More... | |
Functions | |
| void | interfc_ () |
| Called every RELAP5 timestep from dtstep.f. Triggers crew/diagnosis decisions. More... | |
| void | actonce_ () |
| Execute crew actions once per transient. More... | |
| void | secini_ () |
| Security initialization callback. More... | |
| void | actte_ () |
| Execute crew actions at each timestep. More... | |
| void | restartforanewsequence_ () |
| Find next unexplored branch, generate indeck.i restart input. More... | |
| void | initiationforrestart_ () |
| Initialize restart mode for next sequence. More... | |
| void | mutiproactonce_ () |
| void | setrnode_ () |
| Set restart node information in r5pars_. More... | |
| void | relap5_ () |
| std::string | restart_path (const std::string &name) |
| Get restart file path (shm or local). More... | |
| long | get_rss_mb () |
| Get current process RSS in MB (Linux + macOS, returns 0 elsewhere). More... | |
| bool | should_use_memory_restart () |
| Decide whether to use memory mode for this restart operation. memory_limit_mb == 0 → unlimited (always memory). > 0 → check RSS. More... | |
| std::vector< char > | lz4_compress (const char *data, int size) |
| LZ4-compress a buffer with a 4-byte original-size header. More... | |
| std::vector< char > | lz4_decompress (const char *data, int size) |
| LZ4-decompress a buffer that has a 4-byte original-size header. More... | |
| void | cleanup_fort_temps () |
| Clean up Fortran temporary files (fort*) left by RELAP5. More... | |
| bool | viz_outputs_any () |
| True if any viz output streaming is enabled. More... | |
Variables | |
| int | PG::rank |
| MPI rank of this process. More... | |
| int | PG::size |
| Total number of MPI processes. More... | |
| bool | PG::log = true |
| Enable/disable rank-specific logging. More... | |
Shared declarations for MPI parallel execution: message tags, utilities, Fortran callbacks.
Definition in file ParallelGlobal.h.
| void actonce_ | ( | ) |
Execute crew actions once per transient.
Definition at line 592 of file ADSIDAC.cpp.
References getActiveSolver(), and getActiveSolverCallback().
| void actte_ | ( | ) |
Execute crew actions at each timestep.
Definition at line 580 of file ADSIDAC.cpp.
References getActiveSolver(), and getActiveSolverCallback().
|
inline |
Clean up Fortran temporary files (fort*) left by RELAP5.
Definition at line 107 of file ParallelGlobal.h.
Referenced by main(), and Client::Work().
|
inline |
Get current process RSS in MB (Linux + macOS, returns 0 elsewhere).
Definition at line 41 of file ParallelGlobal.h.
Referenced by Server::dispatch_available_tasks(), main(), AdsidacCallback::onBranchingPoint(), should_use_memory_restart(), and Server::Simulation().
| void initiationforrestart_ | ( | ) |
Initialize restart mode for next sequence.
Definition at line 610 of file ADSIDAC.cpp.
References engine_callback, AdsidacCallback::initiationForRestart(), and solver_raw.
| void interfc_ | ( | ) |
Called every RELAP5 timestep from dtstep.f. Triggers crew/diagnosis decisions.
Definition at line 574 of file ADSIDAC.cpp.
References getActiveSolver(), and getActiveSolverCallback().
|
inline |
LZ4-compress a buffer with a 4-byte original-size header.
Definition at line 75 of file ParallelGlobal.h.
References PG::size.
Referenced by DETCheckpoint::lz4_pack_string(), AdsidacCallback::onBranchingPoint(), and DETCheckpoint::save().
|
inline |
LZ4-decompress a buffer that has a 4-byte original-size header.
Definition at line 90 of file ParallelGlobal.h.
References PG::size.
Referenced by DETCheckpoint::load(), DETCheckpoint::lz4_unpack_string(), main(), and Client::restore_relap_state().
| void mutiproactonce_ | ( | ) |
Definition at line 614 of file ADSIDAC.cpp.
| void relap5_ | ( | ) |
|
inline |
Get restart file path (shm or local).
Definition at line 36 of file ParallelGlobal.h.
References SimulationContext::config, g_sim, SimConfig::memory_restart, and SimConfig::shm_prefix.
Referenced by build_serial_checkpoint(), AdsidacCallback::initiationForRestart(), main(), and AdsidacCallback::restartForNewSequence().
| void restartforanewsequence_ | ( | ) |
Find next unexplored branch, generate indeck.i restart input.
Definition at line 606 of file ADSIDAC.cpp.
References engine_callback, AdsidacCallback::restartForNewSequence(), and solver_raw.
| void secini_ | ( | ) |
Security initialization callback.
Definition at line 586 of file ADSIDAC.cpp.
References getActiveSolver(), and getActiveSolverCallback().
| void setrnode_ | ( | ) |
Set restart node information in r5pars_.
Definition at line 618 of file ADSIDAC.cpp.
|
inline |
Decide whether to use memory mode for this restart operation. memory_limit_mb == 0 → unlimited (always memory). > 0 → check RSS.
Definition at line 68 of file ParallelGlobal.h.
References SimulationContext::config, g_sim, get_rss_mb(), SimConfig::memory_limit_mb, and SimConfig::memory_restart.
Referenced by main(), and AdsidacCallback::onBranchingPoint().
|
inline |
True if any viz output streaming is enabled.
Definition at line 132 of file ParallelGlobal.h.
References SimulationContext::config, g_sim, SimConfig::viz_output_end_states, and SimConfig::viz_output_events.
Referenced by Client::complete_sequence().