Skip to content

Conversation

@rfalgout
Copy link
Collaborator

This PR adds a linear MGRIT implementation to braid. I made it a draft PR because we should change the "switch" to a runtime switch (add a Set function to turn it on/off) and we need to write some brief documentation and probably also a regression test. Otherwise, the code has already been tested thoroughly on the linear branch (this linear-pr branch is the same, but is up to date with master)

@rfalgout rfalgout requested a review from jbschroder May 18, 2023 15:46
@rfalgout
Copy link
Collaborator Author

BTW, when I compile on my mac, I get the following warning:

Building ex-01-pp ...
mpicxx -g -Wall -fPIC -I../braid ex-01-pp.cpp -o ex-01-pp ../braid/libbraid.a -lm -lstdc++
ex-01-pp.cpp:292:4: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
   sprintf(filename, "%s.%04d.%03d", "ex-01.out", index, rank);
   ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.

This has something to do with the code merged here from master.

@jbschroder
Copy link
Member

My homebrew clang 15.0.2 doesn't throw that warning, but from a little reading, some compilers (like Mac Developer Tools) have started throwing that warning. Either way, snprintf seems to be C99 compliant, so switching to it shouldn't be a problem.

/* Don't need to update the rhs in the linear case (no Richardson either) */
}
else
{
Copy link
Member

Choose a reason for hiding this comment

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

Should we indent this code block?

/* Don't need to update the rhs in the linear case (no Richardson either) */
}
else
{
Copy link
Member

Choose a reason for hiding this comment

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

Should we indent this code block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. I wanted the diffs to be clear when I first implemented this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants