📄 adioi.h
字号:
#define ADIO_WriteIcomplete(request,status,error_code) \ (*((*(request))->fd->fns->ADIOI_xxx_WriteIcomplete))(request,status,error_code)#define ADIO_ReadComplete(request,status,error_code) \ (*((*(request))->fd->fns->ADIOI_xxx_ReadComplete))(request,status,error_code)#define ADIO_WriteComplete(request,status,error_code) \ (*((*(request))->fd->fns->ADIOI_xxx_WriteComplete))(request,status,error_code)#define ADIO_ReadStrided(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ (*(fd->fns->ADIOI_xxx_ReadStrided))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code)#define ADIO_WriteStrided(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ (*(fd->fns->ADIOI_xxx_WriteStrided))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code)#define ADIO_ReadStridedColl(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ (*(fd->fns->ADIOI_xxx_ReadStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code)#define ADIO_WriteStridedColl(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ (*(fd->fns->ADIOI_xxx_WriteStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code)#define ADIO_IreadStrided(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ (*(fd->fns->ADIOI_xxx_IreadStrided))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code)#define ADIO_IwriteStrided(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ (*(fd->fns->ADIOI_xxx_IwriteStrided))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code)#define ADIO_Flush(fd,error_code) (*(fd->fns->ADIOI_xxx_Flush))(fd,error_code)#define ADIO_Resize(fd,size,error_code) \ (*(fd->fns->ADIOI_xxx_Resize))(fd,size,error_code)#define ADIO_Delete(filename,error_code) \ (*(fd->fns->ADIOI_xxx_Delete))(filename,error_code)#define ADIO_SetInfo(fd, users_info, error_code) \ (*(fd->fns->ADIOI_xxx_SetInfo))(fd, users_info, error_code)/* structure for storing access info of this process's request from the file domain of other processes, and vice-versa. used as array of structures indexed by process number. */typedef struct { ADIO_Offset *offsets; /* array of offsets */ int *lens; /* array of lengths */ MPI_Aint *mem_ptrs; /* array of pointers. used in the read/write phase to indicate where the data is stored in memory */ int count; /* size of above arrays */} ADIOI_Access;/* prototypes for ADIO internal functions */void ADIOI_SetFunctions(ADIO_File fd);void ADIOI_Flatten_datatype(MPI_Datatype type);void ADIOI_Flatten(MPI_Datatype type, ADIOI_Flatlist_node *flat, ADIO_Offset st_offset, int *curr_index); void ADIOI_Delete_flattened(MPI_Datatype datatype);int ADIOI_Count_contiguous_blocks(MPI_Datatype type, int *curr_index);ADIOI_Async_node *ADIOI_Malloc_async_node(void);void ADIOI_Free_async_node(ADIOI_Async_node *node);void ADIOI_Add_req_to_list(ADIO_Request *request);void ADIOI_Complete_async(int *error_code);void ADIOI_Del_req_from_list(ADIO_Request *request);struct ADIOI_RequestD *ADIOI_Malloc_request(void);void ADIOI_Free_request(ADIOI_Req_node *node);void *ADIOI_Malloc_fn(size_t size, int lineno, char *fname);void *ADIOI_Calloc_fn(size_t nelem, size_t elsize, int lineno, char *fname);void *ADIOI_Realloc_fn(void *ptr, size_t size, int lineno, char *fname);void ADIOI_Free_fn(void *ptr, int lineno, char *fname);void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag);void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset);void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset);void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, ADIO_Offset *disp);void ADIOI_GEN_Flush(ADIO_File fd, int *error_code);void ADIOI_GEN_Delete(char *filename, int *error_code);void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code);void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, MPI_Datatype buftype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code);void ADIOI_GEN_WriteStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code);void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code);void ADIOI_GEN_WriteStridedColl(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code);void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Offset **offset_list_ptr, int **len_list_ptr, ADIO_Offset *start_offset_ptr, ADIO_Offset *end_offset_ptr, int *contig_access_count_ptr);void ADIOI_Calc_file_domains(ADIO_Offset *st_offsets, ADIO_Offset *end_offsets, int nprocs, int nprocs_for_coll, ADIO_Offset *min_st_offset_ptr, ADIO_Offset **fd_start_ptr, ADIO_Offset **fd_end_ptr, ADIO_Offset *fd_size_ptr);int ADIOI_Calc_aggregator(ADIO_File fd, ADIO_Offset off, ADIO_Offset min_off, ADIO_Offset *len, ADIO_Offset fd_size, ADIO_Offset *fd_start, ADIO_Offset *fd_end);void ADIOI_Calc_my_req(ADIO_File fd, ADIO_Offset *offset_list, int *len_list, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset *fd_start, ADIO_Offset *fd_end, ADIO_Offset fd_size, int nprocs, int *count_my_req_procs_ptr, int **count_my_req_per_proc_ptr, ADIOI_Access **my_req_ptr, int **buf_idx_ptr);void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs, int *count_my_req_per_proc, ADIOI_Access *my_req, int nprocs, int myrank, int *count_others_req_procs_ptr, ADIOI_Access **others_req_ptr); ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, int whence, int *error_code);void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);void ADIOI_Shfp_fname(ADIO_File fd, int rank);int ADIOI_Error(ADIO_File fd, int error_code, char *string);int MPIR_Err_setmsg( int, int, const char *, const char *, const char *, ... );int ADIOI_End_call(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state);int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, int nbytes);int ADIOI_Uses_generic_read(ADIO_File fd);int ADIOI_Uses_generic_write(ADIO_File fd);/* Unix-style file locking */#if (defined(HFS) || defined(XFS))# define ADIOI_WRITE_LOCK(fd, offset, whence, len) \ if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \ ADIOI_Set_lock64((fd)->fd_sys, F_SETLKW64, F_WRLCK, offset, whence, len);\ else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len)# define ADIOI_READ_LOCK(fd, offset, whence, len) \ if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \ ADIOI_Set_lock64((fd)->fd_sys, F_SETLKW64, F_RDLCK, offset, whence, len);\ else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_RDLCK, offset, whence, len)# define ADIOI_UNLOCK(fd, offset, whence, len) \ if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \ ADIOI_Set_lock64((fd)->fd_sys, F_SETLK64, F_UNLCK, offset, whence, len); \ else ADIOI_Set_lock((fd)->fd_sys, F_SETLK, F_UNLCK, offset, whence, len)#elif (defined(ROMIO_NTFS))#define ADIOI_LOCK_CMD 0#define ADIOI_UNLOCK_CMD 1# define ADIOI_WRITE_LOCK(fd, offset, whence, len) \ ADIOI_Set_lock((fd)->fd_sys, ADIOI_LOCK_CMD, LOCKFILE_EXCLUSIVE_LOCK, offset, whence, len)# define ADIOI_READ_LOCK(fd, offset, whence, len) \ ADIOI_Set_lock((fd)->fd_sys, ADIOLOCK, 0, offset, whence, len)# define ADIOI_UNLOCK(fd, offset, whence, len) \ ADIOI_Set_lock((fd)->fd_sys, ADIOI_UNLOCK_CMD, LOCKFILE_FAIL_IMMEDIATELY, offset, whence, len)#else# define ADIOI_WRITE_LOCK(fd, offset, whence, len) \ ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len)# define ADIOI_READ_LOCK(fd, offset, whence, len) \ ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_RDLCK, offset, whence, len)# define ADIOI_UNLOCK(fd, offset, whence, len) \ ADIOI_Set_lock((fd)->fd_sys, F_SETLK, F_UNLCK, offset, whence, len)#endifint ADIOI_Set_lock(FDTYPE fd_sys, int cmd, int type, ADIO_Offset offset, int whence, ADIO_Offset len);int ADIOI_Set_lock64(FDTYPE fd_sys, int cmd, int type, ADIO_Offset offset, int whence, ADIO_Offset len);#define ADIOI_Malloc(a) ADIOI_Malloc_fn(a,__LINE__,__FILE__)#define ADIOI_Calloc(a,b) ADIOI_Calloc_fn(a,b,__LINE__,__FILE__)#define ADIOI_Realloc(a,b) ADIOI_Realloc_fn(a,b,__LINE__,__FILE__)#define ADIOI_Free(a) ADIOI_Free_fn(a,__LINE__,__FILE__)#define FPRINTF fprintf#ifndef HAVE_STRERROR# ifdef HAVE_SYSERRLIST extern char *sys_errlist[];# define strerror(n) sys_errlist[n]# else # define PRINT_ERR_MSG# endif#endif#include "adioi_error.h"#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -