Functions | |
int | M3_TODcacheStruct_AppendRequest (M3_TODcacheStruct *todCache, M3_DataSetLL *dataSet, M3_Interval requestInterval) |
Append a tod request to the list of requests that the cache will support after initialization. | |
int | M3_TODcacheStruct_AppendRequestList (M3_TODcacheStruct *todCache, M3_DataSetLL *dataSet, M3_IntervalLL *requestIntervalList) |
Append a list of tod requests to the list of requests that the cache will support after initialization. | |
int | M3_TODcacheStruct_Initialize (M3_TODcacheStruct *todCache, M3_RunConfigStruct *runConfig, size_t *storeSize) |
After all requests have been appended this function allocates memory and reads data for tod cache. | |
int | M3_TODcacheStruct_DestroyStore (M3_TODcacheStruct *todCache) |
Destructor routine for freeing memory and cleaning data structures created by a call to M3_TODcacheStruct_Initialize. |
Currently the TODcacheStruct can store two types of data: GCP data, and partial maps. By default both GCP data and map data are cached following a procedure of appending requests and then initializing the cache. In the cases where the functionality of scanning from maps for simulation of time stream data is being used, it is required that this procedure be followed, but in the cases where this functionality is not being exercised, cache initialization it optional. In cases where telescope pointing is reused for multiple detectors during the same time intervals, it will be faster if the cache is initialized before pointing data requests are made, but it is not required.
The procedure of appending TOD requests is done buy calling M3_TODcacheStruct_AppendRequest or M3_TODcacheStruct_AppendRequestList. These function calls can be done once, or multiple times and in any sequence. Once the sample intervals for all of the anticipated data requests have been appended by the use of these functions the M3_TODcacheStruct_Initialize function should be called. This routine actually allocates the memory for the cache and reads required data from disk. The procedure is robust to appending overlapping requests.
int M3_TODcacheStruct_AppendRequest | ( | M3_TODcacheStruct * | todCache, | |
M3_DataSetLL * | dataSet, | |||
M3_Interval | requestInterval | |||
) |
Append a tod request to the list of requests that the cache will support after initialization.
This function is one of two ways to append requests to the cache for storage during initialization. This function takes as input a data set and a single sample interval to be appended. This function can be called repeatedly, and is robust to an overlapping sequence of requests.
All calls to this function should be made before a call to M3_TODcacheStruct_Initialize and no calls should be made to this function subsequent to a call to M3_TODcachStruct_Initialize unless a call has been made to M3_TODcacheStruct_DestroyStore first.
todCache | IN: The TOD Cache object obtained from a Run Configuration object. | |
dataSet | IN: The data set from which a tod or pointing request will be made. | |
requestInterval | IN: The sample index interval for the request that will be made. |
INTERFACE FUNCTION M3_f90_TODcache_AppendRequest( todcache, dataset, requestfirstsample, requestlastsample ) USE M3_typesf IMPLICIT NONE INTEGER(KIND=int4)::m3_f90_todcache_appendrequest TYPE (m3_f90_todcache), INTENT(INOUT)::todcache TYPE (m3_f90_dataset), INTENT(IN)::dataset INTEGER(KIND=int8), INTENT(IN)::requestfirstsample INTEGER(KIND=int8), INTENT(IN)::requestlastsample END FUNCTION M3_f90_TODcache_AppendRequest END INTERFACE
Definition at line 46 of file M3_cache.c.
Referenced by M3_DataSetLL_GetEuler().
int M3_TODcacheStruct_AppendRequestList | ( | M3_TODcacheStruct * | todCache, | |
M3_DataSetLL * | dataSet, | |||
M3_IntervalLL * | requestIntervalList | |||
) |
Append a list of tod requests to the list of requests that the cache will support after initialization.
This function is one of two ways to append requests to the cache for storage during initialization. This function takes as input a data set and a linked list of sample intervals to be appended. This function can be called repeatedly, and is robust to overlapping requests.
All calls to this function should be made before a call to M3_TODcacheStruct_Initialize and no calls should be made to this function subsequent to a call to M3_TODcachStruct_Initialize unless a call has been made to M3_TODcacheStruct_DestroyStore first.
todCache | IN: The TOD Cache object obtained from a Run Configuration object. | |
dataSet | IN: The data set from which a tod or pointing request will be made. | |
requestIntervalList | IN: The linked list of sample index intervals for requests that will be made. |
INTERFACE FUNCTION M3_f90_TODcache_AppendRequestList( todcache, dataset, requestintervallist ) USE M3_typesf IMPLICIT NONE INTEGER(KIND=int4)::m3_f90_todcache_appendrequestlist TYPE (m3_f90_todcache), INTENT(INOUT)::todcache TYPE (m3_f90_dataset), INTENT(IN)::dataset TYPE (m3_f90_interval), INTENT(IN)::requestintervallist END FUNCTION M3_f90_TODcache_AppendRequestList END INTERFACE
int M3_TODcacheStruct_DestroyStore | ( | M3_TODcacheStruct * | todCache | ) |
Destructor routine for freeing memory and cleaning data structures created by a call to M3_TODcacheStruct_Initialize.
After a call to this function all memory allocated during the initialization call is freed. At the same time all of the data structures that used to refer to cached data are cleaned up. This routine must be called between repeated calls to M3_TODcacheStruct_Initialize.
todCache | IN/OUT: The TOD Cache object obtained from a Run Configuration object which has been previously initialized. |
int M3_TODcacheStruct_Initialize | ( | M3_TODcacheStruct * | todCache, | |
M3_RunConfigStruct * | runConfig, | |||
size_t * | storeSize | |||
) |
After all requests have been appended this function allocates memory and reads data for tod cache.
It is important to note that this routine allocates memory for the GCP and map data required to satisfy all of the requests given during the request appending procedure (M3_TODcacheStruct_AppendRequest and M3_TODcacheStruct_AppendRequestList). The amount of memory required can be determined, or bounded with M3_TODcacheStruct_GetStoreSizeAllUB, M3_TODcacheStruct_GetStoreSizeGCP, or M3_TODcacheStruct_GetStoreSizeScanMapUB. The estimates that include the map storage are upper bounds, because the pointing data must be cached before the size of the map data can be determined. After the initialization is completed the total amount of memory allocated in bytes is given by the storeSize parameter.
The places where this cache is stored are in the run configuration structure as the M3_PixelConvertStruct if map scanning is included, and in the M3_GCPointingStoreLL (member of M3_GCPointingGroupLL ) if gcp data is included.
todCache | IN/OUT: The TOD Cache object obtained from a Run Configuration object which has been appended with requests. | |
runConfig | IN/OUT: The Run Configuration object, used to access data objects where cache is stored. | |
storeSize | OUT: Gives the exact size of the memory allocated during the initialization in units of bytes. |
INTERFACE FUNCTION M3_f90_TODcache_Initialize( todcache, runconfig, storesize ) USE M3_typesf IMPLICIT NONE INTEGER(KIND=int4)::m3_f90_todcache_initialize TYPE (m3_f90_todcache), INTENT(INOUT)::todcache TYPE (m3_f90_runconfig), INTENT(IN)::runconfig INTEGER(KIND=int8), INTENT(OUT)::storesize END FUNCTION M3_f90_TODcache_Initialize END INTERFACE
Definition at line 125 of file M3_cache.c.
References M3_RunConfigStruct_GetPixelClassRoot(), and M3_MapEl::pixel.
Referenced by M3_DataSetLL_GetEuler().