Skip to content
12 changes: 12 additions & 0 deletions .gitlab/build_tioga.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ tioga-rocmcc_6_2_1_hip-src:
HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}.cmake"
extends: .src_build_on_tioga

# TODO: Translate this job to tuolumne to accomodate node requirements
# tioga-rocmcc_6_3_1_hip-gpu-aware-src:
# variables:
# COMPILER: "rocmcc@6.3.1_hip"
# HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}.cmake"
# ALLOC_TIME: "60"
# NUM_NODES: "2"
# extends: .src_build_on_tioga
# before_script:
# - module load cmake/3.21.1
# - export MPICH_GPU_SUPPORT_ENABLED=1

####
# Full Build jobs
tioga-rocmcc_6_2_1_hip-full:
Expand Down
5 changes: 5 additions & 0 deletions src/axom/lumberjack/Message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ namespace axom
{
namespace lumberjack
{

// Global workaround: https://rzlc.llnl.gov/jira/browse/ELCAP-851
char zeroMessageStorage[] = "0";
const char* const zeroMessage = zeroMessageStorage;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't you still treating zeroMessage as global data in this case? If I remember correctly, that was the main issue stated later in the ticket.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't you still treating zeroMessage as global data in this case? If I remember correctly, that was the main issue stated later in the ticket.

I think we're still hitting one of the working cases in this scenario: "use global non-constant (for CHAR type this has to be either a char array or a pointer to malloc'ed memory)".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that global constants and global non-constants are put in different sections of memory with different permissions. So it may only be the case that global constants are affected but global non-constants are not.


//Getters

std::string Message::text() const { return m_text; }
Expand Down
4 changes: 2 additions & 2 deletions src/axom/lumberjack/Message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ namespace lumberjack
{
/*!
*****************************************************************************
* \brief Message to indicate no messages need to be sent from child node.
* \brief Message indicating no messages need to be sent from child node.
*****************************************************************************
*/
const char* const zeroMessage = "0";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm understanding the issue properly, would another possible fix be to keep the global variable zeroMessage as is, but copy it to a local variable before each usage?

(Not necessarily requesting any changes, just trying to understand the issue).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that should work, and the local variable should be a char array instead of a pointer (Following this bulletpoint from the JIRA ticket: use local variables (although for the CHAR type, local constant needs to be a char array))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to still have this pointer but point it to the storage that was added in Message.cpp with the same name? That way there is only one place that this is stored.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to still have this pointer but point it to the storage that was added in Message.cpp with the same name? That way there is only one place that this is stored.

I'll give this a try.

Based on previous discussion from yesterday, this current iteration has zeroMessage be a function that returns a std::string.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the following:

// Message.hpp
extern const char * zeroMessage;

---------------------------------------------------------
// Message.cpp
const char * zeroMessage = "0";

The same bug appears in this case. (Code-wise, I'm not sure if this is what you had in mind, if so, let me know!)

@MrBurmark MrBurmark Jul 1, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking something more like this.

// Message.hpp
extern const char * const zeroMessage;
---------------------------------------------------------
// Message.cpp
char zeroMessageStorage[] = "0";
const char * const zeroMessage = zeroMessageStorage;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also use a std::array<char, 2> zeroMessage{"0"}; instead of a std::string to make it easy to make a local copy. Then use zeroMessage.data() when you need the pointer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking something more like this.

Thanks @MrBurmark, that works and is pretty clean!

extern const char* const zeroMessage;

/*!
*****************************************************************************
Expand Down