Skip to content

Commit a582df0

Browse files
committed
works and does alpha pinene faster than ever
1 parent 9369ae3 commit a582df0

14 files changed

+45
-35
lines changed

deps.cmake

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
include(FetchContent)
22

3-
# Building v7.30 of CVODES
4-
include(ExternalProject)
5-
6-
FetchContent_Declare(
7-
cvodes
8-
URL https://github.com/LLNL/sundials/releases/download/v7.3.0/cvodes-7.3.0.tar.gz
9-
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
10-
)
11-
12-
FetchContent_MakeAvailable(cvodes)
13-
14-
153
# Building GSL dependency
164
find_package(GSL 2.7)
175

@@ -63,6 +51,15 @@ set(HDF5_FOUND TRUE)
6351
set(HAVE_HDF5 TRUE CACHE BOOL "Pretend we have HDF5" FORCE)
6452
# set(MATIO_MAT73 ON CACHE BOOL "Enable MAT73 support" FORCE)
6553

54+
# Building v7.30 of CVODES
55+
FetchContent_Declare(
56+
cvodes
57+
URL https://github.com/LLNL/sundials/releases/download/v7.3.0/cvodes-7.3.0.tar.gz
58+
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
59+
)
60+
61+
FetchContent_MakeAvailable(cvodes)
62+
6663
# Building Matio dependency
6764
set(MATIO_WITH_ZLIB ON CACHE BOOL "" FORCE)
6865
set(MATIO_WITH_HDF5 ON CACHE BOOL "" FORCE)

example-files/alpha_pinene_cuqdyn_config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<cuqdyn-config>
44
<tolerances>
5-
<rtol>1e-8</rtol>
6-
<atol>1e-8, 1e-8, 1e-8, 1e-8, 1e-8</atol>
5+
<rtol>1e-16</rtol>
6+
<atol>1e-16, 1e-16, 1e-16, 1e-16, 1e-16</atol>
77
</tolerances>
88
<ode_expr y_count="5" p_count="5">
99
alpha-pinene

example-files/alpha_pinene_ess_mpi_config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<id>0</id>
55
<log_scale>5</log_scale>
66
<output>0</output>
7-
<verbose>1</verbose>
7+
<verbose>0</verbose>
88
<local_search>1</local_search>
99
<stopping_criteria>
10-
<maxevaluation>6e3</maxevaluation>
10+
<maxevaluation>15e3</maxevaluation>
1111
<maxtime>1e10</maxtime>
1212
<vtr>0</vtr>
1313
</stopping_criteria>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
9 6
2-
0 1.054e+02 2.769e-01 1.409e-01 3.034e-02 3.252e-02
3-
1230 1.063e+02 5.842e+00 3.441e+00 6.992e-02 4.046e-01
4-
3060 5.875e+01 2.101e+01 5.622e+00 1.027e-01 3.011e+00
5-
4920 7.023e+01 2.542e+01 5.316e+00 5.430e-01 4.136e+00
6-
7800 5.161e+01 3.314e+01 6.977e+00 5.887e-01 9.308e+00
7-
10680 3.350e+01 4.389e+01 7.298e+00 9.356e-01 1.277e+01
8-
15030 2.510e+01 4.814e+01 5.795e+00 1.468e+00 1.797e+01
9-
22620 1.388e+01 5.705e+01 5.169e+00 1.443e+00 2.250e+01
10-
36420 5.688e+00 7.378e+01 4.175e+00 4.301e+00 2.232e+01
2+
0 105.4304 0.27694 0.1409 0.030344 0.032519
3+
1230 106.2646 5.8416 3.4414 0.069919 0.40461
4+
3060 58.7484 21.0121 5.6224 0.1027 3.0108
5+
4920 70.2255 25.4187 5.3156 0.54304 4.1355
6+
7800 51.6116 33.1445 6.9769 0.58873 9.3084
7+
10680 33.5044 43.887 7.2983 0.93556 12.7689
8+
15030 25.1021 48.1426 5.7949 1.4677 17.9676
9+
22620 13.8795 57.0451 5.1687 1.4431 22.4986
10+
36420 5.6877 73.7817 4.1749 4.3015 22.3218

example-files/lotka_volterra_cuqdyn_config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<cuqdyn-config>
44
<tolerances>
5-
<rtol>1e-8</rtol>
6-
<atol>1e-9, 1e-10</atol>
5+
<rtol>1e-9</rtol>
6+
<atol>1e-9, 1e-9</atol>
77
</tolerances>
88
<ode_expr y_count="2" p_count="4">
99
lotka-volterra

example-files/lotka_volterra_ess_mpi_config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<run>
33
<typebench>customized</typebench>
44
<id>0</id>
5-
<log_scale>4</log_scale>
5+
<log_scale>2</log_scale>
66
<output>0</output>
77
<verbose>0</verbose>
88
<local_search>1</local_search>

modules/cli/src/handlers/solve.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <nvector_old/nvector_serial.h>
1+
#include <nvector//nvector_serial.h>
22
#include <stdio.h>
33
#include <unistd.h>
44

@@ -8,6 +8,7 @@
88
#include <config.h>
99
#include <stdlib.h>
1010
#include <string.h>
11+
#include <sunmatrix/sunmatrix_dense.h>
1112

1213
#include "../../../cuqdyn-c/include/functions.h"
1314
#include "cuqdyn.h"

modules/cuqdyn-c/src/ode_solver.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <cvodes/cvodes.h>
44
#include <ode_solver.h>
55
#include <string.h>
6+
#include <sunlinsol/sunlinsol_dense.h>
67
#include <sunmatrix/sunmatrix_dense.h>
78

89
#include "cuqdyn.h"
@@ -31,6 +32,11 @@ SUNMatrix solve_ode(N_Vector parameters, N_Vector initial_values, sunrealtype t0
3132
retval = CVodeSetUserData(cvode_mem, parameters);
3233
if (check_retval(&retval, "CVodeSetUserData", 1)) { return NULL; }
3334

35+
SUNMatrix A = SUNDenseMatrix(cuqdyn_conf->ode_expr.y_count, cuqdyn_conf->ode_expr.y_count, get_sundials_ctx());
36+
SUNLinearSolver LS = SUNLinSol_Dense(initial_values, A, get_sundials_ctx());
37+
retval = CVodeSetLinearSolver(cvode_mem, LS, A);
38+
if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return NULL; }
39+
3440
retval = CVodeSetMaxNumSteps(cvode_mem, 10000000);
3541
if (check_retval(&retval, "CVodeSetMaxNumSteps", 1)) { return NULL; }
3642

modules/sacess/libAMIGO/src/src_amigo/AMIGO_model.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ void free_AMIGO_model(AMIGO_model* amigo_model){
217217
free(amigo_model);
218218
}
219219

220+
int simulate_amigo_model(AMIGO_model* amigo_model, int verbose)
221+
{
222+
return 0;
223+
}
224+
220225
int simulate_AMIGO_model(AMIGO_model* amigo_model,int sens){
221226

222227
amigo_model->compute_sens=sens;

tests/test_data_reader.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#define LOTKA_VOLTERRA_MAT "data/lotka_volterra_data_homoc_noise_0.10_size_30_data_1.mat"
22
#define DATA_TXT "data/test_data.txt"
33

4-
#include <nvector_old/nvector_serial.h>
4+
#include <nvector/nvector_serial.h>
55
#include <stdio.h>
6-
#include <sundials_old/sundials_nvector.h>
76
#include <assert.h>
87

98

0 commit comments

Comments
 (0)