The distribution methods are the individual code used by each distribution to perform mappings between the logical file data and the data file objects. The methods also provide a mechanism for encoding/decoding the distribution parameters, determining the number of data file objects to create for a file, modifying distribution parameters, and distribution registration tasks. For some of the methods a default implementation is available that may be acceptable for most distributions.
PVFS_offset logical_to_physical_offset( void* params, uint32_t dfile_nr, uint32_t dfile_ct, PVFS_offset logical_offset );
Given a logical offset, return the physical offset that corresponds to that logical offset. Returns a physical offset. The return value rounds down to the largest physical offset held by the I/O server if the logical offset does not map to a physical offset on that server.
PVFS_offset physical_to_logical_offset( void* params, uint32_t dfile_nr, uint32_t dfile_ct, PVFS_offset physical_offset)
Given a physical offset, return the logical offset that corresponds to that physical offset. Returns a logical offset. The input value is assumed to be on the current PVFS server.
PVFS_offset next_mapped_offset( void* params, uint32_t dfile_nr, uint32_t dfile_ct, PVFS_offset logical_offset)
Given a logical offset, find the logical offset greater than or equal to the logical offset that maps to a physical offset on the current PVFS server. Returns a logical offset.
PVFS_size contiguous_length( void* params, uint32_t dfile_nr, uint32_t dfile_ct, PVFS_offset physical_offset)
Beginning in a given physical location, return the number of contiguous bytes in the physical bytes stream on the current PVFS server that map to contiguous bytes in the logical byte sequence. Returns a length in bytes.
int get_num_dfiles( void* params, uint32_t num_servers_requested, uint32_t num_dfiles_requested )
Returns the number of data file objects to use for the requested file. The number of servers requested and number of data files requested are hints from the user that the distribution can ignore if neccesary. A default implementation of this function is provided in pint-dist-utils.h that returns the number of servers requested (which is usually the number of data servers in the system).
int set_param( const char* dist_name, void* params const char* param_name, void* value )
Set the distribution parameter described by param_name to value. A default implementation is provided in pint-dist-utils.h that can handle parameters that have been previously registered.
void encode_lebf( char** pptr, void* params )
Write params into the data stream pptr in little endian byte format.
void decode_lebf( char** pptr, void* params )
Read params from the data stream pptr in little endian byte format.
void registration_init( void* params )
Called when the distribution is registered (i.e. once). Used to set default distribution values, register parameters, or any other initialization activity needed by the distribution.