-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMPIHook.h
42 lines (34 loc) · 810 Bytes
/
MPIHook.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef MPIHOOK_H
#define MPIHOOK_H
#define _GNU_SOURCE
#include "hdfs.h"
#include "hdfs_url.h"
#include "options.h"
#include <mpi.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <errno.h>
#ifdef DEBUG
#define status(str, ...) printf(str, ##__VA_ARGS__)
#else
#define status(str, ...)
#endif
#define HDFSFILEMAGIC 0x19d48be3
#ifdef CONST_BUF
#define MPIHDFS_CONST const
#else
#define MPIHDFS_CONST
#endif
#define NOT_IMPLEMENTED { fprintf(stderr, "Function not implemented.\n"); return -1; }
typedef struct
{
int32_t magic; // Indicates this is HDFS object
hdfsFS fs; // HDFS file system object
hdfsFile file; // HDFS file object
char *filename; // Name of file in HDFS
int amode; // Mode for opening in MPI
} hdfsFile_wrapper;
#endif