Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
darshan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
72
Issues
72
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
darshan
darshan
Commits
bdb2a5f0
Commit
bdb2a5f0
authored
Dec 01, 2015
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime now mmaps header and job data to tmp log
parent
799d9890
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
120 deletions
+81
-120
darshan-log-format.h
darshan-log-format.h
+1
-0
darshan-runtime/Makefile.in
darshan-runtime/Makefile.in
+2
-1
darshan-runtime/darshan-core.h
darshan-runtime/darshan-core.h
+5
-6
darshan-runtime/darshan.h
darshan-runtime/darshan.h
+2
-3
darshan-runtime/lib/darshan-core.c
darshan-runtime/lib/darshan-core.c
+61
-72
darshan-runtime/lib/darshan-posix.c
darshan-runtime/lib/darshan-posix.c
+10
-38
No files found.
darshan-log-format.h
View file @
bdb2a5f0
...
...
@@ -77,6 +77,7 @@ static char * const darshan_module_names[] =
/* compression method used on darshan log file */
enum
darshan_comp_type
{
DARSHAN_NO_COMP
,
DARSHAN_ZLIB_COMP
,
DARSHAN_BZIP2_COMP
,
};
...
...
darshan-runtime/Makefile.in
View file @
bdb2a5f0
all
:
lib/libdarshan.a lib/libdarshan-stubs.a lib/darshan-null.o
all
:
lib/libdarshan.a lib/libdarshan-stubs.a
#TODO: lib/darshan-null.o
#TODO: each module provides own makefile with module-specific objects, build options, etc.
...
...
darshan-runtime/darshan-core.h
View file @
bdb2a5f0
...
...
@@ -42,17 +42,16 @@
/* in memory structure to keep up with job level data */
struct
darshan_core_runtime
{
/* XXX-MMAP */
struct
darshan_header
*
log_hdr_p
;
struct
darshan_job
*
log_job_p
;
char
*
log_exemnt_p
;
/* XXX: MMAP */
void
*
mmap_p
;
struct
darshan_job
*
mmap_job_p
;
char
*
mmap_exe_mnt_p
;
void
*
mmap_mod_p
;
/* XXX-MMAP */
struct
darshan_core_record_ref
*
rec_hash
;
int
rec_count
;
struct
darshan_core_module
*
mod_array
[
DARSHAN_MAX_MODS
];
char
comp_buf
[
DARSHAN_COMP_BUF_SIZE
];
char
comp_buf
[
DARSHAN_COMP_BUF_SIZE
];
/* TODO: why is this allocated statically? */
double
wtime_offset
;
};
...
...
darshan-runtime/darshan.h
View file @
bdb2a5f0
...
...
@@ -98,10 +98,9 @@ struct darshan_module_funcs
void
darshan_core_register_module
(
darshan_module_id
mod_id
,
struct
darshan_module_funcs
*
funcs
,
void
**
mod_buf
,
int
*
mod_buf_size
,
int
*
my_rank
,
int
*
mod_mem_limit
,
void
**
mmap_buf
,
int
*
mmap_buf_size
,
int
*
sys_mem_alignment
);
/* darshan_core_unregister_module()
...
...
darshan-runtime/lib/darshan-core.c
View file @
bdb2a5f0
This diff is collapsed.
Click to expand it.
darshan-runtime/lib/darshan-posix.c
View file @
bdb2a5f0
...
...
@@ -177,8 +177,6 @@ struct posix_runtime
int
file_array_ndx
;
struct
posix_file_runtime
*
file_hash
;
struct
posix_file_runtime_ref
*
fd_hash
;
struct
posix_file_runtime
agg_file_runtime
;
};
static
struct
posix_runtime
*
posix_runtime
=
NULL
;
...
...
@@ -1625,9 +1623,8 @@ static void posix_runtime_initialize()
.
get_output_data
=
&
posix_get_output_data
,
.
shutdown
=
&
posix_shutdown
};
int
mem_limit
;
void
*
mmap_buf
;
int
mmap_buf_size
;
void
*
psx_buf
;
int
psx_buf_size
;
/* don't do anything if already initialized or instrumenation is disabled */
if
(
posix_runtime
||
instrumentation_disabled
)
...
...
@@ -1637,14 +1634,13 @@ static void posix_runtime_initialize()
darshan_core_register_module
(
DARSHAN_POSIX_MOD
,
&
posix_mod_fns
,
&
psx_buf
,
&
psx_buf_size
,
&
my_rank
,
&
mem_limit
,
&
mmap_buf
,
&
mmap_buf_size
,
&
darshan_mem_alignment
);
/* return if no memory assigned by darshan
core */
if
(
mem_limit
==
0
)
/* return if no memory assigned by darshan
-
core */
if
(
psx_buf_size
==
0
)
return
;
posix_runtime
=
malloc
(
sizeof
(
*
posix_runtime
));
...
...
@@ -1654,35 +1650,22 @@ static void posix_runtime_initialize()
/* set maximum number of file records according to max memory limit */
/* NOTE: maximum number of records is based on the size of a posix file record */
/* TODO: should we base memory usage off file record or total runtime structure sizes? */
posix_runtime
->
file_array_size
=
mem_limit
/
sizeof
(
struct
darshan_posix_file
);
posix_runtime
->
file_array_size
=
psx_buf_size
/
sizeof
(
struct
darshan_posix_file
);
posix_runtime
->
file_array_ndx
=
0
;
/* allocate array of runtime file records */
posix_runtime
->
file_runtime_array
=
malloc
(
posix_runtime
->
file_array_size
*
sizeof
(
struct
posix_file_runtime
));
posix_runtime
->
file_record_array
=
malloc
(
posix_runtime
->
file_array_size
*
sizeof
(
struct
darshan_posix_file
));
if
(
!
posix_runtime
->
file_runtime_array
||
!
posix_runtime
->
file_record_array
)
if
(
!
posix_runtime
->
file_runtime_array
)
{
posix_runtime
->
file_array_size
=
0
;
return
;
}
memset
(
posix_runtime
->
file_runtime_array
,
0
,
posix_runtime
->
file_array_size
*
sizeof
(
struct
posix_file_runtime
));
memset
(
posix_runtime
->
file_record_array
,
0
,
posix_runtime
->
file_array_size
*
sizeof
(
struct
darshan_posix_file
));
/* XXX-MMAP */
if
(
mmap_buf_size
>=
sizeof
(
struct
darshan_posix_file
))
{
memset
(
&
(
posix_runtime
->
agg_file_runtime
),
0
,
sizeof
(
struct
posix_file_runtime
));
posix_runtime
->
agg_file_runtime
.
file_record
=
(
struct
darshan_posix_file
*
)
mmap_buf
;
posix_runtime
->
agg_file_runtime
.
file_record
->
f_id
=
DARSHAN_POSIX_MOD
;
posix_runtime
->
agg_file_runtime
.
file_record
->
rank
=
my_rank
;
}
/* store pointer to POSIX record buffer given by darshan-core */
posix_runtime
->
file_record_array
=
(
struct
darshan_posix_file
*
)
psx_buf
;
return
;
}
...
...
@@ -1699,8 +1682,6 @@ static struct posix_file_runtime* posix_file_by_name(const char *name)
if
(
!
posix_runtime
||
instrumentation_disabled
)
return
(
NULL
);
return
(
&
(
posix_runtime
->
agg_file_runtime
));
#if 0
newname
=
darshan_clean_file_path
(
name
);
if
(
!
newname
)
newname
=
(
char
*
)
name
;
...
...
@@ -1751,7 +1732,6 @@ static struct posix_file_runtime* posix_file_by_name(const char *name)
if
(
newname
!=
name
)
free
(
newname
);
return
(
file
);
#endif
}
/* get a POSIX file record for the given file path, and also create a
...
...
@@ -1768,7 +1748,6 @@ static struct posix_file_runtime* posix_file_by_name_setfd(const char* name, int
/* find file record by name first */
file
=
posix_file_by_name
(
name
);
#if 0
if
(
!
file
)
return
(
NULL
);
...
...
@@ -1794,7 +1773,6 @@ static struct posix_file_runtime* posix_file_by_name_setfd(const char* name, int
ref
->
file
=
file
;
ref
->
fd
=
fd
;
HASH_ADD
(
hlink
,
posix_runtime
->
fd_hash
,
fd
,
sizeof
(
int
),
ref
);
#endif
return
(
file
);
}
...
...
@@ -1807,16 +1785,12 @@ static struct posix_file_runtime* posix_file_by_fd(int fd)
if
(
!
posix_runtime
||
instrumentation_disabled
)
return
(
NULL
);
return
(
posix_file_by_name
(
NULL
));
#if 0
/* search hash table for existing file ref for this fd */
HASH_FIND
(
hlink
,
posix_runtime
->
fd_hash
,
&
fd
,
sizeof
(
int
),
ref
);
if
(
ref
)
return
(
ref
->
file
);
return
(
NULL
);
#endif
}
/* free up reference data structures for the given file descriptor */
...
...
@@ -1827,7 +1801,6 @@ static void posix_file_close_fd(int fd)
if
(
!
posix_runtime
||
instrumentation_disabled
)
return
;
#if 0
/* search hash table for this fd */
HASH_FIND
(
hlink
,
posix_runtime
->
fd_hash
,
&
fd
,
sizeof
(
int
),
ref
);
if
(
ref
)
...
...
@@ -1836,7 +1809,6 @@ static void posix_file_close_fd(int fd)
HASH_DELETE
(
hlink
,
posix_runtime
->
fd_hash
,
ref
);
free
(
ref
);
}
#endif
return
;
}
...
...
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