Skip to content

Commit 70f64a6

Browse files
committed
clang-format
1 parent 79ffa90 commit 70f64a6

File tree

4 files changed

+37
-39
lines changed

4 files changed

+37
-39
lines changed

src/sst/core/impl/interactive/simpleDebug.cc

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -544,17 +544,13 @@ SimpleDebugger::cmd_info(std::vector<std::string>& UNUSED(tokens))
544544
RankInfo info = getRank();
545545
RankInfo nRanks = getNumRanks();
546546
if ( tokens[1] == "current" ) {
547-
std::cout << "Rank " << info.rank << "/" << nRanks.rank
548-
<< ", Thread " << info.thread << "/" << nRanks.thread
549-
<< " (Process " << getppid() << ")"
550-
<< std::endl;
547+
std::cout << "Rank " << info.rank << "/" << nRanks.rank << ", Thread " << info.thread << "/" << nRanks.thread
548+
<< " (Process " << getppid() << ")" << std::endl;
551549
}
552550
else if ( tokens[1] == "all" ) {
553551
if ( nRanks.rank == 1 && nRanks.thread == 1 ) {
554-
std::cout << "Rank " << info.rank << "/" << nRanks.rank
555-
<< ", Thread " << info.thread << "/"<< nRanks.thread
556-
<< " (Process " << getppid() << ")"
557-
<< std::endl;
552+
std::cout << "Rank " << info.rank << "/" << nRanks.rank << ", Thread " << info.thread << "/"
553+
<< nRanks.thread << " (Process " << getppid() << ")" << std::endl;
558554
}
559555
else {
560556
// Return to syncmanager to print summary for all threads
@@ -741,15 +737,16 @@ SimpleDebugger::cmd_print(std::vector<std::string>& tokens)
741737
std::string tok = tokens[1];
742738
if ( (tok.size() >= 2) && (tok[0] == '-') && (tok[1] == 'r') ) {
743739
// Got a -r
744-
if (tok.size() == 2) {
740+
if ( tok.size() == 2 ) {
745741
recurse = 4;
746-
} else {
742+
}
743+
else {
747744
std::string num = tok.substr(2);
748-
if (num.size() != 0) {
745+
if ( num.size() != 0 ) {
749746
try {
750747
recurse = SST::Core::from_string<int>(num);
751748
}
752-
catch (std::invalid_argument& e) {
749+
catch ( std::invalid_argument& e ) {
753750
printf("Invalid number format specified with -r: %s\n", tok.c_str());
754751
return;
755752
}

src/sst/core/interactiveAction.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
#include "sst/core/action.h"
1616
// Can include this because this header is not installed
17-
#include "sst/core/simulation_impl.h"
1817
#include "sst/core/interactiveConsole.h"
18+
#include "sst/core/simulation_impl.h"
1919

2020
#include <string>
2121

@@ -46,15 +46,16 @@ class InteractiveAction : public Action
4646
InteractiveAction is managed by the SyncManager in parallel
4747
runs.
4848
*/
49-
void insertIntoTimeVortex(SimTime_t time) {
49+
void insertIntoTimeVortex(SimTime_t time)
50+
{
5051
// If this is a serial job, insert this into
5152
// the time TimeVortex. If it is parallel, then the
5253
// InteractiveAction is managed by the SyncManager.
53-
//std::cout << "skk: insertIntoTimeVortex called\n";
54+
// std::cout << "skk: insertIntoTimeVortex called\n";
5455
RankInfo num_ranks = sim_->getNumRanks();
55-
//if (num_ranks.rank == 1 && num_ranks.thread == 1) {
56-
//std::cout << " skk: insertIntoTimeVortex insertActivity\n";
57-
sim_->insertActivity(time, this);
56+
// if (num_ranks.rank == 1 && num_ranks.thread == 1) {
57+
// std::cout << " skk: insertIntoTimeVortex insertActivity\n";
58+
sim_->insertActivity(time, this);
5859
//}
5960
}
6061
#endif
@@ -69,7 +70,7 @@ class InteractiveAction : public Action
6970
void execute() override
7071
{
7172
sim_->enter_interactive_ = true;
72-
sim_->interactive_msg_ = msg_;
73+
sim_->interactive_msg_ = msg_;
7374
delete this;
7475
}
7576

src/sst/core/sync/syncManager.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,8 @@ SyncManager::handleInteractiveConsole()
423423
for ( uint32_t tindex = 0; tindex < num_ranks_.thread; tindex++ ) {
424424
if ( rank_.thread == tindex ) {
425425
if ( rank_.thread == 0 ) std::cout << "\nINTERACTIVE CONSOLE\n";
426-
std::cout << " Rank:" << rank_.rank << "/" << num_ranks_.rank
427-
<< " Thread:" << rank_.thread << "/"
428-
<< num_ranks_.thread;
426+
std::cout << " Rank:" << rank_.rank << "/" << num_ranks_.rank << " Thread:" << rank_.thread << "/"
427+
<< num_ranks_.thread;
429428
if ( sim_->enter_interactive_ ) {
430429
std::cout << " (Triggered)\n";
431430
}
@@ -441,17 +440,18 @@ SyncManager::handleInteractiveConsole()
441440
ic_barrier_.wait();
442441
}
443442

444-
// 3) T0: Invoke IC for T0 (or Query which thread to inspect?)
443+
// 3) T0: Invoke IC for T0 (or Query which thread to inspect?)
445444
#if 1
446445
if ( rank_.thread == 0 ) {
447446
current_ic_thread_.store(0);
448447
}
449448
ic_barrier_.wait(); // Ensure store is complete before everyone checks
450449
#else
451-
if (rank_.thread == 0) {
450+
if ( rank_.thread == 0 ) {
452451
current_ic_thread_ = num_ranks_.thread;
453-
std::cout << "\n---- Enter thread ID (0 to " << num_ranks_.thread - 1 << ") to inspect in interactive console or "
454-
<< num_ranks_.thread << " to continue simulation\n";
452+
std::cout << "\n---- Enter thread ID (0 to " << num_ranks_.thread - 1
453+
<< ") to inspect in interactive console or " << num_ranks_.thread
454+
<< " to continue simulation\n";
455455
std::cin >> current_ic_thread_;
456456
std::cout << "skk: set tid to " << current_ic_thread_ << std::endl;
457457
}
@@ -479,11 +479,11 @@ SyncManager::handleInteractiveConsole()
479479
tid = current_ic_thread_.load();
480480
ic_state = current_ic_state_.load();
481481
// out.output("T%d: tid %d, ic_state %d\n", rank_.thread, tid, ic_state);
482-
if ( ic_state == InteractiveConsole::ICretcode::SUMMARY ) { // Print thread info summary
482+
if ( ic_state == InteractiveConsole::ICretcode::SUMMARY ) { // Print thread info summary
483483
for ( uint32_t tindex = 0; tindex < num_ranks_.thread; tindex++ ) {
484484
if ( rank_.thread == tindex ) {
485485
std::cout << "Rank:" << rank_.rank << " Thread:" << rank_.thread
486-
<< " (Process:" << getppid() << ") ";
486+
<< " (Process:" << getppid() << ") ";
487487
// Print component summary
488488
if ( sim_->interactive_ != nullptr ) {
489489
sim_->interactive_->summary();
@@ -506,7 +506,7 @@ SyncManager::handleInteractiveConsole()
506506
// sim_->enter_interactive_); out.output("skk:syncmgr:execute: T%d: AFter: enter_interactive_mask_=0x%x\n",
507507
// rank_.thread, ic_mask);
508508
}
509-
} // end if num_ranks_.thread > 1: Handle interactive console
509+
} // end if num_ranks_.thread > 1: Handle interactive console
510510
}
511511

512512
void
@@ -622,8 +622,8 @@ SyncManager::execute()
622622
}
623623
next_checkpoint_time = checkpoint_->check(getDeliveryTime());
624624

625-
handleShutdown(); // Check if any thread set shutdown
626-
handleInteractiveConsole(); // Check of any thread set interactive console
625+
handleShutdown(); // Check if any thread set shutdown
626+
handleInteractiveConsole(); // Check of any thread set interactive console
627627

628628
} // if num_ranks_.rank == 1 i.e. only multithreading
629629

src/sst/core/sync/syncManager.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ class SyncManager : public Action
188188
sync_type_t next_sync_type_;
189189
SimTime_t min_part_;
190190

191-
RealTimeManager* real_time_;
192-
CheckpointAction* checkpoint_;
193-
static std::atomic<unsigned> enter_interactive_mask_;
194-
static std::atomic<int> current_ic_thread_;
195-
static std::atomic<int> current_ic_state_;
196-
static std::atomic<unsigned> enter_shutdown_;
197-
static std::atomic<unsigned> endSim_;
198-
static std::atomic<unsigned> shutdown_mode_;
191+
RealTimeManager* real_time_;
192+
CheckpointAction* checkpoint_;
193+
static std::atomic<unsigned> enter_interactive_mask_;
194+
static std::atomic<int> current_ic_thread_;
195+
static std::atomic<int> current_ic_state_;
196+
static std::atomic<unsigned> enter_shutdown_;
197+
static std::atomic<unsigned> endSim_;
198+
static std::atomic<unsigned> shutdown_mode_;
199199
static Core::ThreadSafe::Barrier ic_barrier_;
200200

201201
SyncProfileToolList* profile_tools_ = nullptr;

0 commit comments

Comments
 (0)