Abstract
Since Scilab is an open source, various practitioners use it to simulate real-time applications and systems. However, Simulation cannot be achieved in zero time. Knowing execution time is a key to develop an accurate simulation in real-time areas. Precise measurement of execution time is important in area about life safety, such as military equipments, automotive and aerospace industries. As we known, Matlab has a Profiler function which could measure where a program spends time. By using Matlab Profiler, we could evaluate and improve performance of programs. What I want to do is to make a similar function for Scilab. We use Xcos to make models that have many blocks. In some cases, we want to know execution time of these blocks. A variety of literatures introduce the way of measuring execution time but they did not present directly time to users. Therefore, in this project, I will measure time and present time to users.
Progress
1 |
Discuss what should i do |
done |
2 |
Adding codes to do_compile_superblock42.sci file to automatically test execution time |
done |
3 |
Transfer outputs to workspace by adding codes |
failed |
4 |
Make a "Profiler" button |
failed |
5 |
Collecting outputs during simulation and make a json file to present results |
done |
6 |
Write a "Profiler.sci" file to present json result |
done |
7 |
Make json result has a 'rpar' structure in model details |
done |
Week 1-2 report
1. Be familiar with scilab code generation function.
2. Find a way to add codes to test execution time
3. Make sure adding codes in standalone file or computational file
Week 3-4 report
1. Be sure to add codes in computational file
2. Change do_compile_superblock42.sci file
3. Make a bin file for new do_compile_superblock42.sci file
Week 5 report
1. Adding some codes to transfer outputs to workspace, but failed
2. Find another way. Make a "profiler" button. And collecting outputs during simulation and make a json file to present resluts.
- But i am trying this way.
Week 5-6 report
1. I add codes to test execution time for every block in superblock
2. I wrote codes to put time result in a json code
3. When i did code generation, it can work.But there is a critical error in scilab. I think there are potential error in my json codes.
- I will find it in next week. But if it doesn't work, i will find another way to print outputs.
4. In every "call of block" i add time codes and json codes. But this extends excution time. So i will put these time results of everyblock in buffers, and transfer to jsonc in the last.
Week 7 report
1. I have add codes to transfer result to json file. It has some errors firstly when i add pointers. So i changed to write in scilab language and it succeeded.
- Now in json file, left is name of block, right is time result.
Week 8-9 report
1. I will think about more complex models. Like a superblock has a superblock inside.How to transfer all time results in json file.(done)
2. Write a 'Profiler.sci' file to present json result in workspace.
3. "time.h" way to test time is not accurate. I use "Windows.h". QueryPerformanceCounter is more accurate but it is only for windows.
Week 10-12 report
1. Present json result like 'rpar' structure
2. Make 'Linux' edition(use "time.h")
Next
Try to transfer json to html which is easier for user to see
Code
https://github.com/Rui517/do_profile_superblock42
Contact way
Email: rui.shi@tu-clausthal.de