openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
ION_IF.h
Go to the documentation of this file.
1 
18 #ifndef IONIC_IF_H
19 #define IONIC_IF_H
20 
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <stddef.h>
25 #include <stdexcept>
26 #include "LUT.h"
27 #include "ODEint.h"
28 #include <math.h>
29 #include <assert.h>
30 #include <memory>
31 #include <functional>
32 #ifdef _OPENMP
33 #include <omp.h>
34 #endif
35 #ifdef HAS_CUDA_MODEL
36 #include <cuda_runtime.h>
37 #endif
38 #ifdef HAS_ROCM_MODEL
39 #include <hip/hip_runtime.h>
40 #endif
41 
42 #include "basics.h"
43 #include "target.h"
44 
45 #ifdef I
46 #undef I
47 #endif
48 
49 namespace limpet {
50 
51 #ifndef M_PI //C99 does not define M_PI
52 #define M_PI 3.14159265358979323846264338327
53 #endif
54 
55 //Defines used in Slava's LIMPET model '
56 #define heav(x) ( (x)<0 ? 0 : 1)
57 #define sign(x) ( (x)<0 ? -1 : 1 )
58 #define square(x) ((x)*(x))
59 #define cube(x) ((x)*(x)*(x))
60 
61 // MPI message tags used in the IMP world
62 #define MPI_RESTORE_IMP_POLL_BUFSIZE_TAG 10
63 #define MPI_RESTORE_IMP_SNDRCV_BUFFER_TAG 11
64 #define MPI_DUMP_IMP_POLL_BUFSIZE_TAG 20
65 #define MPI_DUMP_IMP_SNDRCV_BUFFER_TAG 21
66 #define MPI_DUMP_SVS_POLL_BUFSIZE_TAG 30
67 #define MPI_DUMP_SVS_SNDRCV_BUFFER_TAG 31
68 
75 struct tc_grp {
76  float dt;
77  int skp;
78  int rat;
79  int update;
80 };
81 
86 struct ts {
87  int cnt;
88  int ng;
90 };
91 
92 
95 struct SV_TAB {
96  int svSize;
97  int numSeg;
98  void *y;
101 };
102 
113 #define NDEF 0
114 struct cell_geom {
115  float SVratio=NDEF;
116  float v_cell=NDEF;
117  float a_cap=NDEF;
118  float fr_myo=NDEF;
119  float sl_i2c=NDEF;
120 };
121 
122 }
123 #include "ion_type.h"
124 namespace limpet {
125 
126 struct IMPinfo {
127  char *name;
128  int sz;
129  int nplug;
131  bool compatible;
132  int map;
133  int offset;
134 };
135 
139 class IonIfBase {
140 private:
141  // Information about the model type.
142  const IonType& _type;
143  int _num_node;
144  IonIfBase* _parent;
145  std::vector<IonIfBase*> _plugins;
146  uint32_t _reqdat;
148  uint32_t _moddat;
150 public:
151  int miifIdx;
153 protected:
155 private:
156  cell_geom _cgeom;
157  float dt;
158  std::vector<LUT> _tables;
159  LUT * _tables_d = nullptr;
160  size_t _n_tables_d = 0;
161  GlobalData_t **ldata = nullptr;
164 public:
173  IonIfBase(const IonType& type, Target target, int num_node, const std::vector<std::reference_wrapper<IonType>>& plugins);
174 
178  virtual ~IonIfBase();
179 
186  const IonType& get_type() const;
187 
193  int get_num_node() const;
194 
200  std::size_t get_num_threads() const;
201 
207  IonIfBase* parent() const;
208 
209  // VERY UNRECOMMENDED TO CALL, THIS IS ONLY USED FOR AN UGLY HACK.
210  void set_parent(IonIfBase* parent);
211 
217  std::vector<IonIfBase*>& plugins();
218 
224  uint32_t get_reqdat() const;
225 
231  uint32_t get_moddat() const;
232 
238  void set_moddat(uint32_t data);
239 
245 #if defined HAS_CUDA_MODEL || defined HAS_ROCM_MODEL
246  __device__ __host__
247 #endif
249  return this->_cgeom;
250  }
251 
257  float get_dt() const;
258 
264  void set_dt(float dt);
265 
266 
272  ts& get_tstp();
273 
283  virtual void *get_sv_address() = 0;
284 
291  virtual std::size_t get_sv_size() const = 0;
292 
299 //#if defined HAS_CUDA_MODEL || defined HAS_ROCM_MODEL
300 // __device__ __host__
301 //#endif
302 // SV_TAB& sv_tab() {
303 // return this->_sv_tab;
304 // }
305 
312  std::vector<LUT>& tables();
313 
321 #if defined HAS_CUDA_MODEL || defined HAS_ROCM_MODEL
322  __device__ __host__
323 #endif
324  LUT *tables_d() const {
325  return this->_tables_d;
326  }
327 
334  size_t get_n_tables_d() const;
335 
336 #if defined HAS_GPU_MODEL
337  __device__ __host__
338 #endif
339  Target get_target() const {
340  return this->_target;
341  };
342 
343  virtual void set_target(Target target);
344 
349  void initialize_params();
350 
362  virtual void initialize(double dt, GlobalData_t **impdat);
363 
371  void compute(int start, int end, GlobalData_t** data);
372 
384  char* fill_buf(char *buf, int* n, opencarp::Salt_list *l) const;
385 
401  int restore(opencarp::FILE_SPEC in, int n, const int *pos, IIF_Mask_t *mask,
402  size_t *offset, IMPinfo *impinfo, const int* loc2canon);
403 
411  int dump_luts(bool zipped);
412 
416  void destroy_luts();
417 
444  void tune(const char *im_par, const char *plugs, const char *plug_par);
445 
453  int read_svs(FILE* file);
454 
455  int write_svs(FILE* file, int node);
456 
466  virtual void copy_SVs_from(IonIfBase& other, bool alloc) = 0;
467 
476  void copy_plugins_from(IonIfBase& other);
477 
484  void for_each(const std::function<void(IonIfBase&)>& consumer);
485 };
486 
497 template<typename T>
498 class IonIf : public IonIfBase {
506  struct has_rosenbrock_type {};
507  struct has_rosenbrock_vector_type {};
508  struct no_rosenbrock_type {};
509  public:
521  template<typename S>
522  class LimpetArray {
523  static constexpr bool is_void = std::is_void<S>::value;
526  S *_data;
527  std::size_t _size; //<! size of the SV array
528  bool _allocated = false;
529  Target _target;
530  public:
531 
535  LimpetArray() : _size(0), _target(Target::UNKNOWN) {
536  }
537 
544  LimpetArray(Target target, std::size_t size) : _size(size),
545  _target(target) {
546  this->allocate(target, size);
547  }
548 
553  // Check if memory was allocated, if it's the case, deallocate on the
554  // corresponding target
555  if (!is_void && _allocated) {
556  deallocate_on_target<S>(this->_target, this->_data);
557  }
558  }
559 
566  void allocate(Target target, std::size_t size) {
567  this->_size = size;
568  this->_target = target;
569  if (!is_void){
570  bool do_zero = false;
571  this->_data = allocate_on_target<S>(this->_target, this->_size, do_zero);
572  this->_allocated = true;
573  }
574  }
575 
582  template<typename Type = S>
583  typename std::enable_if<!std::is_void<Type>::value, std::size_t>::type get_element_size() const {
584  return sizeof(Type);
585  }
586 
587  template<typename Type = S>
588  typename std::enable_if<std::is_void<Type>::value, std::size_t>::type get_element_size() const {
589  return 0;
590  }
591 
597 #ifdef HAS_GPU_MODEL
598  __device__ __host__
599 #endif
600  S *data() const {
601  static_assert(!is_void, "The LimpetArray class can't be used with type 'void'");
602  return this->_data;
603  }
604 
610 #ifdef HAS_GPU_MODEL
611  __device__ __host__
612 #endif
613  std::size_t size() const {
614  static_assert(!is_void, "The LimpetArray class can't be used with type 'void'");
615  return this->_size;
616  }
617 
624  bool is_allocated() const {
625  return this->_allocated;
626  }
627 
635  if (this == &other) {
636  return *this;
637  }
638  this->_target = other._target;
639  this->_data = other._data;
640  this->_size = other._size;
641  if (other._allocated) {
642  this->_allocated = true;
643  other._allocated = false;
644  }
645  return *this;
646  }
647  };
648  private:
649  using SvTab = LimpetArray<typename T::state_type>;
650  using PrivateTab = LimpetArray<typename T::private_type>;
651  using PrivateVectorTab = LimpetArray<typename T::private_type_vector>;
652 
659  using rosenbrock_usage = typename std::conditional<std::is_void<typename T::private_type>::value, no_rosenbrock_type, typename std::conditional<std::is_void<typename T::private_type_vector>::value, has_rosenbrock_type, has_rosenbrock_vector_type>::type>::type;
660 
661  // These fields are C-style arrays because they need to be accessible from device code
662  SvTab _sv_tabs[Target::N_TARGETS];
663  typename T::params_type* _params[Target::N_TARGETS] = {nullptr};
664  PrivateTab _ion_private[Target::N_TARGETS];
665  PrivateVectorTab _ion_private_vector;
666  size_t private_sz;
667  public:
668 
676  IonIf(const IonType &type, Target target, int num_node, const
677  std::vector<std::reference_wrapper<IonType>>& plugins) : IonIfBase(type,
678  target, num_node, plugins) {
679  this->allocate_model_data();
680  }
681 
687  ~IonIf() {
688  for (int i = 0; i < Target::N_TARGETS; ++i) {
689  if (this->_params[i] != nullptr) {
690  deallocate_on_target((Target) i, this->_params[i]);
691  }
692  }
693  }
694 
700 #ifdef HAS_GPU_MODEL
701  __device__ __host__
702 #endif
703  typename T::params_type *params() const {
704  return this->_params[this->get_target()];
705  }
706 
712 #ifdef HAS_GPU_MODEL
713  __device__ __host__
714 #endif
716  return this->_sv_tabs[this->get_target()];
717  }
718 
725 #ifdef HAS_GPU_MODEL
726  __device__ __host__
727 #endif
729  return this->_ion_private[this->get_target()];
730  }
731 
733  if (this->get_target() != Target::MLIR_CPU) {
734  throw std::logic_error("the vectorized ion private structure can only be used with the MLIR_CPU (vectorized CPU) target");
735  }
736  return this->_ion_private_vector;
737  }
738 
744  void * get_sv_address() override {
745  return (void *) this->_sv_tabs[this->get_target()].data();
746  }
747 
753  std::size_t get_sv_size() const override {
754  return sizeof(typename T::state_type);
755  }
756 
765  void set_target(Target target) override {
766  Target old_target = this->get_target();
767  IonIfBase::set_target(target);
768  this->allocate_model_data();
769  memcpy(this->sv_tab().data(), this->_sv_tabs[old_target].data(), this->sv_tab().size());
770  // TODO: Copy ion private data for Rosenbrock, making transformations as necessary between
771  // vectorized and non-vectorized structures
772  // memcpy(this->ion_private().data(), this->_ion_private[old_target].data(), this->ion_private().size());
773  memcpy(this->params(), this->_params[old_target], sizeof(typename T::params_type));
774  }
775 
780  std::size_t vec_size = this->get_type().dlo_vector_size();
781  if (!this->_sv_tabs[this->get_target()].is_allocated())
782  this->_sv_tabs[this->get_target()] =
783  SvTab(this->get_target(), (this->get_num_node() + vec_size - 1) / vec_size);
784  if (!this->_ion_private[this->get_target()].is_allocated())
785  this->_ion_private[this->get_target()] = PrivateTab(this->get_target(), this->get_num_threads());
786  // The private vector structure is always made for the vectorized CPU target
787  if (!this->_ion_private_vector.is_allocated() && this->get_target() == Target::MLIR_CPU)
788  this->_ion_private_vector = PrivateVectorTab(this->get_target(), this->get_num_threads());
789  if (this->_params[this->get_target()] == nullptr)
790  this->_params[this->get_target()] = allocate_on_target<typename T::params_type>(this->get_target(), 1, true);
791  }
792 
802  void initialize(double dt, GlobalData_t **impdat) override {
803  IonIfBase::initialize(dt, impdat);
804  this->init_ion_private(rosenbrock_usage {});
805  }
806 
821  void copy_SVs_from(IonIfBase& other_base, bool alloc) override {
822  IonIf<T>& other = static_cast<IonIf<T>&>(other_base);
823  int tcg_size = other.get_tstp().ng * sizeof(tc_grp);
824 
825  if (this->get_num_node() != other.get_num_node()) {
826  throw std::logic_error("cannot copy SVs if both IMPs don't handle the same amount of cells");
827  }
828 
829  memcpy(this->sv_tab().data(), other.sv_tab().data(), sizeof(typename T::state_type) * other.sv_tab().size());
830  // Only copy memory when the model actually defines a private type
831  this->copy_ion_private(other, rosenbrock_usage {});
832  memcpy(this->get_tstp().tcg, other.get_tstp().tcg, tcg_size);
833  }
834 
843  void copy_ion_private(IonIf<T>& other, has_rosenbrock_vector_type) {
844  if (this->get_target() == Target::MLIR_CPU) {
845  memcpy(this->ion_private_vector().data(), other.ion_private_vector().data(), sizeof(typename T::private_type_vector) * other.ion_private_vector().size());
846  }
847  else {
848  memcpy(this->ion_private().data(), other.ion_private().data(), sizeof(typename T::private_type) * other.ion_private().size());
849  }
850  }
851 
860  void copy_ion_private(IonIf<T>& other, has_rosenbrock_type) {
861  memcpy(this->ion_private().data(), other.ion_private().data(), sizeof(typename T::private_type) * other.ion_private().size());
862  }
863 
869  void copy_ion_private(IonIf<T>& other, no_rosenbrock_type) { }
870 
876  void init_ion_private(has_rosenbrock_vector_type) {
877  // We need to fill the vector version of the private data for vectorized CPU
878  if (this->get_target() == Target::MLIR_CPU) {
879  for (std::size_t i = 0; i < this->ion_private_vector().size(); ++i) {
880  this->ion_private_vector().data()[i].node_number = 0;
881  this->ion_private_vector().data()[i].IF = this;
882  }
883  }
884  else {
885  for (std::size_t i = 0; i < this->ion_private().size(); ++i) {
886  this->ion_private().data()[i].node_number = 0;
887  this->ion_private().data()[i].IF = this;
888  }
889  }
890  }
891 
897  void init_ion_private(has_rosenbrock_type) {
898  for (std::size_t i = 0; i < this->ion_private().size(); ++i) {
899  this->ion_private().data()[i].node_number = 0;
900  this->ion_private().data()[i].IF = this;
901  }
902  }
903 
910  void init_ion_private(no_rosenbrock_type) { }
911 };
912 
913 /*
914  function prototypes
915  */
916 
917 void initialize_ts(ts *tstp, int ng, int *skp, double dt);
918 void update_ts(ts *tstp);
919 void SV_alloc( SV_TAB *psv, int numSeg, int struct_size );
920 void SV_free( SV_TAB *psv );
921 void free_sv_table( void * );
922 void print_IMPs(void);
923 bool flag_set( const char *flags, const char *target );
924 void print_models(bool );
925 float modify_param( float a, char *expr );
926 int process_param_mod( char *pstr, char *par, char *mod );
927 char* get_typename(int type);
928 bool verify_flags( const char *flags, const char* given );
929 int load_ionic_module(const char*);
930 char *get_next_list( char *lst, char delimiter );
931 
932 // Functions for getting SVs in sv_init.c
934 
935 #include "ION_IF_sv.h"
936 
937 #define CHANGE_PARAM( T, P, V, F ) do { \
938  ((T##_Params *)P)->V = modify_param( ((T##_Params *)P)->V, F ); \
939  log_msg( _nc_logf,0, 0, " %-20s modifier: %-15s value: %g",\
940  #V,F,(float)((T##_Params *)P)->V);} while (0)
941 
942 } // namespace limpet
943 
944 #endif
#define NDEF
definition of cell geometry
Definition: ION_IF.h:113
Basic utility structs and functions, mostly IO related.
Represents the ionic model and plug-in (IMP) data structure.
Definition: ION_IF.h:139
virtual void initialize(double dt, GlobalData_t **impdat)
Initializes lookup table and state variable tables.
Definition: ION_IF.cc:237
void tune(const char *im_par, const char *plugs, const char *plug_par)
Tunes specific IMP parameters from files.
Definition: ION_IF.cc:348
Target _target
execution target for this IMP
Definition: ION_IF.h:152
void set_parent(IonIfBase *parent)
Definition: ION_IF.cc:180
IonIfBase(const IonType &type, Target target, int num_node, const std::vector< std::reference_wrapper< IonType >> &plugins)
Constructor for IonIfBase.
Definition: ION_IF.cc:116
virtual void set_target(Target target)
Definition: ION_IF.cc:220
const IonType & get_type() const
Gets this IMP's model type.
Definition: ION_IF.cc:144
int restore(opencarp::FILE_SPEC in, int n, const int *pos, IIF_Mask_t *mask, size_t *offset, IMPinfo *impinfo, const int *loc2canon)
Reads in the state variables for an IMP.
Definition: ION_IF.cc:287
virtual void copy_SVs_from(IonIfBase &other, bool alloc)=0
Copies the state variables of an IMP.
char * fill_buf(char *buf, int *n, opencarp::Salt_list *l) const
Appends the state variables to a buffer.
Definition: ION_IF.cc:274
float get_dt() const
Gets the basic integration time step.
Definition: ION_IF.cc:200
int read_svs(FILE *file)
Reads state variable values for one cell from a file.
Definition: ION_IF.cc:395
std::vector< LUT > & tables()
Gets the array of state variables.
Definition: ION_IF.cc:212
ts _tstp
control time stepping
Definition: ION_IF.h:154
std::vector< IonIfBase * > & plugins()
Returns a vector containing the plugins of this IMP.
Definition: ION_IF.cc:184
int dump_luts(bool zipped)
Dumps array of LUTs to file.
Definition: ION_IF.cc:321
int write_svs(FILE *file, int node)
Definition: ION_IF.cc:402
virtual ~IonIfBase()
Virtual destructor declaration.
Definition: ION_IF.cc:133
void set_moddat(uint32_t data)
Set the data flag for this IMP's modified data.
Definition: ION_IF.cc:196
void set_dt(float dt)
Sets the basic integration time step.
Definition: ION_IF.cc:204
ts & get_tstp()
Gets the time stepper.
Definition: ION_IF.cc:208
void for_each(const std::function< void(IonIfBase &)> &consumer)
Executes the consumer functions on this IMP and each of its plugins.
Definition: ION_IF.cc:417
size_t get_n_tables_d() const
Gets the size of the array returned by IonIf::tables_d.
Definition: ION_IF.cc:216
IonIfBase * parent() const
Gets the parent IMP.
Definition: ION_IF.cc:176
void destroy_luts()
Destroys array of LUTs.
Definition: ION_IF.cc:340
Target get_target() const
Definition: ION_IF.h:339
int get_num_node() const
Gets the number of nodes handled by this IMP.
Definition: ION_IF.cc:148
uint32_t get_moddat() const
Gets the data flags for this IMP's modified data.
Definition: ION_IF.cc:192
int miifIdx
imp index within miif
Definition: ION_IF.h:151
virtual std::size_t get_sv_size() const =0
Gets the size of the structure this IMP uses for state variables.
void copy_plugins_from(IonIfBase &other)
Copies the plugins of an IMP.
Definition: ION_IF.cc:406
virtual void * get_sv_address()=0
Gets the raw address of the state variables for this IMP.
void compute(int start, int end, GlobalData_t **data)
Perform ionic model computation for 1 time step.
Definition: ION_IF.cc:270
void initialize_params()
Initializes user modifiable parameters with default values defined in the respective ionic models.
Definition: ION_IF.cc:229
uint32_t get_reqdat() const
Gets the data flags for this IMP's required data.
Definition: ION_IF.cc:188
std::size_t get_num_threads() const
Gets the number of threads used for running this IMP.
Definition: ION_IF.cc:152
LUT * tables_d() const
Gets an array of LUTs.
Definition: ION_IF.h:324
cell_geom & cgeom()
Gets the cell geometry data.
Definition: ION_IF.h:248
Utility class for handling arrays of data used by IMPs.
Definition: ION_IF.h:522
~LimpetArray()
Destroy a limpet array.
Definition: ION_IF.h:552
LimpetArray & operator=(LimpetArray &&other)
Move assignement operator.
Definition: ION_IF.h:634
LimpetArray()
Default constructor with no allocated data.
Definition: ION_IF.h:535
LimpetArray(Target target, std::size_t size)
Constructs a LimpetArray.
Definition: ION_IF.h:544
std::enable_if< std::is_void< Type >::value, std::size_t >::type get_element_size() const
Definition: ION_IF.h:588
bool is_allocated() const
Returns whether data has been allocated for this LimpetArray.
Definition: ION_IF.h:624
std::size_t size() const
Gets the sizee of the array.
Definition: ION_IF.h:613
std::enable_if<!std::is_void< Type >::value, std::size_t >::type get_element_size() const
Get the size of a single element (size of type S)
Definition: ION_IF.h:583
S * data() const
Gets a pointer to the underlying data.
Definition: ION_IF.h:600
void allocate(Target target, std::size_t size)
Allocate the array on the given target.
Definition: ION_IF.h:566
Child class of IonIfBase specialized for each ionic model type.
Definition: ION_IF.h:498
PrivateTab & ion_private()
Gets the ion private LimpetArray for the current target.
Definition: ION_IF.h:728
SvTab & sv_tab()
Gets the SV LimpetArray for the current target.
Definition: ION_IF.h:715
void copy_ion_private(IonIf< T > &other, has_rosenbrock_vector_type)
Copy the ion private array from other.
Definition: ION_IF.h:843
T::params_type * params() const
Gets a pointer to the parameter structure for the current target.
Definition: ION_IF.h:703
void copy_ion_private(IonIf< T > &other, no_rosenbrock_type)
This function does nothing (overload of copy_ion_private(IonIf<T>&, has_rosenbrock_type)).
Definition: ION_IF.h:869
PrivateVectorTab & ion_private_vector()
Definition: ION_IF.h:732
void initialize(double dt, GlobalData_t **impdat) override
Override of the initialization function to add the initialization of the private structures.
Definition: ION_IF.h:802
void init_ion_private(has_rosenbrock_vector_type)
Initialize private data.
Definition: ION_IF.h:876
~IonIf()
Destroy the IMP.
Definition: ION_IF.h:687
void * get_sv_address() override
Gets the raw address of the SV array for the current target.
Definition: ION_IF.h:744
void allocate_model_data()
Allocate memory for the IMP data for the current target.
Definition: ION_IF.h:779
void copy_ion_private(IonIf< T > &other, has_rosenbrock_type)
Copy the ion private array from other.
Definition: ION_IF.h:860
void init_ion_private(has_rosenbrock_type)
Initialize private data.
Definition: ION_IF.h:897
void init_ion_private(no_rosenbrock_type)
Doesn't do anything.
Definition: ION_IF.h:910
void copy_SVs_from(IonIfBase &other_base, bool alloc) override
Copy state and private variables from another IMP.
Definition: ION_IF.h:821
std::size_t get_sv_size() const override
Gets the size of a SV structure.
Definition: ION_IF.h:753
void set_target(Target target) override
Set a new execution target for this IMP.
Definition: ION_IF.h:765
IonIf(const IonType &type, Target target, int num_node, const std::vector< std::reference_wrapper< IonType >> &plugins)
Constructs an IonIf object.
Definition: ION_IF.h:676
Abstract class representing an ionic model type.
Definition: ion_type.h:59
virtual size_t dlo_vector_size() const =0
Gets the vector size when using data layout optimization (DLO).
char * get_typename(int type)
int process_param_mod(char *pstr, char *par, char *mod)
void SV_alloc(SV_TAB *psv, int numSeg, int struct_size)
GlobalData_t(* SVgetfcn)(IonIfBase &, int, int)
Definition: ion_type.h:48
SVputfcn getPutSV(SVgetfcn)
int load_ionic_module(const char *)
Target
enum that represents different targets to run ionic models on.
Definition: target.h:45
@ UNKNOWN
special value to handle unknown targets
Definition: target.h:47
@ N_TARGETS
a token to indicate the maximum number of targets
Definition: target.h:52
@ MLIR_CPU
vectorized CPU code generated with MLIR
Definition: target.h:49
bool flag_set(const char *flags, const char *target)
Definition: ION_IF.cc:557
SF_real GlobalData_t
Definition: limpet_types.h:27
void print_IMPs(void)
bool verify_flags(const char *flags, const char *given)
Definition: ION_IF.cc:535
void(* SVputfcn)(IonIfBase &, int, int, GlobalData_t)
Definition: ion_type.h:49
void deallocate_on_target(Target target, T *ptr)
Utility function for deallocating memory on a target. See TargetAllocator.
Definition: target.h:318
void SV_free(SV_TAB *psv)
void print_models(bool)
void update_ts(ts *ptstp)
Definition: ION_IF.cc:466
char * get_next_list(char *lst, char delimiter)
Definition: ION_IF.cc:512
void free_sv_table(void *)
float modify_param(float a, char *expr)
char IIF_Mask_t
Definition: ion_type.h:50
void initialize_ts(Target target, ts *tstp, int ng, int *skp, double dt)
Definition: ION_IF.cc:437
V mod(const V &a, const V &b)
Definition: signals.h:50
int offset
offset into node data
Definition: ION_IF.h:133
int sz
storage required
Definition: ION_IF.h:128
char * name
IMP name.
Definition: ION_IF.h:127
int map
which plugin does this IMO match
Definition: ION_IF.h:132
IMPinfo * plug
plugins
Definition: ION_IF.h:130
bool compatible
does IM match stored IM
Definition: ION_IF.h:131
int nplug
number of plugins
Definition: ION_IF.h:129
lookup table structure
Definition: LUT.h:46
array of stat variable structures
Definition: ION_IF.h:95
int svSize
size of structure holding SV's for a node
Definition: ION_IF.h:96
int numSeg
number of unknowns
Definition: ION_IF.h:97
void * y
Definition: ION_IF.h:98
float fr_myo
volume of myoplasm
Definition: ION_IF.h:118
float sl_i2c
convert sl-currents in uA/cm^2 to mM/L without valence
Definition: ION_IF.h:119
float SVratio
single cell surface-to-volume ratio (per um)
Definition: ION_IF.h:115
float v_cell
cell volume
Definition: ION_IF.h:116
float a_cap
capacitive cell surface
Definition: ION_IF.h:117
time constant groups
Definition: ION_IF.h:75
int update
Definition: ION_IF.h:79
float dt
Definition: ION_IF.h:76
time stepper
Definition: ION_IF.h:86
int cnt
Definition: ION_IF.h:87
int ng
Definition: ION_IF.h:88
tc_grp * tcg
Definition: ION_IF.h:89
saltatory list – memory is allocated in chunks
Definition: basics.h:57
File descriptor struct.
Definition: basics.h:133
Defines valid targets for an ionic model to run on and an allocator for allocating memory on a specif...