Skip to content

Commit 380b62e

Browse files
Merge pull request sstsimulator#1621 from sstsimulator/devel
Automatically Merged using SST Master Branch Merger
2 parents 0960556 + ac17ea0 commit 380b62e

22 files changed

Lines changed: 57 additions & 537 deletions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ DebugConsole::cmd_print_rank_serial(std::string& cmd_str)
17081708
result.clear();
17091709

17101710
if ( current_rank == 0 ) {
1711-
succeed = cmd_ls_remote(tokens);
1711+
succeed = cmd_print_remote(tokens);
17121712
std::cout << result.str();
17131713
}
17141714
else {

src/sst/core/serialization/impl/serialize_insertable.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ constexpr bool is_simple_map_v<MAP<KEY, REST...>> =
9090
(is_same_template_v<MAP, std::map> || is_same_template_v<MAP, std::unordered_map>) &&
9191
(std::is_arithmetic_v<KEY> || std::is_enum_v<KEY> || std::is_convertible_v<KEY, std::string>);
9292

93+
9394
// Whether it is a simple set (not a multiset and has integral, floating-point, enum, or convertible to string keys)
9495
template <typename>
9596
constexpr bool is_simple_set_v = false;
@@ -159,6 +160,18 @@ class serialize_impl<OBJ, std::enable_if_t<is_insertable_v<OBJ>>>
159160
for ( bool e : obj )
160161
SST_SER(e); // as_ptr_elem not valid for bool
161162
}
163+
else if constexpr ( is_same_type_template_v<OBJ, std::map> ||
164+
is_same_type_template_v<OBJ, std::unordered_map> ||
165+
is_same_type_template_v<OBJ, std::multimap> ||
166+
is_same_type_template_v<OBJ, std::unordered_multimap> ) {
167+
168+
// Maps have to be treated differently in the case of the as_ptr_elem option
169+
for ( auto& e : obj ) {
170+
auto& cast_e = const_cast<value_type&>(reinterpret_cast<const value_type&>(e));
171+
SST_SER_NAME(cast_e.first, "key");
172+
SST_SER_NAME(cast_e.second, "value", opts);
173+
}
174+
}
162175
else {
163176
// Iterate over references to elements, casting away any const in keys
164177
for ( auto& e : obj )

src/sst/core/serialization/objectMap.h

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,6 @@ class TraceBuffer
10191019

10201020
void resetTraceBuffer()
10211021
{
1022-
printf(" Reset Trace Buffer\n");
10231022
postCount_ = 0;
10241023
cur_ = 0;
10251024
first_ = 0;
@@ -1067,41 +1066,43 @@ class TraceBuffer
10671066
// printf(" Sample: post trigger\n");
10681067
}
10691068

1069+
if ( !(state_ == POSTTRIGGER && postCount_ >= postDelay_) ) {
10701070
// Circular buffer
10711071
#ifdef _OBJMAP_DEBUG_
1072-
std::cout << " Sample:" << handler << ": numRecs:" << numRecs_ << " first:" << first_ << " cur:" << cur_
1073-
<< " state:" << state2char.at(state_) << " isOverrun:" << isOverrun_
1074-
<< " samplesLost:" << samplesLost_ << std::endl;
1072+
std::cout << " Sample:" << handler << ": numRecs:" << numRecs_ << " first:" << first_ << " cur:" << cur_
1073+
<< " state:" << state2char.at(state_) << " isOverrun:" << isOverrun_
1074+
<< " samplesLost:" << samplesLost_ << std::endl;
10751075
#endif
1076-
cycleBuffer_[cur_] = cycle;
1077-
handlerBuffer_[cur_] = handler;
1078-
if ( trigger ) {
1079-
triggerCycle = cycle;
1080-
}
1076+
cycleBuffer_[cur_] = cycle;
1077+
handlerBuffer_[cur_] = handler;
1078+
if ( trigger ) {
1079+
triggerCycle = cycle;
1080+
}
10811081

1082-
// Sample all the trace object buffers
1083-
ObjectBuffer* varBuffer_;
1084-
for ( size_t obj = 0; obj < numObjects; obj++ ) {
1085-
varBuffer_ = objBuffers_[obj];
1086-
varBuffer_->sample(cur_, trigger);
1087-
}
1082+
// Sample all the trace object buffers
1083+
ObjectBuffer* varBuffer_;
1084+
for ( size_t obj = 0; obj < numObjects; obj++ ) {
1085+
varBuffer_ = objBuffers_[obj];
1086+
varBuffer_->sample(cur_, trigger);
1087+
}
10881088

1089-
if ( numRecs_ < bufSize_ ) {
1090-
tagBuffer_[cur_] = state_;
1091-
numRecs_++;
1092-
cur_ = (cur_ + 1) % bufSize_;
1093-
if ( cur_ == 0 ) first_ = 0; // 1;
1094-
}
1095-
else { // Buffer full
1096-
// Check to see if we are overwriting trigger
1097-
if ( tagBuffer_[cur_] == TRIGGER ) {
1098-
// printf(" Sample Overrun\n");
1099-
isOverrun_ = true;
1089+
if ( numRecs_ < bufSize_ ) {
1090+
tagBuffer_[cur_] = state_;
1091+
numRecs_++;
1092+
cur_ = (cur_ + 1) % bufSize_;
1093+
if ( cur_ == 0 ) first_ = 0; // 1;
1094+
}
1095+
else { // Buffer full
1096+
// Check to see if we are overwriting trigger
1097+
if ( tagBuffer_[cur_] == TRIGGER ) {
1098+
// printf(" Sample Overrun\n");
1099+
isOverrun_ = true;
1100+
}
1101+
tagBuffer_[cur_] = state_;
1102+
numRecs_++;
1103+
cur_ = (cur_ + 1) % bufSize_;
1104+
first_ = cur_;
11001105
}
1101-
tagBuffer_[cur_] = state_;
1102-
numRecs_++;
1103-
cur_ = (cur_ + 1) % bufSize_;
1104-
first_ = cur_;
11051106
}
11061107

11071108
if ( isOverrun_ ) {
@@ -1110,14 +1111,12 @@ class TraceBuffer
11101111

11111112
if ( (state_ == TRIGGER) && (postDelay_ == 0) ) {
11121113
invokeAction = true;
1113-
std::cout << " Invoke Action\n";
11141114
}
11151115

11161116
if ( state_ == POSTTRIGGER ) {
11171117
postCount_++;
11181118
if ( postCount_ >= postDelay_ ) {
11191119
invokeAction = true;
1120-
std::cout << " Invoke Action\n";
11211120
}
11221121
}
11231122

src/sst/core/serialization/serialize.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define SST_CORE_SERIALIZATION_SERIALIZE_H
1414

1515
#include "sst/core/from_string.h"
16+
#include "sst/core/output.h"
1617
#include "sst/core/serialization/objectMap.h"
1718
#include "sst/core/serialization/serializer.h"
1819
#include "sst/core/warnmacros.h"
@@ -207,7 +208,12 @@ class serialize
207208
// data needs to be serialized before any of the pointers
208209
// that point to it.
209210
if ( ser.sizer().check_pointer_sizer(ptr) ) {
210-
// TODO Error
211+
Output::getDefaultObject().output(
212+
"WARNING: Serializaion of object of type %s using as_ptr option detected that a pointer to this "
213+
"object was "
214+
"already serialized. Serialization of the object should happen before serialization of any "
215+
"pointers to the object.\n",
216+
ObjectMap::demangle_name(typeid(T).name()).c_str());
211217
}
212218

213219
// Always put the pointer in

src/sst/core/simulation.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
#include <fstream>
5757
#include <iostream>
5858
#include <map>
59-
#include <mutex>
6059
#include <ostream>
6160
#include <set>
6261
#include <string>
@@ -573,9 +572,9 @@ Simulation::getLocalMinimumNextActivityTime()
573572
void
574573
Simulation::processGraphInfo(ConfigGraph& graph, const RankInfo& UNUSED(myRank), SimTime_t min_part)
575574
{
576-
// Set minPartTC (only thread 0 will do this)
577-
Simulation::minPart = min_part;
578575
if ( my_rank.thread == 0 ) {
576+
// Set minPartTC (only thread 0 will do this)
577+
minPart = min_part;
579578
minPartTC = minPartToTC(min_part);
580579
}
581580
// Get the minimum latencies for links between the various threads
@@ -636,7 +635,6 @@ Simulation::processGraphInfo(ConfigGraph& graph, const RankInfo& UNUSED(myRank),
636635
// Create the SyncManager for this rank. It gets created even if
637636
// we are single rank/single thread because it also manages the
638637
// Exit and Heartbeat actions.
639-
minPartTC = minPartToTC(min_part);
640638
syncManager = new SyncManager(my_rank, num_ranks, min_part, interThreadLatencies, real_time_);
641639

642640
// Check to see if the SyncManager profile tool is installed

src/sst/core/sync/syncManager.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ RankSync::findSyncInterval(uint32_t UNUSED_WO_MPI(my_rank))
379379
void
380380
SyncManager::setupSyncObjects()
381381
{
382+
ic_barrier_.resize(num_ranks_.thread);
382383
if ( rank_.thread == 0 ) {
383384
for ( auto& b : RankExecBarrier_ ) {
384385
b.resize(num_ranks_.thread);
@@ -438,7 +439,6 @@ SyncManager::SyncManager(const RankInfo& rank, const RankInfo& num_ranks, SimTim
438439

439440
exit_ = sim_->getExit();
440441
checkpoint_ = sim_->getCheckpointAction();
441-
ic_barrier_.resize(num_ranks_.thread);
442442

443443
setPriority(SYNCPRIORITY);
444444
}

src/sst/core/threadsafe.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class CACHE_ALIGNED_T Barrier
5151
size_t origCount;
5252
std::atomic<bool> enabled;
5353
std::atomic<size_t> count, generation;
54+
std::mutex barrierMutex;
5455

5556
public:
5657
Barrier(size_t count) :
@@ -71,6 +72,7 @@ class CACHE_ALIGNED_T Barrier
7172
/** ONLY call this while nobody is in wait() */
7273
void resize(size_t newCount)
7374
{
75+
std::lock_guard<std::mutex> lk(barrierMutex);
7476
count = origCount = newCount;
7577
generation.store(0);
7678
enabled.store(true);

src/sst/core/watchPoint.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ void
383383
WatchPoint::setBufferReset()
384384
{
385385
if ( tb_ != nullptr ) {
386-
printf(" Set Buffer Reset\n");
387386
tb_->setBufferReset();
388387
reset_ = true;
389388
}
@@ -412,7 +411,6 @@ WatchPoint::check()
412411
s << " ";
413412
cmpObjects_[i]->print(s);
414413
s << " -> " << result2 << std::endl;
415-
// printf(" comparison%ld = %d\n", i, result2);
416414

417415
if ( logicOps_[i - 1] == LogicOp::AND ) {
418416
result = result && result2;

tests/refFiles/test_DebugConsole_Checkpoint_serial0.out

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ c1 talkingc1, bounce 991, t=9000000
3131
c0 talkingClock cycle count = 1
3232
c0 talkingRNG: 4074790800, 774252441, 24684
3333
c0 talkingDistributions: 1.500000, 5.000000, 0.721430, 0.919625, 0.000000, 1.000000
34-
Invoke Action
35-
Set Buffer Reset
3634
# Simulation Checkpoint: Simulated Time 10 us (Real CPU time since last checkpoint 0.04483 seconds)
37-
Reset Trace Buffer
3835
c1 talkingClock cycle count = 1
3936
c1 talkingRNG: 4074790800, 774252441, 24684
4037
c1 talkingDistributions: 1.500000, 1.000000, 0.721430, 0.919625, 0.000000, 1.000000

tests/refFiles/test_DebugConsole_Checkpoint_serial1.out

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ c1 talkingc1, bounce 991, t=9000000
3131
c0 talkingClock cycle count = 1
3232
c0 talkingRNG: 4074790800, 774252441, 24684
3333
c0 talkingDistributions: 1.500000, 5.000000, 0.721430, 0.919625, 0.000000, 1.000000
34-
Invoke Action
35-
Set Buffer Reset
3634
# Simulation Checkpoint: Simulated Time 10 us (Real CPU time since last checkpoint 0.03792 seconds)
37-
Reset Trace Buffer
3835
c1 talkingClock cycle count = 1
3936
c1 talkingRNG: 4074790800, 774252441, 24684
4037
c1 talkingDistributions: 1.500000, 1.000000, 0.721430, 0.919625, 0.000000, 1.000000

0 commit comments

Comments
 (0)