25 # define _CRT_SECURE_NO_WARNINGS 27 # pragma warning(4 : 4996) 28 # pragma warning(4 : 4267) 29 # pragma warning(4 : 4244) 40 # define lseek _lseeki64 41 # define fsync _commit 42 # define mkdir(dir, mode) _mkdir(dir) 43 # define strcasecmp _stricmp 44 # define strncasecmp _strnicmp 45 # define srandom srand 46 # define random() (rand() * (RAND_MAX+1) + rand()) 47 # define sleep(X) Sleep((X)*1000) 48 # define sysconf(X) 4096 50 # include <sys/param.h> 79 # define NULL ((void *)0) 83 #define MEGABYTE 1000000 84 #define GIGABYTE 1000000000 86 #define KIBIBYTE (1 << 10) 87 #define MEBIBYTE (1 << 20) 88 #define GIBIBYTE (1 << 30) 110 #define MAX_RETRY 10000 112 #define PATH_MAX 4096 115 #define DELIMITERS " \t\r\n=" 116 #define FILENAME_DELIMITER '@' 119 #define HERE fprintf(stdout, "** LINE %d (TASK=%d) **\n", \ 125 #define IOR_format "%016llx" 134 #define WARN_RESET(MSG, TO_STRUCT_PTR, FROM_STRUCT_PTR, MEMBER) do { \ 135 (TO_STRUCT_PTR)->MEMBER = (FROM_STRUCT_PTR)->MEMBER; \ 137 fprintf(stdout, "ior WARNING: %s. Using value of %d.\n", \ 138 MSG, (TO_STRUCT_PTR)->MEMBER); \ 144 #define WARN(MSG) do { \ 145 if (verbose > VERBOSE_2) { \ 146 fprintf(stdout, "ior WARNING: %s, (%s:%d).\n", \ 147 MSG, __FILE__, __LINE__); \ 149 fprintf(stdout, "ior WARNING: %s.\n", MSG); \ 156 #define EWARNF(FORMAT, ...) do { \ 157 if (verbose > VERBOSE_2) { \ 158 fprintf(stdout, "ior WARNING: " FORMAT ", errno %d, %s (%s:%d).\n", \ 159 __VA_ARGS__, errno, strerror(errno), __FILE__, __LINE__); \ 161 fprintf(stdout, "ior WARNING: " FORMAT ", errno %d, %s \n", \ 162 __VA_ARGS__, errno, strerror(errno)); \ 169 #define EWARN(MSG) do { \ 175 #define ERRF(FORMAT, ...) do { \ 176 fprintf(stdout, "ior ERROR: " FORMAT ", errno %d, %s (%s:%d)\n", \ 177 __VA_ARGS__, errno, strerror(errno), __FILE__, __LINE__); \ 179 MPI_Abort(MPI_COMM_WORLD, -1); \ 184 #define ERR(MSG) do { \ 190 #define ERR_SIMPLE(MSG) do { \ 191 fprintf(stdout, "ior ERROR: %s, (%s:%d)\n", \ 192 MSG, __FILE__, __LINE__); \ 194 MPI_Abort(MPI_COMM_WORLD, -1); \ 204 #define MPI_CHECKF(MPI_STATUS, FORMAT, ...) do { \ 205 char resultString[MPI_MAX_ERROR_STRING]; \ 208 if (MPI_STATUS != MPI_SUCCESS) { \ 209 MPI_Error_string(MPI_STATUS, resultString, &resultLength); \ 210 fprintf(stdout, "ior ERROR: " FORMAT ", MPI %s, (%s:%d)\n", \ 211 __VA_ARGS__, resultString, __FILE__, __LINE__); \ 213 MPI_Abort(MPI_COMM_WORLD, -1); \ 224 #define MPI_CHECK(MPI_STATUS, MSG) do { \ 225 MPI_CHECKF(MPI_STATUS, "%s", MSG); \ 244 extern int uname(
struct utsname *name);
long long int IOR_offset_t