Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
2a169880
Commit
2a169880
authored
Jan 08, 2014
by
Jonathan Jenkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added experimental lp-io reverse computation support
parent
21b03940
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
codes/lp-io.h
codes/lp-io.h
+5
-0
src/util/lp-io.c
src/util/lp-io.c
+46
-0
No files found.
codes/lp-io.h
View file @
2a169880
...
...
@@ -21,6 +21,11 @@ int lp_io_prepare(char *directory, int flags, lp_io_handle* handle, MPI_Comm com
/* 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
* (hack for logging/testing optimistic mode, not recommended for general use)
*/
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
);
...
...
src/util/lp-io.c
View file @
2a169880
...
...
@@ -100,6 +100,52 @@ int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer)
return
(
0
);
}
int
lp_io_write_rev
(
tw_lpid
gid
,
char
*
identifier
){
struct
identifier
*
id
;
struct
io_buffer
*
buf
,
*
buf_prev
;
/* find given identifier */
if
(
strlen
(
identifier
)
>=
32
)
{
fprintf
(
stderr
,
"Error: identifier %s too big.
\n
"
,
identifier
);
return
(
-
1
);
}
id
=
identifiers
;
while
(
id
&&
(
strcmp
(
identifier
,
id
->
identifier
)
!=
0
)){
id
=
id
->
next
;
}
if
(
!
id
){
fprintf
(
stderr
,
"Error: identifier %s not found on reverse.
\n
"
,
identifier
);
return
(
-
1
);
}
/* attempt to find previous LP's write. This is made easier by the fact
* that the list is stored newest-to-oldest */
buf
=
id
->
buffers
;
buf_prev
=
NULL
;
while
(
buf
){
if
(
buf
->
gid
==
gid
){
break
;
}
buf_prev
=
buf
;
buf
=
buf
->
next
;
}
if
(
!
buf
){
fprintf
(
stderr
,
"Error: no lp-io write buffer found for LP %lu (reverse write)
\n
"
,
gid
);
return
(
-
1
);
}
id
->
buffers_count
--
;
/* remove the buffer from the list
* (NULLs for end-of-list are preserved) */
if
(
buf
==
id
->
buffers
)
{
/* buf is head of list */
id
->
buffers
=
buf
->
next
;
}
else
{
/* buf is in list, has a previous element */
buf_prev
->
next
=
buf
->
next
;
}
free
(
buf
->
buffer
);
free
(
buf
);
return
(
0
);
}
int
lp_io_prepare
(
char
*
directory
,
int
flags
,
lp_io_handle
*
handle
,
MPI_Comm
comm
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment