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

Code cleanup to use concept serial / parallel to replace single-threaded / multi-threaded as task execution modes #10792

Closed

Conversation

zhztheplayer
Copy link
Contributor

@zhztheplayer zhztheplayer commented Aug 21, 2024

A code cleanup for task execution mode concepts, to uniformly use serial / parallel. Remove usages of single-threaded / multi-threaded.

Fixes #10745

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 21, 2024
Copy link

netlify bot commented Aug 21, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 4910436
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/66d1215c158590000829c178

@zhztheplayer
Copy link
Contributor Author

@tanjialiang @xiaoxmeng

@zhztheplayer zhztheplayer marked this pull request as ready for review August 21, 2024 02:08
@zhztheplayer zhztheplayer changed the title Code cleanup to use concept serial / parallel to replace single-threaded / multi-threaded in task execution Code cleanup to use concept serial / parallel to replace single-threaded / multi-threaded as task execution modes Aug 21, 2024
@zhztheplayer
Copy link
Contributor Author

@tanjialiang Would you review this? Thanks.

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

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

@zhztheplayer thanks for the refactor. Not sure if we want to rename things in test code.

@@ -241,7 +241,7 @@ class BlockingState {
}

/// Moves out the blocking future stored inside. Can be called only once.
/// Used in single-threaded execution.
/// Used in serial execution.
Copy link
Contributor

Choose a reason for hiding this comment

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

serial execution mode.

};
} // namespace

/// A test fixture that runs cases within multi-threaded execution mode.
/// A test fixture that runs cases within parallel execution mode.
class SharedArbitrationTest : public SharedArbitrationTestBase {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove SharedArbitrationTestBase? Let's do this first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will open a pr asap

@@ -3277,7 +3277,7 @@ TEST_F(TableScanTest, remainingFilterLazyWithMultiReferences) {
writeToFile(file->getPath(), {vector});
CursorParameters params;
params.copyResult = false;
params.singleThreaded = true;
params.serial = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

s/serial/serialExecutionMode/

@@ -63,8 +63,8 @@ struct CursorParameters {

bool copyResult = true;

/// If true, use single threaded execution.
bool singleThreaded = false;
/// If true, use serial execution. Use parallel execution otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

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

use serial execution mode.

/// If true, use single threaded execution.
bool singleThreaded = false;
/// If true, use serial execution. Use parallel execution otherwise.
bool serial = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

s/serial/serialExecutionMode/

@@ -204,20 +204,20 @@ class TaskCursorBase : public TaskCursor {
std::shared_ptr<folly::Executor> executor_;
};

class MultiThreadedTaskCursor : public TaskCursorBase {
class ParallelTaskCursor : public TaskCursorBase {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to rename this?

@@ -943,7 +947,7 @@ void Task::resume(std::shared_ptr<Task> self) {
// event. The Driver gets enqueued by the promise realization.
//
// Do not continue the driver if no executor is supplied,
// This usually happens in single-threaded execution.
// This usually happens in serial execution.
Copy link
Contributor

Choose a reason for hiding this comment

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

execution mode.

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

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

@zhztheplayer LGTM. Thanks!

@@ -34,17 +34,17 @@ TEST_F(AssertQueryBuilderTest, basic) {
.assertResults(data);
}

TEST_F(AssertQueryBuilderTest, singleThreaded) {
TEST_F(AssertQueryBuilderTest, serial) {
Copy link
Contributor

Choose a reason for hiding this comment

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

s/serial/serialExecution/

@facebook-github-bot
Copy link
Contributor

@xiaoxmeng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@xiaoxmeng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@xiaoxmeng merged this pull request in ede7d0b.

Copy link

Conbench analyzed the 1 benchmark run on commit ede7d0bf.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this pull request Sep 2, 2024
…ded / multi-threaded as task execution modes (facebookincubator#10792)

Summary:
A code cleanup for task execution mode concepts, to uniformly use `serial` / `parallel`. Remove usages of `single-threaded` / `multi-threaded`.

Fixes facebookincubator#10745

Pull Request resolved: facebookincubator#10792

Reviewed By: Yuhta, bikramSingh91

Differential Revision: D61956385

Pulled By: xiaoxmeng

fbshipit-source-id: c601451cc5059aaec304d9e7c34506856f51fbdf
Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this pull request Sep 3, 2024
…ded / multi-threaded as task execution modes (facebookincubator#10792)

Summary:
A code cleanup for task execution mode concepts, to uniformly use `serial` / `parallel`. Remove usages of `single-threaded` / `multi-threaded`.

Fixes facebookincubator#10745

Pull Request resolved: facebookincubator#10792

Reviewed By: Yuhta, bikramSingh91

Differential Revision: D61956385

Pulled By: xiaoxmeng

fbshipit-source-id: c601451cc5059aaec304d9e7c34506856f51fbdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code clean up to use concept serial / parallel to replace single-threaded / multi-threaded in task execution
3 participants