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

[PrematureStopping] Refactor CSignal class to use RxCpp utilities. #3848

Merged
merged 4 commits into from Jun 23, 2017

Conversation

Projects
None yet
3 participants
@geektoni
Contributor

geektoni commented Jun 15, 2017

This PR should contains the new CSignal implementation which will be using RxCpp. However, there are still some things that needs to be addressed (CSignal::cancel_computation, there is still Windows code etc.).

@karlnapf

This comment has been minimized.

Member

karlnapf commented Jun 16, 2017

@geektoni can you write down a simple use case from an algorithm implementation perspective? Thx

@geektoni

This comment has been minimized.

Contributor

geektoni commented Jun 19, 2017

@karlnapf Do you mean how this new CSignal will be used?

@geektoni geektoni changed the title from [PrematureStopping] Refactor CSignal class to use RxCpp utilities (WIP) to [PrematureStopping] Refactor CSignal class to use RxCpp utilities. Jun 19, 2017

@geektoni

This comment has been minimized.

Contributor

geektoni commented Jun 20, 2017

@karlnapf I made a small code and output example to show the basic behavior that CSignal will allow: https://gist.github.com/geektoni/1afd2daf69a813de64252a296997a8ea

@vigsterkr

This comment has been minimized.

Member

vigsterkr commented Jun 21, 2017

148 - unit-Signal (OTHER_FAULT)

@vigsterkr

This comment has been minimized.

Member

vigsterkr commented Jun 22, 2017

a bit of a more information

Note: Google Test filter = Signal.*

[==========] Running 2 tests from 1 test case.

[----------] Global test environment set-up.

[----------] 2 tests from Signal

[ RUN      ] Signal.SIGINT_test

/opt/shogun/tests/unit/lib/Signal_unittest.cc:26: Failure

Death test: { CSignal tmp; tmp.enable_handler(); int on_next_v = 0; int on_complete_v = 0; auto sub = rxcpp::make_subscriber<int>( [&on_next_v](int v) { on_next_v = 1; }, [&]() { on_complete_v = 1; }); tmp.get_SIGINT_observable().subscribe(sub); tmp.get_SIGINT_observable().connect(); switch (0) case 0: default: if (const ::testing::AssertionResult gtest_ar_ = ::testing::AssertionResult((on_complete_v == 1))) ; else ::testing::internal::AssertHelper(::testing::TestPartResult::kNonFatalFailure, "/opt/shogun/tests/unit/lib/Signal_unittest.cc", 26, ::testing::internal::GetBoolAssertionFailureMessage( gtest_ar_, "on_complete_v == 1", "false", "true").c_str()) = ::testing::Message(); exit(0); }

    Result: died but not with expected exit code:

            Terminated by signal 6 (core dumped)

Actual msg:

[  DEATH   ] terminate called without an active exception

[  DEATH   ] 

[  FAILED  ] Signal.SIGINT_test (286 ms)

[ RUN      ] Signal.SIGURG_test

terminate called without an active exception```

geektoni added some commits Jun 19, 2017

[PrematureStopping] Replace observables with rxcpp::subject::subject.
Other:
* Add algorithm pausing option and its unit tests.
* Fixed also a bug related to selecting an option from the command line.
* Add reset_handler() to reset the handler's objects;
* Guarded Signal getter methods to prevent SWIG translation;

@vigsterkr vigsterkr merged commit 3f3c799 into shogun-toolbox:feature/premature-stopping Jun 23, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
default DEV build done.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment