Posts

End of GSoC 2.0

    My second innings of Google Summer of Code comes to an end. I have learned a lot of things. There is still some work left which I will complete after my exams. The link to my summer internship report is https://gist.github.com/debashish05/e1ec288a81d77e0fe61cbf336d147109 . I have learned a lot of things from my mentors and develop an inclination towards research. Works Done during this period: 1) RRPlugins have been integrated with Libroadrunner. So we don't require a separate build for rrplugins. Earlier this task was achieved in my last year project. But the problem is the change in roadrunner will force the plugins to need to rebuild, which is not the case now. 2) Build time will reduce since the plugins and roadrunner are not interdependent. Updated all the plugins (https://github.com/sys-bio/rrplugins/tree/master/plugins/released), in the current system. Earlier these plugins were not working due to outdated wrapper and some minor bugs. 3) Updated Python wrapper for r...

Monte Carlo Bootstrap

Image
 The main work of Monte Carlo is to " Get some confidence   estimates".   The Monte Carlo plugin is used to obtain estimates of the confidence limits for a model’s parameters. This is in the context where experimental data exists and a parameter minimization method, such as Levenberg-Marquardt or Nelder-Mead has already been used in order to find a parameter minimum. The Monte Carlo algorithm is used subsequently at this minimum and will give an estimate of parameter confidence limits corresponding to the variance in the original experimental data. The plugin has properties such as the size of the Monte Carlo population, minimization algorithm to use (e.g. Nelder-Mead or Levenberg-Marquardt), and on output, confidence limits for each involved parameter. With some past updates, Monte Carlo is not working mainly due to the modifications in rrplugins and change of python version from 2.x to 3.x. I have modified the wrapper to let it work. Majorly the problem was with the pas...

Update old plugins to Work in the current system

Image
 I have updated all the plugins ( https://github.com/sys-bio/rrplugins/tree/master/plugins/released ) working in the old system. Mostly they are not working because of the wrapper. When we pass a python string to C through CPython we need to it the format ctypes.c_char_p(String.encode('utf-8')) where String is the "string" we need to pass. Currently, the optimizer is not working if we need to fit the data by skipping any species. It is the first bad design I have seen in rrplugins. Now I am trying to port all the plugins from the old system to the new system.  One of the optimization example where I have to fit rate K1 and K2 based on species S1, S2, and S3 is:  Model: antimony_str = """ J1: S1 -> S2; k1*S1 J2: S2 -> S3; k2*S2    S1 = 1; S2 = 0; S3 = 0;  k1 = 0; k2 = 0;  """ The exact fitted value is k1 =0.45 and k2=0.15.  My output comes out to be  ChiSquare =  1.6501935363049038 Reduced ChiSquare =  0.0175552503...

Moved addNoise plugin to the new architecture

Image
 So finally I have moved on to the architecture system that I have developed. Where a change in the host doesn't need to rebuild plugins and change in the plugin didn't need to rebuild host. It is supposed to be the same but the earlier host consist of two different projects and one project has a dependency over others. Let's denote it by two projects A and B with plugin C. Now B is dependent on A and if the functionality of A is used by plugin and A gets changed then the whole system needs to rebuild. The main problem was to maintain backward compatibility and not to break anything.  We need to remove this dependency thing and made it simple between hosts and plugins. I also modified some plugins to work in the new architecture.  Now I looking to port old plugins to the new system. Around 3 weeks are left for the final submission and I am also left with the optimizer and moving old plugins to the new architecture.  One of the examples of plugin added to the new syst...

Adding addNoise plugin and provider roadrunner functionality to plugins

Image
In last week I mainly try to focus on three parts of my project: 1) Adding roadrunner support to the plugin, 2) Adding a simple plugin, and 3) Building wrapper. I am able to achieve the first two tasks but stuck with the last part. The wrapper already built is quite tricky. It is a CPython wrapper but the code is clearly understandable and most probably will finish with the wrapper part and submit a pull request including auto2000 plugin which is used for bifurcation analysis by the end of this month. The learning curve in Google's summer of code is pretty high. It is almost impossible that you learn every technology needed for the project. Will keep updating this blog about my further progress in the project. The final architecture will be as follows:

Adding RRPlugins (Loader) to LibRoadRunner

Finally, I finished removing 4412 bugs to 0 :D.   I add a large codebase in roadrunner and I know there will be a lot of conflicts between them as they may do share common variables and similar files. I first started with modifying CMake files and then modified the source files such that there will be no conflict. But when I started building it is giving some error in windows files of windows software development kit which is strange since I am not using any system-dependent files. Then I found out that accidentally many variables between two projects get interlinked due to error-prone cmake lists. It was a hard time finding the bug. And there are no debuggers available for the build process so I have to go manually line by line and find out the problem. I wonder how patient developers from the nineties since at that there are no such high tech IDK and developers have to manually do most of the things. Anyway, I resolved the issue and will start my work with the wrapper par...

