commit 205b2a98160f5dc651b8417dec6cb475ae237535
parent 410e675040eae4ffa9e5b5233d9b895f9fa2d897
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 1 Oct 2021 15:47:25 +0200
Merge branch 'release_0.4.1'
Diffstat:
13 files changed, 46 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
@@ -33,6 +33,11 @@ formats on which it relies.
## Release notes
+### Version 0.4.1
+
+Displays the time spent constructing the geometric distribution, writing the
+sampled geometries, and performing the calculations.
+
### Version 0.4
- Set the minimum number of scattering angles to 2 rather than the previous
@@ -49,7 +54,7 @@ formats on which it relies.
## License
-Copyright (C) 2020 [|Meso|Star>](http://www.meso-star.com)
+Copyright (C) 2020, 2021 [|Meso|Star>](http://www.meso-star.com)
(contact@meso-star.com). Copyright (C) 2015, 2016 CNRS. Schiff is free
software released under the GPL v3+ license: GNU GPL version 3 or later. You
are welcome to redistribute it under certain conditions; refer to the COPYING
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+# Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
# Copyright (C) 2015, 2016 CNRS
#
# This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.1)
enable_testing()
project(schiff C)
@@ -50,7 +50,7 @@ include(rcmake_runtime)
################################################################################
set(VERSION_MAJOR 0)
set(VERSION_MINOR 4)
-set(VERSION_PATCH 0)
+set(VERSION_PATCH 1)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
set(SCHIFF_ARGS_DEFAULT_NINSAMPLES "100")
@@ -72,7 +72,6 @@ set(SCHIFF_FILES_SRC
schiff_mesh.c
schiff_optical_properties.c)
set(SCHIFF_FILES_INC
- schiff_args.h
schiff_geometry.h
schiff_mesh.h
schiff_optical_properties.h
diff --git a/cmake/LibYAMLConfig.cmake b/cmake/LibYAMLConfig.cmake
@@ -1,3 +1,4 @@
+# Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
# Copyright (C) 2015-2016 CNRS
#
# This program is free software: you can redistribute it and/or modify
@@ -13,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.1)
# Try to find the LibYAML devel. Once done this will define:
# - LibYAML_FOUND: system has LibYAML
diff --git a/src/schiff.c b/src/schiff.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify
@@ -18,6 +18,7 @@
#include "schiff_geometry.h"
#include "schiff_optical_properties.h"
+#include <rsys/clock_time.h>
#include <rsys/stretchy_array.h>
#include <star/s3d.h>
@@ -322,6 +323,8 @@ run_integration
struct ssp_rng* rng,
FILE* stream)
{
+ char dump[128];
+ struct time t0, t1;
struct sschiff_device* sschiff = NULL;
struct sschiff_estimator* estimator = NULL;
size_t nwlens;
@@ -334,6 +337,8 @@ run_integration
goto error;
}
+ time_current(&t0);
+
/* Invoke the Schiff integration */
nwlens = sa_size(args->wavelengths);
res = sschiff_integrate(sschiff, rng, distrib, args->wavelengths, nwlens,
@@ -344,6 +349,10 @@ run_integration
goto error;
}
+ time_sub(&t0, time_current(&t1), &t0);
+ time_dump(&t0, TIME_ALL, NULL, dump, sizeof(dump));
+ fprintf(stderr, "Computation performed in %s.\n", dump);
+
/* Write results */
write_cross_sections(stream, estimator, args->wavelengths, nwlens);
write_phase_function_descriptors
@@ -364,6 +373,8 @@ error:
static res_T
run(const struct schiff_args* args)
{
+ char dump[128];
+ struct time t0, t1;
FILE* fp = stdout;
struct sschiff_geometry_distribution distrib = SSCHIFF_NULL_GEOMETRY_DISTRIBUTION;
struct ssp_rng* rng = NULL;
@@ -393,6 +404,8 @@ run(const struct schiff_args* args)
goto error;
}
+ time_current(&t0);
+
res = schiff_geometry_distribution_init(&distrib, s3d, args->geoms,
sa_size(args->geoms), args->characteristic_length, args->ran_geoms,
args->properties);
@@ -402,10 +415,18 @@ run(const struct schiff_args* args)
goto error;
}
- if(args->ngeoms_dump) {
- res = dump_geometries(args, s3d, &distrib, rng, fp);
- } else {
+ time_sub(&t0, time_current(&t1), &t0);
+ time_dump(&t0, TIME_ALL, NULL, dump, sizeof(dump));
+ fprintf(stderr, "Initialized the geometry distribution in %s.\n", dump);
+
+ if(!args->ngeoms_dump) {
res = run_integration(args, s3d, &distrib, rng, fp);
+ } else {
+ time_current(&t0);
+ res = dump_geometries(args, s3d, &distrib, rng, fp);
+ time_sub(&t0, time_current(&t1), &t0);
+ time_dump(&t0, TIME_ALL, NULL, dump, sizeof(dump));
+ fprintf(stderr, "Dump geometries in %s.\n", dump);
}
/* Release before the check of the integration error code since if an error
diff --git a/src/schiff_args.c b/src/schiff_args.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify
@@ -102,7 +102,7 @@ print_help(const char* binary)
" --version display version information and exit.\n");
printf("\n");
printf(
-"Copyright (C) 2020 |Meso|Star> (contact@meso-star.com).\n"
+"Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com).\n"
"Copyright (C) 2015, 2016 CNRS. This is free software released under the\n"
"GNU GPL license, version 3 or later. You are free to change or\n"
"redistribute it under certain conditions\n"
diff --git a/src/schiff_geometry.c b/src/schiff_geometry.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/schiff_geometry.h b/src/schiff_geometry.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/schiff_mesh.c b/src/schiff_mesh.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/schiff_mesh.h b/src/schiff_mesh.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/schiff_optical_properties.c b/src/schiff_optical_properties.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/schiff_optical_properties.h b/src/schiff_optical_properties.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/schiff_streambuf.h b/src/schiff_streambuf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/schiff_streamline.h b/src/schiff_streamline.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2020, 2021 |Meso|Star> (contact@meso-star.com)
* Copyright (C) 2015, 2016 CNRS
*
* This program is free software: you can redistribute it and/or modify