Skip to content

Commit

Permalink
Resolve linker issues
Browse files Browse the repository at this point in the history
The code now compiles and runs properly at least
with the test_osu_bw.py example.
  • Loading branch information
jmlapre committed Jan 21, 2025
1 parent 4d4e04e commit fb419f5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/sst/elements/mercury/operating_system/process/app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,22 @@ static char* get_data_segment(SST::Params& params,

static thread_lock dlopen_lock;

GlobalVariableContext GlobalVariable::glblCtx;
GlobalVariableContext GlobalVariable::tlsCtx;
bool GlobalVariable::inited = false;

int
GlobalVariable::init(const int size, const char* name, bool tls)
{
if (!inited){
tlsCtx.init();
glblCtx.init();
inited = true;
}
if (tls) return tlsCtx.append(size, name);
else return glblCtx.append(size, name);
}

void
GlobalVariableContext::callInitFxns(void *globals)
{
Expand All @@ -107,6 +123,14 @@ GlobalVariableContext::callInitFxns(void *globals)
}
}

GlobalVariableContext::~GlobalVariableContext()
{
if (globalInits){
delete[] globalInits;
globalInits = nullptr;
}
}

void
App::lockDlopen(int aid)
{
Expand Down Expand Up @@ -262,7 +286,7 @@ App::App(SST::Params& params, SoftwareId sid,
out_ = std::unique_ptr<SST::Output>(
new SST::Output("app:", verbose, 0, Output::STDOUT));

//globals_storage_ = allocateDataSegment(false); //not tls
globals_storage_ = allocateDataSegment(false); //not tls
min_op_cutoff_ = params.find<long>("min_op_cutoff", 1000);

notify_ = params.find<bool>("notify", true);
Expand Down

0 comments on commit fb419f5

Please sign in to comment.