gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-devel] [task #14572] Protect gal_data_t's array and block poin


From: Mohammad Akhlaghi
Subject: [gnuastro-devel] [task #14572] Protect gal_data_t's array and block pointers
Date: Wed, 28 Jun 2017 12:05:33 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Follow-up Comment #4, task #14572 (project gnuastro):

Thank you for the extra explanation Antonio. Unfortunately I am still a little
confused. I completely agree with defining `gal_data_t' as an opaque structure
and only access it through functions. I just don't understand the significance
of the "subtile" (or "subarray") concept. Is it a new concept, or just a
re-naming of the existing ones? Let me explain:

Currently, the larger entity is called a "Block" (because it is contiguous in
memory) and the "sub"-entity is called a "tile", as the ASCII diagram in the
book
<https://www.gnu.org/software/gnuastro/manual/html_node/Tessellation-library.html>
shows.

For example, let's assume we have the following two `gal_data_t's: `block' and
`tile'. The first is a contiguous patch of memory and `block->block=NULL'.
This shows that `block->array' is the start of this contiguous patch of
memory. However, `tile->block=block' and `tile->array' points to somewhere
within `block's allocated space.

The main advantage (purpose) of this system is that no extra allocation is
necessary: two tiles may overlap, they may be read/written on separately
(e.g., in parallel), and so on. Many Gnuastro programs currently rely on this
feature to work in parallel. It is really up to the library programmer to be
sure that they aren't writing to a tile before reading it in another tile that
(might) overlap with the first one. 

In this context, from what I understood, the "subtile" you mention are very
similar to the already defined "block" (separately allocated patches of
memory), am I correct?

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/task/?14572>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]