sdis_device_c.h (2193B)
1 /* Copyright (C) 2016-2025 |Méso|Star> (contact@meso-star.com) 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 15 16 #ifndef SDIS_DEVICE_C_H 17 #define SDIS_DEVICE_C_H 18 19 #include "sdis.h" 20 21 #include <rsys/dynamic_array.h> 22 #include <rsys/free_list.h> 23 #include <rsys/logger.h> 24 #include <rsys/ref_count.h> 25 #include <rsys/str.h> 26 27 #ifdef SDIS_ENABLE_MPI 28 #ifndef NDEBUG 29 #define MPI(Func) ASSERT(MPI_##Func == MPI_SUCCESS) 30 #else 31 #define MPI(Func) MPI_##Func 32 #endif 33 #endif 34 35 /* Forward declarations */ 36 struct mutex; 37 struct ssp_rng; 38 struct ssp_rng_proxy; 39 struct swf_tabulation; 40 41 struct name { FITEM; void* mem; }; 42 #define FITEM_TYPE name 43 #include <rsys/free_list.h> 44 45 struct sdis_device { 46 struct logger* logger; 47 struct logger logger__; /* Default logger */ 48 struct mem_allocator* allocator; 49 unsigned nthreads; 50 int no_escape_sequence; 51 int verbose; 52 53 #ifdef SDIS_ENABLE_MPI 54 int mpi_rank; /* Rank of the process in the MPI group */ 55 int mpi_nprocs; /* Overall #processes in the MPI group */ 56 struct str mpi_err_str; /* String used to store the MPI error string */ 57 58 struct mutex* mpi_mutex; /* Protect MPI calls from concurrent threads */ 59 int use_mpi; 60 #endif 61 62 struct flist_name interfaces_names; 63 struct flist_name media_names; 64 struct flist_name source_names; 65 66 struct s2d_device* s2d_dev; 67 struct s3d_device* s3d_dev; 68 69 struct swf_tabulation* H_2d; 70 struct swf_tabulation* H_3d; 71 72 ref_T ref; 73 }; 74 75 extern LOCAL_SYM res_T 76 create_rng_from_rng_proxy 77 (struct sdis_device* dev, 78 const struct ssp_rng_proxy* proxy, 79 struct ssp_rng** out_rng); 80 81 #endif /* SDIS_DEVICE_C_H */ 82