{"id":29538741,"url":"https://github.com/arc-w/core-scheduling","last_synced_at":"2025-07-17T05:15:44.379Z","repository":{"id":304240724,"uuid":"1018205277","full_name":"arc-w/Core-Scheduling","owner":"arc-w","description":"Core Scheduling: Minimizing Energy with Deadlines and Dependency Cycles","archived":false,"fork":false,"pushed_at":"2025-07-11T20:07:03.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-11T22:06:08.794Z","etag":null,"topics":["cpp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arc-w.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-11T19:45:59.000Z","updated_at":"2025-07-11T20:25:16.000Z","dependencies_parsed_at":"2025-07-13T02:45:58.789Z","dependency_job_id":null,"html_url":"https://github.com/arc-w/Core-Scheduling","commit_stats":null,"previous_names":["arc-w/core-scheduling"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/arc-w/Core-Scheduling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arc-w%2FCore-Scheduling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arc-w%2FCore-Scheduling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arc-w%2FCore-Scheduling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arc-w%2FCore-Scheduling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arc-w","download_url":"https://codeload.github.com/arc-w/Core-Scheduling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arc-w%2FCore-Scheduling/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265567428,"owners_count":23789478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp"],"created_at":"2025-07-17T05:15:28.941Z","updated_at":"2025-07-17T05:15:44.372Z","avatar_url":"https://github.com/arc-w.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"This project is homework from my university. The code is my solution. Here is the description:  \n# Core Scheduling: Minimizing Energy with Deadlines and Dependency Cycles\nIntroduction\nModern computing systems often feature multiple processing cores with varying performance\ncharacteristics (speed) and power consumption rates. Efficiently scheduling tasks across these\nheterogeneous cores is crucial, especially in real-time systems where tasks must be completed by\nspecific deadlines. A primary goal in mobile and embedded systems is to minimize energy\nconsumption while guaranteeing that all tasks meet their timing constraints and respect any\ndependencies between them.  \nYou are tasked with developing a scheduler for a set of computational tasks that need to be\nexecuted on a system with multiple heterogeneous cores. Each task has a defined computational\nworkload, a deadline by which it must be completed, and potential dependencies on other tasks.\nEach core type has a specific processing speed and a power consumption rate (energy consumed\nper unit of time).  \nThe goal is to find a schedule (an assignment of each task to a core, along with a start and end\ntime) that minimizes the total energy consumed by all cores while ensuring:  \n1. Dependency Constraints:\nIf Task A must complete before Task B can start (denoted A -\u003e B), the scheduled end\ntime of Task A must be less than or equal to the scheduled start time of Task B. Tasks and\ntheir dependencies can be modeled as a directed graph.  \n2. Deadline Constraints:\nEvery task must be completed on or before its specified deadline.  \n3. Core Constraints:\nA single core can only execute one task at a time.  \nDependency Graph Analysis\nTask dependencies should ideally form a Directed Acyclic Graph (DAG). However,\nconfiguration errors or specific system models might introduce cycles. Before attempting\nscheduling, you must analyze the task dependency graph to detect any cyclic dependencies.  \n● Graph Traversal: Techniques that systematically traverse the graph are required to\nidentify strongly connected components or back-edges, which indicate cycles.  \n● Direct Mutual Dependency (2-Cycle): If the analysis reveals exactly two tasks, say Task\nA and Task B, forming a direct mutual dependency (A -\u003e B and B -\u003e A), this represents a\nspecial constraint. These two tasks must be scheduled to start at the exact same time, but\non different cores. This parallel execution constraint overrides the standard finish-to-start\ndependency between only these two tasks. All other dependencies involving Task A or\nTask B must still be respected. If this parallel execution is impossible (e.g., not enough\ncores, violates deadlines, or conflicts with other dependencies), then no valid schedule\nexists.  \n● Larger Cycles: If a cycle involves three or more tasks, a valid schedule satisfying all\nconstraints is considered impossible.  \nFinding the Minimum Energy Schedule  \nIf the dependency graph is valid (either a DAG or contains only resolvable 2-cycles), you need to\nfind the schedule with the minimum total energy.  \n● State-Space Exploration: Consider the process of building a schedule step-by-step. A\npartial schedule can be thought of as a \"state,\" perhaps defined by the set of completed\ntasks and the times when each core becomes available next. Finding the optimal schedule\ninvolves exploring this space of possible states.  \n● Systematic Search: A systematic search strategy is needed to explore these states. Since\nthe goal is minimum energy, the search should prioritize exploring states that have\nresulted in lower accumulated energy consumption so far.  \n● Cost Tracking: Maintaining the minimum energy cost found to reach each distinct state\nis crucial to avoid redundant work and ensure optimality.  \n● Efficient Exploration: The number of possible states can be large. Employing a data\nstructure that allows efficient retrieval of the most promising (lowest-energy) state to\nexplore next is highly recommended for performance.  \nEnergy Calculation  \n● The execution time of a task on a specific core is calculated as: Task Workload / Core\nSpeed  \n● The energy consumed by a task on a specific core is: Execution Time * Core Power Rate  \n● The total energy for a schedule is the sum of the energy consumed by all tasks  \nInput Format  \nInput will be provided via a text file named input.txt with the following structure:  \nN # Number of tasks  \nTask Info (N lines): TaskID Workload Deadline  \nT1_ID T1_Workload T1_Deadline  \nT2_ID T2_Workload T2_Deadline  \n...  \nTN_ID TN_Workload TN_Deadline  \nM # Number of dependencies  \nDependency Info (M lines): From_TaskID To_TaskID  \nDep1_From Dep1_To  \nDep2_From Dep2_To  \n...  \nDepM_From DepM_To  \nK # Number of core types  \nCore Info (K lines): CoreSpeed CorePowerRate  \nCore1_Speed Core1_PowerRate  \nCore2_Speed Core2_PowerRate  \n● N, M, K - positive integers  \n● TaskIDs are positive integers (not necessarily sequential).  \n● Workload, Deadline, CoreSpeed, CorePowerRate - positive floating-point numbers.  \n● Dependencies are specified using the original TaskIDs.  \n● Core types are implicitly assigned IDs 0, 1, ..., K-1 based on their order in the input.  \nOutput Format  \nYour program should output the results to the standard output.  \nCycle Detection Output:  \n● Before other output, print messages related to cycle detection as described above\n(warnings for cycles, confirmation of DAG status). Use standard error for warnings and\nstandard output for the DAG confirmation message. Ensure output buffers are flushed\nappropriately so these messages appear in the correct order relative to subsequent output.  \nExample warning:  \n Warning: Cycle detected involving tasks (1-based IDs): { 2, 1 }  \n● If cycles are detected, indicate the attempt to proceed:\n Attempting to schedule based on special cycle handling rules.  \nScheduling Results:  \n● If a valid schedule is found:  \n○ Print the minimum total energy: Minimum Total Energy Consumed: XXX.XX  \n○ Print the schedule table and the details for each task (Task ID, Core ID, Start  \nTime, End Time, Energy)\n● If no valid schedule is found:  \n Scheduling failed. No solution found that meets all deadlines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farc-w%2Fcore-scheduling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farc-w%2Fcore-scheduling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farc-w%2Fcore-scheduling/lists"}