ksundberg / coursematerials Goto Github PK
View Code? Open in Web Editor NEWCourse materials for various computer science courses
License: MIT License
Course materials for various computer science courses
License: MIT License
The tasks never get their completion time set when they finish so you cant calculate the latencies.
Events that execute jobDone()
are pushed to the queue but never have their process()
called.
In Simulation.cpp this line appears twice: auto dev = jobs[job].tasks[jobs[job].cur].device;
followed by some form of devices[dev]
. When stepping though however, dev
is sometimes outside the bounds of devices
.
Job: 3 dev: 2 size: 2
Job: 3 dev: 2 size: 2
Job: 4 dev: 2 size: 2
Job: 6 dev: 2 size: 2
Job: 3 dev: 2 size: 2
Job: 3 dev: 2 size: 2
Job: 4 dev: 2 size: 2
Job: 1 dev: 2 size: 2
Job: 9 dev: 2 size: 2
Job: 9 dev: 2 size: 2
It appears that the FifoReadyQueue for each device may not actually be initialized. I am getting a segfault when a job is pushed onto a device queue. From the debugger it looks like the queue is pointing at garbage memory.
queue {Cannot access memory at address 0x40d5fbde00000000
#0 0x000000000041ddb9 in __gnu_cxx::new_allocator<int>::construct<int, int const&> (this=0x6483f0, __p=0xbf800000) at /usr/include/c++/5/ext/new_allocator.h:120
#1 0x000000000041dbe1 in std::allocator_traits<std::allocator<int> >::construct<int, int const&> (__a=..., __p=0xbf800000) at /usr/include/c++/5/bits/alloc_traits.h:530
#2 0x000000000041da96 in std::deque<int, std::allocator<int> >::push_back (this=0x6483f0, __x=@0x7fffffffda64: 2) at /usr/include/c++/5/bits/stl_deque.h:1521
#3 0x000000000041d9ff in std::queue<int, std::deque<int, std::allocator<int> > >::push (this=0x6483f0, __x=@0x7fffffffda64: 2) at /usr/include/c++/5/bits/stl_queue.h:216
#4 0x000000000041d94c in cs3100::FifoReadyQueue::add (this=0x6483e8, x=2) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/FifoReadyQueue.cpp:5
#5 0x00000000004204aa in cs3100::Simulation::scheduleIo (this=0x648ba0, job=2) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/Simulation.cpp:57
#6 0x000000000042088b in cs3100::Simulation::jobDone (this=0x648ba0, job=2, time=4.34699965) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/Simulation.cpp:85
#7 0x0000000000420011 in cs3100::Simulation::<lambda()>::operator()(void) const (__closure=0x649180) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/Simulation.cpp:48
#8 0x00000000004217c3 in std::_Function_handler<void(), cs3100::Simulation::scheduleJob()::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/5/functional:1871
#9 0x0000000000422718 in std::function<void ()>::operator()() const (this=0x649180) at /usr/include/c++/5/functional:2267
#10 0x0000000000420c50 in cs3100::Simulation::run (this=0x648ba0) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/Simulation.cpp:129
#11 0x0000000000427159 in main () at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/scheduler_main.cpp:77#0 0x000000000041ddb9 in __gnu_cxx::new_allocator<int>::construct<int, int const&> (this=0x6483f0, __p=0xbf800000) at /usr/include/c++/5/ext/new_allocator.h:120
Events are run from greatest time to lowest time. The priority needs reversed so they go lowest to highest.
The simulator will always put the first task on the cpu whether it is a cpu task or io task.
It appears that on the 3rd or so task of a job incrementing fails. The next task it pulls up tends to be either the same task or a the first task of the job, or just a garbage task that makes no sense.
Segfaults or has memory corruption randomly. Increases with higher numbers of jobs.
devices are never created so when an IO job is scheduled there is a segfault.
I was able to work around or fix every bug except for there is an odd edge case where a single job is scheduled an extra time. This happens every time the simulator is run but only happens once per run. I cannot figure out where it is getting scheduled.
I worked around that by ignoring ioDone and jobDone for tasks that are already finished. My fixed version of the simulator is attatched. scheduler.tar.gz
I appear to randomly be getting segfaults when pushing items onto FifoReadyQueues whether it is a device queue or the event queue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.