Replies: 10 comments
-
I think this is one side of the coin. However, the initial concern of my comment is another. If we use test configurators to set |
Beta Was this translation helpful? Give feedback.
-
But what would the test be? The numbers of workers does not affect program output. |
Beta Was this translation helpful? Give feedback.
-
Whether the target property We have precedence for this in the Rust target. While the code generator was able to deal with the threads set in the target config, the |
Beta Was this translation helpful? Give feedback.
-
How do we know that the specified number of workers is truly set? Wouldn't inspecting the config that the runtime reports be sufficient? Is there any other way to check? |
Beta Was this translation helpful? Give feedback.
-
On Linux, you could externally verify how many threads a process is using (via But I think what @cmnrd wants could be achieved via a test like this (at least in the C target): target C { workers: 16 };
main reactor {
reaction(startup) {=
if (NUMBER_OF_WORKERS != 16) {
error_print_and_exit("Expected to have 16 workers");
}
=}
} |
Beta Was this translation helpful? Give feedback.
-
@Soroosh129 your suggestion is implementable now and does not require any standardization across targets or parsing program output like this issue proposes. I still think the functionality described in this issue would be useful, but I suggest we decouple it from the issue of testing the |
Beta Was this translation helpful? Give feedback.
-
A test like Soroush proposes would also be easy to implement in C++. However, given our current test setup, this test will fail since the configurators will invoke lfc with |
Beta Was this translation helpful? Give feedback.
-
But I already added a test for C++? See Workers.LF |
Beta Was this translation helpful? Give feedback.
-
Oh, ok. So you removed the configurator that sets the number of workers. Looks like a viable solution to me :) |
Beta Was this translation helpful? Give feedback.
-
Is there anything other than the number of workers that would be useful to print out? I added the following to the C threaded runtime: info_print("---- Using %d workers.", _lf_number_of_workers); |
Beta Was this translation helpful? Give feedback.
-
@cmnrd raised the following question:
When in debug mode, all runtime implementations could print a summary of their settings, including how many workers it uses. I think it would be quite useful to standardize what this summary would look like. Once we spec this out, we should implement it in all targets and have tests that simply check the output.
Beta Was this translation helpful? Give feedback.
All reactions