Skip to content

Commit

Permalink
Added optional remote sheel config file for the remote startup command.
Browse files Browse the repository at this point in the history
  • Loading branch information
hchen99 committed Sep 5, 2024
1 parent cca503a commit e2c35d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/trick/Master.hh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ namespace Trick {
to change to that directory before calling S_main_name.\n */
std::string sim_path; /**< trick_units(--) */

/** @userdesc Optional shell environment setup config file for the slave shell.\n */
std::string remote_shell_config_file; /**< trick_units(--) */

/** @userdesc Slave executable name, default is "./S_main_${TRICK_HOST_CPU}.exe".\n */
std::string S_main_name; /**< trick_units(--) */

Expand Down
5 changes: 5 additions & 0 deletions trick_source/sim_services/MasterSlave/Master.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ int Trick::SlaveInfo::start() {
startup_command << " 'cd " << sim_path << " ; " ;
}

/** @li Set up remote shell environment if needed for the remote startup command */
if ( !remote_shell_config_file.empty() ) {
startup_command << " source " << remote_shell_config_file << " ; " ;
}

if (strstr(passp->pw_shell, "csh")) {
startup_command << " setenv TRICK_HOST_CPU `trick-gte TRICK_HOST_CPU` ; " ;
} else {
Expand Down

0 comments on commit e2c35d3

Please sign in to comment.