Provided all Libroadrunner functions to plugins using RoadRunner C API

We are completely driven by self-interest. In the last week, I realized that building everything from scratch will be reinventing the wheel and at some point in time we have to reuse someone else written code in our program. So, I thought to use rrplugins in my code and worked on how to remove the dependency of LibRoadRunner. As of now, I decided to provide plugins all roadrunner functions through a C API which is already built. Now the main problems lie in removing roadrunner dependency from the plugin loader. For which will discuss a solution with mentors tomorrow early morning. This week I understand some basic concepts which I missed in my class. The detailed difference between dynamic and static linking. A brief concept is in this link  https://www.geeksforgeeks.org/difference-between-static-and-shared-libraries/ .  Also in this Wuhan Corona Virus pandemic time due to my university will conduct my end semester exams. So I will be not be working on this project fro...

Building a plugin manager in libRoadRunner

Every effort we put in plan B is the effort we take away from plan A.  The community bonding period is now coming to an end. I have used this community bonding period to make a demo application and base to work on. I have designed a platform-independent plugin manager. Also, the dynamic library can use host functionality. My mentor gives me an example and based on it I designed  https://github.com/debashish05/PluginSystem . Also, I have introduced to all the members of the Sauro Lab. Then I deployed this plugin manager to the libRoadRunner. Meanwhile while covering some c++ concept I came across a channel which describes some key feature and basic c++ if you have time and interested you can check it out  https://www.youtube.com/playlist?list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb . I first thought of using the poco shared library to load plugin but then I decided to stick on functions provided by OS. Although it tough and then I have to take care of platform dependency. ...

GSoC 2.0

"Never regret your past. Rather, embrace it as the teacher that it is." I am very happy to say that I have been selected for GSoC for the project Developing an Optimization Library for libRoadRunner  Link . Here is the link to my proposal. I am working on my last year's project and some major bugs. I have planned to publish a research paper with my mentor Herbert and Kiri on this project.  Now the community bonding period is started. But honestly, I don't need this since I have bonded with the community last year so will just jump right into the work. I will keep on updating this project here.  Stay Safe in this COVID 19 pandemic. Have a good day.

Submission of the project

The journey of a thousand miles begins with a single step. I submitted the report  https://gist.github.com/debashish05/82564fc7aee5130fbca9997c55681e14  along with the code and filed the last evaluation details. It has been an amazing journey for me. Starting from discussing the project with the mentor before GSoC and ending it. In this journey, my mentor and my co-mentor both played a vital role in the progress of the project. It's a very nice experience for me and most important a huge learning comes along with GSoC too. I learned evolutionary algorithm, cmake, swig, windows development environment and a lot more. I found that I need to revisit c++ some concepts again. I would like to thanks my mentor and my co-mentor for their support. I will keep contributing to the libRoadRunner and definitely, it's not the end of my open-source journey, in fact, it's the start of my open source journey. Best of Luck to all.

Differential Evolution and RRPlugins C API

Sorting out life in O(1) is luck. In this week I have added support of Differential Evolution. So, I am left with the swig wrapper problem for the last week. But the build of Travis CI is failing due to some error in uniform real number generation. Also, there is some build problem with Travis CI with RRPlugins C API. To be specific there is some lapack issue. I have referred these two links  https://en.wikipedia.org/wiki/Differential_evolution  and  http://www1.icsi.berkeley.edu/~storn/code.html#c++c  for the differential evolution part. For the RRPlugins C API, I have used pre-existing API from rrplugins ( https://github.com/sys-bio/rrplugins/tree/master/wrappers/C ). In this ultimate final week, I will first finish off with the documentation part first and then figure out with wrapper problem. I am looking forward to merging these changes to the main repository. Also, have to present all my hard work this summer. Looking forward to wrapping up the project ...

Finishing of with the cmake part and added support of beta plugins

In this week I have finalized the complete cmake part. So, now there is a separate option in cmake to build ONLY plugins not roadrunner and we can choose upon all available plugins provided we installed roadrunner once. Also merged the beta plugins. Now only the wrapper and testing part is left along with differential evolution optimizer. For the optimizer, I am going to implement  https://en.wikipedia.org/wiki/Differential_evolution  algorithm. Since college started I am not able to give the proper time to the project, but, I am sure will finish the project soon before 19th. In this week will try to finish off the wrapper part to get a beautiful scenario of the work I did in the GSoC till now. 

