Skip to content

Conversation

ritvikrao
Copy link
Collaborator

@ritvikrao ritvikrao commented Sep 30, 2025

This adds a priority queue to Reconverse.

For most messages in Charm++, when a receiving PE or node gets a Charm++ message (like an entry method call), it first enqueues that call into a priority queue. Then, the receiving PE or node polls the priority queue if the Converse PE and node queues are empty, triggering the execution of entry methods. This has the effect of prioritizing Converse-level messages over Charm messages, but also lets Charm applications use priorities to more closely control the execution of their programs.

Charm++ already has the infrastructure to support priorities, but this adds support to Reconverse. The main difference between the reconverse implementation and the old converse one is the use of std::priority_queue in reconverse, as opposed to the custom haeap implementation in old Converse (each priority level is a linked list).

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds priority queue support for Charm++ messages in Reconverse, implementing a priority-based message scheduling system. This allows Charm++ applications to control execution order more precisely by assigning priorities to messages.

Key changes:

  • Implements priority queues using std::priority_queue for both node-level and thread-level message scheduling
  • Adds CqsEnqueueGeneral function to handle different queueing strategies (FIFO, LIFO, integer priorities, long long priorities)
  • Updates the scheduler to process priority queues after regular Converse queues but before falling back to communication backend progress

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/scheduler.cpp Adds priority queue polling logic to both CsdScheduler() and CsdSchedulePoll() functions, implements CqsEnqueueGeneral for message enqueueing with priorities
src/convcore.cpp Initializes priority queue data structures and locks during system startup
src/cldb.rand.cpp Updates message handlers to use the new priority-aware enqueueing functions instead of direct PE pushing
include/converse.h Defines priority queue types, comparator, and function declarations; moves lock type definitions and adds convenience macros

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ritvikrao ritvikrao marked this pull request as ready for review October 1, 2025 16:53
ritvikrao and others added 5 commits October 1, 2025 11:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

1 participant