commit fb0abb0bd546fedfdbaf5ce95b437659abda6d83
parent 733d06b48a7ac64e7813d5d5f6b17571aaa9aec9
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 13 Oct 2022 15:51:25 +0200
Manage the API break introduced by Star-MC 0.5
Diffstat:
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -35,7 +35,7 @@ add_subdirectory(noweb)
find_package(RCMake 0.4 REQUIRED)
find_package(RSys 0.12 REQUIRED)
find_package(Star3D 0.8 REQUIRED)
-find_package(StarMC 0.4 REQUIRED)
+find_package(StarMC 0.5 REQUIRED)
find_package(StarSP 0.12 REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR})
diff --git a/src/sgs_compute_4v_s.c b/src/sgs_compute_4v_s.c
@@ -108,8 +108,9 @@ error:
res_T
compute_4v_s(struct sgs* sgs)
{
- struct smc_integrator integrator;
- struct smc_estimator_status status;
+ struct smc_device_create_args args = SMC_DEVICE_CREATE_ARGS_DEFAULT;
+ struct smc_estimator_status status = SMC_ESTIMATOR_STATUS_NULL;
+ struct smc_integrator integrator = SMC_INTEGRATOR_NULL;
struct smc_device* smc = NULL;
struct smc_estimator* estimator = NULL;
double V;
@@ -118,8 +119,11 @@ compute_4v_s(struct sgs* sgs)
ASSERT(sgs);
/* Create the Star-MonteCarlo device */
- res = smc_device_create
- (&sgs->logger, sgs->allocator, sgs->nthreads, SSP_RNG_MT19937_64, &smc);
+ args.logger = &sgs->logger;
+ args.allocator = sgs->allocator;
+ args.nthreads_hint = sgs->nthreads;
+ args.rng_type = SSP_RNG_MT19937_64;
+ res = smc_device_create(&args, &smc);
if(res != RES_OK) {
sgs_log_err(sgs, "Could not create the Star-MonteCarlo device -- %s.\n",
res_to_cstr(res));
diff --git a/src/sgs_compute_sensitivity_translation.c b/src/sgs_compute_sensitivity_translation.c
@@ -341,8 +341,9 @@ error:
res_T
compute_sensitivity_translation(struct sgs* sgs)
{
- struct smc_integrator integrator;
- struct smc_estimator_status status;
+ struct smc_device_create_args args = SMC_DEVICE_CREATE_ARGS_DEFAULT;
+ struct smc_estimator_status status = SMC_ESTIMATOR_STATUS_NULL;
+ struct smc_integrator integrator = SMC_INTEGRATOR_NULL;
struct smc_device* smc = NULL;
struct smc_estimator* estimator = NULL;
struct smc_doubleN_context ctx;
@@ -369,8 +370,11 @@ compute_sensitivity_translation(struct sgs* sgs)
}
/* Create the Star-MonteCarlo device */
- res = smc_device_create
- (&sgs->logger, sgs->allocator, sgs->nthreads, SSP_RNG_MT19937_64, &smc);
+ args.logger = &sgs->logger;
+ args.allocator = sgs->allocator;
+ args.nthreads_hint = sgs->nthreads;
+ args.rng_type = SSP_RNG_MT19937_64;
+ res = smc_device_create(&args, &smc);
if(res != RES_OK) {
sgs_log_err(sgs, "Could not create the Star-MonteCarlo device -- %s.\n",
res_to_cstr(res));