Second Evalutaion

Its's hard enough to find an error in your code when you're looking for it; it's even harder when you've ASSUMED your code is ERROR-FREE.                                                                                                                - Steve McConnell   I have successfully passed the second evaluation with a good remark as well from my mentor :). It feels proud when a mentor gives a strong positive remark on the ongoing project.  For the second Evaluation, I was asked to provide a screencast of all build (with all the code that I have committed since the second evaluation). I used two very nice open-source software (Google Summer of Code creates a deep space inside developers f...

Reaching towards Ending of Integration of RRPlugins with Libroadrunner

A cleaver Person Solves the Problem. A wise person avoids it.                                                                                                                       -Albert Einstein So, finally, I am towards the end of the integration part. Just have to integrate monte_carlo_bs plugins and design a  python wrapper with swig. This week has gone perfect. For the major part, I am struggling with cmake but this week I started understanding it well. For those who don't know cmake can start with this  Introduction to CMake by Example | derekmolloy.ie  . It describes cmake very briefly but provides a proper introduction. Also, after that, the official documentatio...

First Evaluation

Abraham Lincoln reportedly said that given eight hours to chop down a tree, he’d spend six sharpening  his axe. I have successfully passed the first evaluation. In reset few days while integrating rrplugins with roadrunner I have facing lots of errors. Somehow I know that these are generated due to the wrong configuration of cmake files but didn't find out the problem. But, finally, I found the problem it was with a variable which consists of lots of package details was modified inappropriately by me. It was a hard time debugging the cmake files. In the meantime, I am also working of differential evolutionary optimizer and following  http://www1.icsi.berkeley.edu/~storn/code.html#c++c  which is quite helpful but the plugin is not ready yet. I am thinking to finish some left out part integration and move towards the differential evolutionary optimizer part. While debugging my mentor said to me "if you face any problems in debugging the code just try to simplify a...

Coding Phase Week 2

It is  not enough  to do your best: you must  KNOW  what to do, and  THEN  do your best. -                                                                                                                      W.Edwards Deming So, the 2nd week of GSoC is ended. Its consist of many ups and downs. First I have planned to create the infrastructure of the plugin loader by my own by ignoring the pre-built plugin loader because I thought designing new code by my own will do the work faster as compared to modifying the pre-built code. Also, the pre-built code (rrplugins) uses low-level functionality of poco class loader. So, I thought it would be easy to uses high-level...

Coding Phase Week 1

“Physics is the universe’s operating system.”                                                                         — Steven R Garman Coding phase has started. This week I have assigned a task to use lmfit ( https://jugit.fz-juelich.de/mlz/lmfit ) c implementation to design a plugin which can be used as an optimizer and can be loaded by the class loader I have designed. I need to do some edit to get a working build from source in windows.  I am looking forward to adding the class loader designed by me in the libroadrunner by changing the cmakelist and swig interface. On my last meeting when we are talking about the optimizer I felt that I need to have a good knowledge of the nonlinear least squares problem to have a better understanding of the project. So, I will devote a separate time to gain s...

GSoC Coding Phase Starts

“The computer was born to solve problems that did not exist before.” So, finally, the coding phase started. Its been a lot of problems while setting the environment for Libroadrunner. Thanks to the Kiri sir for providing me the cmakelist and help me in this process. Sometimes we exactly followed the build article but due to a single fault, we get lots of problems. And the biggest problem is mentor being remotely located can't help as they don't have exact information. It is very difficult to debug the fault but one can always ask doubts from the mentor as they are the experienced one and guide us in the right direction. Fortunately, with the help of mentor and co-mentor, I have built roadrunner. I first set up all the environment in the Linux but I shifted to windows as all the developers are working in windows. This helps in some case if we get stuck. And It is beneficial for me in the later stage. I have designed a plugin loader with the help of poco class lo...

GSoC - Community Bonding

“Make it work, make it right, make it efficient, make it fast.” My project " Developing an optimization Library for Libroadrunner " got selected in GSoC 2019 under NRNB, here is my proposal .   About the Project LibRoadrunner is a high-performance SBML based simulator that uses LLVM to generate very efficient runtime code. This enables libRoadrunner to simulate models on par with compiled C/C++ code. By combining libroadrunner with standard optimization algorithms it is possible to use libroadrunner to fit models to data. At present this is done by writing code to link the standard Python optimizers available via scipy with libroadrunner. Although this works, it is inefficient and for large models, it is not practical. In this project, we would like to develop a C/C++ based optimization library that can be used directly by libroadrunner without having to go via Python. This would enable us to provide high-performance optimization capabilities. Community Bonding ...