Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to use stdout #53

Closed
wants to merge 2 commits into from
Closed

Conversation

DE0CH
Copy link
Contributor

@DE0CH DE0CH commented Feb 21, 2023

I decided to just modify runcommand to print to stdout and read from stdin instead of doing anything more complicated. It will just print what it would normally run in the shell to stdout with stdout://targetRunner and stdout://targetEvaluator as the first argument to differentiate the two. This has the advantage of benefiting from all the documentation and error checking of the codebase. I don't really have a good way to implement parallelism so I just ask the user to use targetEvaluator if they want to know all the runs of a batch and run them in parallel.

part of #34

@MLopez-Ibanez
Copy link
Owner

  • Could you add a test showing how this will work in practice? Will there be some kind of server reading the output of irace and launching commands?

  • Parallel evaluation seems impossible with this approach: There is nothing that ensures the order of the stuff read from stdin, no?

  • I'm not sure how targetEvaluator can ever work under this approach, because output <- readLines(file("stdin"), n=1) implies that runcommand must receive something from targetRunner.

@DE0CH
Copy link
Contributor Author

DE0CH commented Feb 23, 2023

Could you add a test showing how this will work in practice? Will there be some kind of server reading the output of irace and launching commands?

I don't really know how the testing framework works. Could you please tell me where to put the test and what command I need to use to run the test?

Parallel evaluation seems impossible with this approach: There is nothing that ensures the order of the stuff read from stdin, no?

Yeah. There's no easy way to do this. stdin is sequential and the only way to do this is to have the line to contain an ID which irace and then match it with the corresponding run. But I don't really know how to do that in r.

I'm not sure how targetEvaluator can ever work under this approach, because output <- readLines(file("stdin"), n=1) implies that runcommand must receive something from targetRunner.

The idea is you have some dispatcher reading stdout and if the line starts with stdout://targetRunner or stdout://targetEvaluator, you send it to targetRunner or targetEvaluator, otherwise you treat it as a log and print it somewhere else.

@MLopez-Ibanez
Copy link
Owner

Could you add a test showing how this will work in practice? Will there be some kind of server reading the output of irace and launching commands?

I don't really know how the testing framework works. Could you please tell me where to put the test and what command I need to use to run the test?

https://testthat.r-lib.org/

You can also see in Makefile how I run the tests and in https://github.com/MLopez-Ibanez/irace/blob/master/.github/workflows/R-CMD-check.yaml for another way to run them.

@MLopez-Ibanez MLopez-Ibanez force-pushed the master branch 3 times, most recently from bf31b9f to a576861 Compare May 19, 2023 15:01
@MLopez-Ibanez MLopez-Ibanez force-pushed the master branch 2 times, most recently from 4be55e9 to 2f34452 Compare June 2, 2023 12:35
@DE0CH DE0CH closed this Dec 30, 2023
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