Skip to content

Document print_configuration - #906

Open
dalg24 wants to merge 1 commit into
kokkos:mainfrom
dalg24:print_configuration
Open

Document print_configuration#906
dalg24 wants to merge 1 commit into
kokkos:mainfrom
dalg24:print_configuration

Conversation

@dalg24

@dalg24 dalg24 commented Aug 18, 2026

Copy link
Copy Markdown
Member

Assisted-by: Claude:claude-4.5-sonnet

Close #888

Signed-off-by: Damien L-G <dalg24@gmail.com>
Assisted-by: Claude:claude-4.5-sonnet
Comment on lines +61 to +65
* Useful for debugging and verifying the Kokkos build configuration and runtime settings
* The output includes both compile-time and runtime information:

* **Compile-time**: Enabled execution spaces, memory spaces, compiler information, and feature flags
* **Runtime**: Number of threads (for host parallel backends like OpenMP, Threads), number of visible devices and device ID in use (for device backends like CUDA, HIP, SYCL)

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.

This is kind of a repetition of what was said at the top in the Usage section

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What change would you like to see?

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.

I would just remove it. The info does not have to be twice on the page

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Which would you remove? This one goes more into "detail".

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.

this one here. Since we do not give any promises about what it contains or how it is formatted, I would just leave it at "Useful for debugging and verifying the Kokkos build configuration"

* **Compile-time**: Enabled execution spaces, memory spaces, compiler information, and feature flags
* **Runtime**: Number of threads (for host parallel backends like OpenMP, Threads), number of visible devices and device ID in use (for device backends like CUDA, HIP, SYCL)

* Must be called after :cpp:func:`Kokkos::initialize` to display runtime information

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.

should we promote that to a warning?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure.
Make the one below two bulleted points or separate block?

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.

no preference

Comment on lines +42 to +54
Kokkos::initialize(argc, argv);

// Print basic configuration to the standard output
Kokkos::print_configuration(std::cout);

// Write vebose configuration to a log file
std::ofstream log_file("kokkos_config.log");
if (log_file.is_open()) {
Kokkos::print_configuration(log_file, /*verbose=*/ true);
log_file.close();
}

Kokkos::finalize();

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.

Should this also have the scope between initialize and finalize?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can add if you prefer. There is no Kokkos object so it is not technically needed.
Let me know if you want me to add it.

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.

Maybe we should add it for consistency? but I do not feel strong about this

Kokkos::print_configuration(std::cout);
Kokkos::print_configuration(output_stream, /*verbose=*/ true);

Prints Kokkos configuration information ("bill of materials") to an output

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.

I am not sure if bill of materials is a good thing to put here ... I would omit it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why not?
That was the claimed motivation to add it
kokkos/kokkos#632
and there is still a comment to that effect in the code
https://github.com/kokkos/kokkos/blob/dfa6599eb2d3277815cc2f406cc56cf66e02f85c/core/src/impl/Kokkos_RuntimeInfo.hpp#L11-L12

Is that misusing the terminology?
I thought it was on point, because it does spell out what Kokkos it is (version and configuration settings).

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.

I think it is too close to https://en.wikipedia.org/wiki/Software_supply_chain (SBOM)
I rather see it as a configuration of internal settings than a list of software that is used in Kokkos

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.

print_configuration is not documented

2 participants