-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathlp-io.h
More file actions
53 lines (40 loc) · 1.09 KB
/
lp-io.h
File metadata and controls
53 lines (40 loc) · 1.09 KB
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
43
44
45
46
47
48
49
50
51
52
53
/*
* Copyright (C) 2013 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#ifndef LP_IO_H
#define LP_IO_H
#ifdef __cplusplus
extern "C" {
#endif
#include <ross.h>
typedef char* lp_io_handle;
#define LP_IO_UNIQ_SUFFIX 1
/* to be called (collectively) before running simulation to prepare the
* output directory.
*/
int lp_io_prepare(char *directory, int flags, lp_io_handle* handle, MPI_Comm comm);
/* to be called within LPs to store a block of data */
int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer);
/* undo the immediately preceding write for the given LP */
int lp_io_write_rev(tw_lpid gid, char* identifier);
/* to be called (collectively) after tw_run() to flush data to disk */
int lp_io_flush(lp_io_handle handle, MPI_Comm comm);
/* retrieves the directory name for a handle */
static inline char* lp_io_handle_to_dir(lp_io_handle handle)
{
return(strdup(handle));
}
#ifdef __cplusplus
}
#endif
#endif /* LP_IO_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ft=c ts=8 sts=4 sw=4 expandtab
*/