📄 adioi.h
字号:
ADIO_Offset offset, ADIO_Request *request, 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_IreadStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code);void ADIOI_GEN_IwriteStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code);int ADIOI_GEN_IODone(ADIO_Request *request, ADIO_Status *status, int *error_code);void ADIOI_GEN_IOComplete(ADIO_Request *request, ADIO_Status *status, int *error_code);int ADIOI_GEN_aio_poll_fn(void *extra_state, ADIO_Status *status);int ADIOI_GEN_aio_wait_fn(int count, void **array_of_states, double timeout, ADIO_Status *status);int ADIOI_GEN_aio_query_fn(void *extra_state, ADIO_Status *status);int ADIOI_GEN_aio_free_fn(void *extra_state);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_WriteStrided_naive(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_NOLOCK_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_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);void ADIOI_GEN_Close(ADIO_File fd, int *error_code);void ADIOI_Shfp_fname(ADIO_File fd, int rank);void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset size, int *error_code);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);int ADIOI_FAKE_IODone(ADIO_Request *request, ADIO_Status *status, int *error_code);void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code);void ADIOI_FAKE_IreadStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code);void ADIOI_FAKE_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code); void ADIOI_FAKE_IwriteStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code);void ADIOI_FAKE_IOComplete(ADIO_Request *request, ADIO_Status *status, int *error_code);/* File I/O common functionality */int MPIOI_File_read(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count, MPI_Datatype datatype, char *myname, MPI_Status *status);int MPIOI_File_write(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count, MPI_Datatype datatype, char *myname, MPI_Status *status);int MPIOI_File_read_all(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count, MPI_Datatype datatype, char *myname, MPI_Status *status);int MPIOI_File_write_all(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count, MPI_Datatype datatype, char *myname, MPI_Status *status);int MPIOI_File_read_all_begin(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count, MPI_Datatype datatype, char *myname);int MPIOI_File_write_all_begin(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count, MPI_Datatype datatype, char *myname);int MPIOI_File_read_all_end(MPI_File fh, void *buf, char *myname, MPI_Status *status);int MPIOI_File_write_all_end(MPI_File fh, void *buf, char *myname, MPI_Status *status);int MPIOI_File_iwrite(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count, MPI_Datatype datatype, char *myname, MPI_Request *request);int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count, MPI_Datatype datatype, char *myname, MPI_Request *request);/* Unix-style file locking */#if (defined(ROMIO_HFS) || defined(ROMIO_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, ADIOI_LOCK_CMD, 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#ifdef ADIOI_MPE_LOGGING# define ADIOI_WRITE_LOCK(fd, offset, whence, len) do { \ MPE_Log_event( ADIOI_MPE_writelock_a, 0, NULL ); \ ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len); \ MPE_Log_event( ADIOI_MPE_writelock_b, 0, NULL ); } while( 0 )# define ADIOI_READ_LOCK(fd, offset, whence, len) \ MPE_Log_event( ADIOI_MPE_readlock_a, 0, NULL ); do { \ ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_RDLCK, offset, whence, len); \ MPE_Log_event( ADIOI_MPE_readlock_b, 0, NULL ); } while( 0 )# define ADIOI_UNLOCK(fd, offset, whence, len) do { \ MPE_Log_event( ADIOI_MPE_unlock_a, 0, NULL ); \ ADIOI_Set_lock((fd)->fd_sys, F_SETLK, F_UNLCK, offset, whence, len); \ MPE_Log_event( ADIOI_MPE_unlock_b, 0, NULL ); } while( 0 )#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)#endif#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__)int ADIOI_Strncpy( char *outstr, const char *instr, size_t maxlen );int ADIOI_Strnapp( char *, const char *, size_t );char *ADIOI_Strdup( const char * );/* Provide a fallback snprintf for systems that do not have one *//* Define attribute as empty if it has no definition */#ifndef ATTRIBUTE#ifdef HAVE_GCC_ATTRIBUTE#define ATTRIBUTE(a) __attribute__(a)#else#define ATTRIBUTE(a)#endif#endif/* style: allow:snprintf:1 sig:0 */#ifdef HAVE_SNPRINTF#define ADIOI_Snprintf snprintf/* Sometimes systems don't provide prototypes for snprintf */#ifdef NEEDS_SNPRINTF_DECLextern int snprintf( char *, size_t, const char *, ... ) ATTRIBUTE((format(printf,3,4)));#endif#elseint ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) ATTRIBUTE((format(printf,3,4)));#endif /* HAVE_SNPRINTF */#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"/* MPE logging variables */#ifdef ADIOI_MPE_LOGGING#include "mpe.h"int ADIOI_MPE_open_a;int ADIOI_MPE_open_b;int ADIOI_MPE_read_a;int ADIOI_MPE_read_b;int ADIOI_MPE_write_a;int ADIOI_MPE_write_b;int ADIOI_MPE_lseek_a;int ADIOI_MPE_lseek_b;int ADIOI_MPE_close_a;int ADIOI_MPE_close_b;int ADIOI_MPE_writelock_a;int ADIOI_MPE_writelock_b;int ADIOI_MPE_readlock_a;int ADIOI_MPE_readlock_b;int ADIOI_MPE_unlock_a;int ADIOI_MPE_unlock_b;int ADIOI_MPE_postwrite_a;int ADIOI_MPE_postwrite_b;#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -