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

BF Scheduler #11

Open
dbaltieri opened this issue Feb 6, 2018 · 2 comments
Open

BF Scheduler #11

dbaltieri opened this issue Feb 6, 2018 · 2 comments

Comments

@dbaltieri
Copy link

Hello everyone,

Today Im trying to simulate some of the available schedulers, but only one it is not working (BF), returning the following message:

screen shot 2018-02-06 at 5 37 06 pm
The simulation using BF scheduler

screen shot 2018-02-06 at 5 40 34 pm
The simulation using EKG scheduler

How to simulate using BF Algorithm ?

@MaximeCheramy
Copy link
Owner

Could you provide the script as a text file instead of an image?

According to the code, the error can only happen if job.wcet = 0, which is surprising according to your configuration...

ui = job.wcet / job.deadline
return (1. - (bk1 * ui - int(bk1 * ui))) / ui

@dbaltieri
Copy link
Author

dbaltieri commented Feb 15, 2018

Yes. In this code I'm using EKG scheduler, but if try to execute BF I get that error.

`import sys
from simso.core import Model
from simso.configuration import Configuration

def main(argv):
if len(argv) == 2:
# Configuration load from a file.
configuration = Configuration(argv[1])
else:
# Manual configuration:
configuration = Configuration()

    configuration.duration = 420 * configuration.cycles_per_ms

    # Add tasks:
    configuration.add_task(name="T1", identifier=1, period=7,
                           activation_date=0, wcet=3, deadline=7)
    configuration.add_task(name="T2", identifier=2, period=12,
                           activation_date=0, wcet=3, deadline=12)
    configuration.add_task(name="T3", identifier=3, period=20,
                           activation_date=0, wcet=5, deadline=20)

    # Add a processor:
    configuration.add_processor(name="CPU 1", identifier=1)
    configuration.add_processor(name="CPU 2", identifier=2)


    # Add a scheduler:
    #configuration.scheduler_info.filename = "simso/schedulers/BF.py"
    configuration.scheduler_info.clas = "simso.schedulers.BF"

# Check the config before trying to run it.
configuration.check_all()

# Init a model from the configuration.
model = Model(configuration)

# Execute the simulation.
model.run_model()

# Print logs.
for log in model.logs:
    print (log)

main(sys.argv)`

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

No branches or pull requests

2 participants