specify numerical precision
krober10nd opened this issue · 10 comments
- how does one control the numerical precision of floats used in the C code from the Python API?
Through the SpaceModel attribute dtype
, which can be numpy.float32 or numpy.float64, respectively float and double in C.
Thanks Jaime. Although wouldn't this make more sense to specify to the compiler?
It's because all data (grid, velocity model, density model, damp, sources/receivers, wavelets, etc) must have the same precision.
hmm I see your point but the Compiler
could also convert all this stuff, no?
The compiler could not because It does not deal with the Ctypes data type and referencing. It just compile the C code. The Middleware class is aware of the dtype information and informs the Compiler before compilation. Acually, It calls the Compiler.
Furthermore, the precision is used in python as well.
do you have a formal definition of these terms: frontend, backend, and middleware?
Frontend and Backend are common terms used in web development. In that context, the app is divided in frontend (client-side rendering, i.e. run on the browser and it's close to or belong to the user interface) and backend (server-side rendering, i.e. run on the server and it's responsible for the "low level" part of the code). Middleware is a term used in distributed systems. The term is most commonly used for software that enables communication and data management in distributed applications. Also described as "software glue". In OS, middleware is the software that sits between the operating system and the applications running on it. In summary frontend represents a piece of software close to the user, backend represents the part close to the architecture or the application's low level, and the middleware is something that interconnects different layers of sofware. In simwave, there is no formal definition for those terms. Their meaning comes from other areas, but represents the semantics of simwave's layers.
Okay that's worth mentioning then in the text I'd imagine (at least that there's an analogy here between web development with respect to the jargon).
Sure. I am gonna discuss that with Hermes. Maybe we are going to change the name middleware
, but we are not sure. I particularly think this term is appropriate.