Skip to main content
Fig. 3 | BMC Bioinformatics

Fig. 3

From: LASSIE: simulating large-scale models of biochemical systems on GPUs

Fig. 3

Example of matrix encoding to automatically generate an ODE using LASSIE. All terms of the polynomial function describing the ODE of species X 1 given at the top of the figure are encoded in the components of the data structures O H , V H, O A , V A and K, as detailed hereby. Notice that only the data structures components with solid borders are used to automatically generate the ODE; the various terms appearing in the ODE are represented with corresponding colors in the data structure components. Matrix encoding starts from matrix O H . Each thread j, for j=0,…,N−1, reads the values stored in the .x and .y components of O H (denoted by the lightblue borders). In this example, we consider species X 1 that corresponds to thread 0. Each thread fetches the values in V H, starting from the row indicated by the value stored in the .x component of O H , up to the row corresponding to the value stored in the .y component. In this example, thread 0 in matrix O H reads the values contained in the first two rows—i.e., rows 0 and 1—in matrix V H. Each row of V H encodes a monomial of an ODE: the .x component is not used; the .y components (denoted by green and orange borders) indicate the row numbers of the O A structure that each thread must read; the .z components (red borders) indicate the sign and the coefficient of the monomial; the .w components (gray borders) indicate the positions of the array K containing the values of the kinetic constants corresponding to the reactions that the threads are parsing. In this example, the .z and .w components of V H allows to derive the coefficients −1k 1 and +1k 2 for the first and the second term of the ODE, respectively. Afterwards, as in the case of O H , each thread fetches the values in V A, starting from the row indicated by the value stored in the .x component of O A , up to the row corresponding to the value stored in the .y component of O A . The values stored in the .y (violet and fuchsia borders) and .z (blue and dark green borders) components of V A correspond to the indexes of the species and the stoichiometric coefficients, respectively, while the .x and .w components of V A are left unused. In this example, row 0 in matrix O A reads the values stored in rows 0 and 1 (.y and .z components) of matrix V A, generating the factors (X 1)1(X 2)1 in the first term of the ODE, while row 1 in matrix O A reads the values stored in row 2 (.y and .z components) of matrix V A, generating the factor (X 3)1 in the second term of the ODE. Therefore, in this example, the matrix encoding overall generates the ODE of species X 1 consisting in the sum of two polynomial terms: −k 1(X 1)1(X 2)1+k 2(X 3)1

Back to article page