Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Cristian Simarro
darshan
Commits
af20f42a
Commit
af20f42a
authored
Feb 18, 2015
by
Shane Snyder
Browse files
Clean up variable names and source files
parent
601e5ef7
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
darshan-log-format.h
View file @
af20f42a
...
...
@@ -19,16 +19,16 @@
#endif
/* update this on file format changes */
#define
CP
_VERSION "3.00"
#define
DARSHAN_LOG
_VERSION "3.00"
/* magic number for validating output files and checking byte order */
#define
CP
_MAGIC_NR 6567223
#define
DARSHAN
_MAGIC_NR 6567223
/* size (in bytes) of job record */
#define
CP
_JOB_RECORD_SIZE 4096
#define
DARSHAN
_JOB_RECORD_SIZE 4096
/* max length of exe string within job record (not counting '\0') */
#define
CP
_EXE_LEN (
CP
_JOB_RECORD_SIZE - sizeof(struct darshan_job) - 1)
#define
DARSHAN
_EXE_LEN (
DARSHAN
_JOB_RECORD_SIZE - sizeof(struct darshan_job) - 1)
typedef
uint64_t
darshan_record_id
;
...
...
darshan-runtime/darshan-core.h
View file @
af20f42a
...
...
@@ -25,7 +25,7 @@ struct darshan_core_module
struct
darshan_core_runtime
{
struct
darshan_job
log_job
;
char
exe
[
CP
_EXE_LEN
+
1
];
char
exe
[
DARSHAN
_EXE_LEN
+
1
];
struct
darshan_core_record_ref
*
rec_hash
;
struct
darshan_core_module
*
mod_array
[
DARSHAN_MAX_MODS
];
double
wtime_offset
;
...
...
darshan-runtime/lib/darshan-core.c
View file @
af20f42a
...
...
@@ -158,11 +158,11 @@ static void darshan_core_initialize(int *argc, char ***argv)
/* record exe and arguments */
for
(
i
=
0
;
i
<
(
*
argc
);
i
++
)
{
chars_left
=
CP
_EXE_LEN
-
strlen
(
darshan_core
->
exe
);
chars_left
=
DARSHAN
_EXE_LEN
-
strlen
(
darshan_core
->
exe
);
strncat
(
darshan_core
->
exe
,
(
*
argv
)[
i
],
chars_left
);
if
(
i
<
((
*
argc
)
-
1
))
{
chars_left
=
CP
_EXE_LEN
-
strlen
(
darshan_core
->
exe
);
chars_left
=
DARSHAN
_EXE_LEN
-
strlen
(
darshan_core
->
exe
);
strncat
(
darshan_core
->
exe
,
" "
,
chars_left
);
}
}
...
...
@@ -172,16 +172,16 @@ static void darshan_core_initialize(int *argc, char ***argv)
*/
if
(
argc
==
0
)
{
chars_left
=
CP
_EXE_LEN
-
strlen
(
darshan_core
->
exe
);
chars_left
=
DARSHAN
_EXE_LEN
-
strlen
(
darshan_core
->
exe
);
strncat
(
darshan_core
->
exe
,
__progname
,
chars_left
);
chars_left
=
CP
_EXE_LEN
-
strlen
(
darshan_core
->
exe
);
chars_left
=
DARSHAN
_EXE_LEN
-
strlen
(
darshan_core
->
exe
);
strncat
(
darshan_core
->
exe
,
" <unknown args>"
,
chars_left
);
}
if
(
chars_left
==
0
)
{
/* we ran out of room; mark that string was truncated */
truncate_offset
=
CP
_EXE_LEN
-
strlen
(
truncate_string
);
truncate_offset
=
DARSHAN
_EXE_LEN
-
strlen
(
truncate_string
);
sprintf
(
&
darshan_core
->
exe
[
truncate_offset
],
"%s"
,
truncate_string
);
}
...
...
@@ -354,18 +354,18 @@ static void darshan_core_shutdown()
/* rank 0 is responsible for writing the darshan job information */
if
(
my_rank
==
0
)
{
unsigned
char
tmp_buf
[
CP
_JOB_RECORD_SIZE
];
unsigned
char
tmp_buf
[
DARSHAN
_JOB_RECORD_SIZE
];
unsigned
char
*
tmp_ptr
;
/* pack the job info and exe/mount info into a buffer for writing */
tmp_ptr
=
tmp_buf
;
memcpy
(
tmp_ptr
,
&
final_core
->
log_job
,
sizeof
(
struct
darshan_job
));
tmp_ptr
+=
sizeof
(
struct
darshan_job
);
memcpy
(
tmp_ptr
,
final_core
->
trailing_data
,
CP
_EXE_LEN
+
1
);
memcpy
(
tmp_ptr
,
final_core
->
trailing_data
,
DARSHAN
_EXE_LEN
+
1
);
/* write the job information, making sure to prealloc space for the log header */
all_ret
=
DARSHAN_MPI_CALL
(
PMPI_File_write_at
)(
log_fh
,
sizeof
(
struct
darshan_header
),
tmp_buf
,
CP
_JOB_RECORD_SIZE
,
MPI_BYTE
,
&
status
);
tmp_buf
,
DARSHAN
_JOB_RECORD_SIZE
,
MPI_BYTE
,
&
status
);
if
(
all_ret
!=
MPI_SUCCESS
)
{
fprintf
(
stderr
,
"darshan library warning: unable to write job data to log file %s
\n
"
,
...
...
@@ -374,7 +374,7 @@ static void darshan_core_shutdown()
}
/* TODO: after compression is added, this should be fixed */
log_header
.
rec_map
.
off
=
sizeof
(
struct
darshan_header
)
+
CP
_JOB_RECORD_SIZE
;
log_header
.
rec_map
.
off
=
sizeof
(
struct
darshan_header
)
+
DARSHAN
_JOB_RECORD_SIZE
;
}
/* error out if unable to write job information */
...
...
@@ -487,8 +487,8 @@ static void darshan_core_shutdown()
if
(
my_rank
==
0
)
{
/* initialize the remaining header fields */
strcpy
(
log_header
.
version_string
,
CP
_VERSION
);
log_header
.
magic_nr
=
CP
_MAGIC_NR
;
strcpy
(
log_header
.
version_string
,
DARSHAN_LOG
_VERSION
);
log_header
.
magic_nr
=
DARSHAN
_MAGIC_NR
;
log_header
.
comp_type
=
DARSHAN_GZ_COMP
;
all_ret
=
DARSHAN_MPI_CALL
(
PMPI_File_write_at
)(
log_fh
,
0
,
&
log_header
,
...
...
@@ -839,7 +839,7 @@ static void darshan_get_exe_and_mounts_root(struct darshan_core_runtime *core,
/* length of exe has already been safety checked in darshan-posix.c */
strcat
(
trailing_data
,
core
->
exe
);
space_left
=
CP
_EXE_LEN
-
strlen
(
trailing_data
);
space_left
=
DARSHAN
_EXE_LEN
-
strlen
(
trailing_data
);
/* we make two passes through mounted file systems; in the first pass we
* grab any non-nfs mount points, then on the second pass we grab nfs
...
...
@@ -903,7 +903,7 @@ static char* darshan_get_exe_and_mounts(struct darshan_core_runtime *core)
char
*
trailing_data
;
int
space_left
;
space_left
=
CP
_EXE_LEN
+
1
;
space_left
=
DARSHAN
_EXE_LEN
+
1
;
trailing_data
=
malloc
(
space_left
);
if
(
!
trailing_data
)
{
...
...
darshan-runtime/lib/darshan-hdf5-stubs.c
deleted
100644 → 0
View file @
601e5ef7
/*
* (C) 2009 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
/* This file contains stubs for the H5F functions intercepted by Darshan.
* They are defined as weak symbols in order to satisfy dependencies of the
* hdf5 wrappers in cases where hdf5 is not being used.
*/
#include
"darshan-runtime-config.h"
#include
<stdio.h>
#include
<pthread.h>
#include
<string.h>
#include
"mpi.h"
#include
"darshan.h"
/* hope this doesn't change any time soon */
typedef
int
hid_t
;
typedef
int
herr_t
;
hid_t
H5Fcreate
(
const
char
*
filename
,
unsigned
flags
,
hid_t
create_plist
,
hid_t
access_plist
)
__attribute__
((
weak
));
hid_t
H5Fcreate
(
const
char
*
filename
,
unsigned
flags
,
hid_t
create_plist
,
hid_t
access_plist
)
{
int
rank
;
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
if
(
rank
==
0
)
{
fprintf
(
stderr
,
"WARNING: Darshan H5Fcreate() stub called; this is probably the result of a link-time problem.
\n
"
);
}
return
(
-
1
);
}
hid_t
H5Fopen
(
const
char
*
filename
,
unsigned
flags
,
hid_t
access_plist
)
__attribute__
((
weak
));
hid_t
H5Fopen
(
const
char
*
filename
,
unsigned
flags
,
hid_t
access_plist
)
{
int
rank
;
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
if
(
rank
==
0
)
{
fprintf
(
stderr
,
"WARNING: Darshan H5Fopen() stub called; this is probably the result of a link-time problem.
\n
"
);
}
return
(
-
1
);
}
herr_t
H5Fclose
(
hid_t
file_id
)
__attribute__
((
weak
));
herr_t
H5Fclose
(
hid_t
file_id
)
{
int
rank
;
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
if
(
rank
==
0
)
{
fprintf
(
stderr
,
"WARNING: Darshan H5Fclose() stub called; this is probably the result of a link-time problem.
\n
"
);
}
return
(
-
1
);
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
*/
darshan-runtime/lib/darshan-hdf5.c
deleted
100644 → 0
View file @
601e5ef7
/*
* (C) 2009 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include
"darshan-runtime-config.h"
#include
<stdio.h>
#include
<pthread.h>
#include
<string.h>
#include
"mpi.h"
#include
"darshan.h"
/* hope this doesn't change any time soon */
typedef
int
hid_t
;
typedef
int
herr_t
;
#ifdef DARSHAN_PRELOAD
#define __USE_GNU
#include
<dlfcn.h>
#include
<stdlib.h>
#define DARSHAN_FORWARD_DECL(name,ret,args) \
ret (*__real_ ## name)args = NULL;
#define DARSHAN_DECL(__name) __name
#define MAP_OR_FAIL(func) \
if (!(__real_ ## func)) \
{ \
__real_ ## func = dlsym(RTLD_NEXT, #func); \
if(!(__real_ ## func)) { \
fprintf(stderr, "Darshan failed to map symbol: %s\n", #func); \
exit(1); \
} \
}
#else
#define DARSHAN_FORWARD_DECL(name,ret,args) \
extern ret __real_ ## name args;
#define DARSHAN_DECL(__name) __wrap_ ## __name
#define MAP_OR_FAIL(func)
#endif
DARSHAN_FORWARD_DECL
(
H5Fcreate
,
hid_t
,
(
const
char
*
filename
,
unsigned
flags
,
hid_t
create_plist
,
hid_t
access_plist
));
DARSHAN_FORWARD_DECL
(
H5Fopen
,
hid_t
,
(
const
char
*
filename
,
unsigned
flags
,
hid_t
access_plist
));
DARSHAN_FORWARD_DECL
(
H5Fclose
,
herr_t
,
(
hid_t
file_id
));
static
struct
darshan_file_runtime
*
darshan_file_by_hid
(
int
hid
);
static
void
darshan_file_close_hid
(
int
hid
);
static
struct
darshan_file_runtime
*
darshan_file_by_name_sethid
(
const
char
*
name
,
int
hid
);
hid_t
DARSHAN_DECL
(
H5Fcreate
)(
const
char
*
filename
,
unsigned
flags
,
hid_t
create_plist
,
hid_t
access_plist
)
{
int
ret
;
struct
darshan_file_runtime
*
file
;
char
*
tmp
;
double
tm1
;
MAP_OR_FAIL
(
H5Fcreate
);
tm1
=
darshan_wtime
();
ret
=
__real_H5Fcreate
(
filename
,
flags
,
create_plist
,
access_plist
);
if
(
ret
>=
0
)
{
CP_LOCK
();
/* use ROMIO approach to strip prefix if present */
/* strip off prefix if there is one, but only skip prefixes
* if they are greater than length one to allow for windows
* drive specifications (e.g. c:\...)
*/
tmp
=
strchr
(
filename
,
':'
);
if
(
tmp
>
filename
+
1
)
{
filename
=
tmp
+
1
;
}
file
=
darshan_file_by_name_sethid
(
filename
,
ret
);
if
(
file
)
{
if
(
CP_F_VALUE
(
file
,
CP_F_OPEN_TIMESTAMP
)
==
0
)
CP_F_SET
(
file
,
CP_F_OPEN_TIMESTAMP
,
tm1
);
CP_INC
(
file
,
CP_HDF5_OPENS
,
1
);
}
CP_UNLOCK
();
}
return
(
ret
);
}
hid_t
DARSHAN_DECL
(
H5Fopen
)(
const
char
*
filename
,
unsigned
flags
,
hid_t
access_plist
)
{
int
ret
;
struct
darshan_file_runtime
*
file
;
char
*
tmp
;
double
tm1
;
MAP_OR_FAIL
(
H5Fopen
);
tm1
=
darshan_wtime
();
ret
=
__real_H5Fopen
(
filename
,
flags
,
access_plist
);
if
(
ret
>=
0
)
{
CP_LOCK
();
/* use ROMIO approach to strip prefix if present */
/* strip off prefix if there is one, but only skip prefixes
* if they are greater than length one to allow for windows
* drive specifications (e.g. c:\...)
*/
tmp
=
strchr
(
filename
,
':'
);
if
(
tmp
>
filename
+
1
)
{
filename
=
tmp
+
1
;
}
file
=
darshan_file_by_name_sethid
(
filename
,
ret
);
if
(
file
)
{
if
(
CP_F_VALUE
(
file
,
CP_F_OPEN_TIMESTAMP
)
==
0
)
CP_F_SET
(
file
,
CP_F_OPEN_TIMESTAMP
,
tm1
);
CP_INC
(
file
,
CP_HDF5_OPENS
,
1
);
}
CP_UNLOCK
();
}
return
(
ret
);
}
herr_t
DARSHAN_DECL
(
H5Fclose
)(
hid_t
file_id
)
{
struct
darshan_file_runtime
*
file
;
int
ret
;
MAP_OR_FAIL
(
H5Fclose
);
ret
=
__real_H5Fclose
(
file_id
);
CP_LOCK
();
file
=
darshan_file_by_hid
(
file_id
);
if
(
file
)
{
CP_F_SET
(
file
,
CP_F_CLOSE_TIMESTAMP
,
PMPI_Wtime
());
darshan_file_close_hid
(
file_id
);
}
CP_UNLOCK
();
return
(
ret
);
}
static
struct
darshan_file_runtime
*
darshan_file_by_name_sethid
(
const
char
*
name
,
int
hid
)
{
struct
darshan_file_runtime
*
tmp_file
;
tmp_file
=
darshan_file_by_name_sethandle
(
name
,
&
hid
,
sizeof
(
hid
),
DARSHAN_HID
);
return
(
tmp_file
);
}
static
void
darshan_file_close_hid
(
int
hid
)
{
darshan_file_closehandle
(
&
hid
,
sizeof
(
hid
),
DARSHAN_HID
);
return
;
}
static
struct
darshan_file_runtime
*
darshan_file_by_hid
(
int
hid
)
{
struct
darshan_file_runtime
*
tmp_file
;
tmp_file
=
darshan_file_by_handle
(
&
hid
,
sizeof
(
hid
),
DARSHAN_HID
);
return
(
tmp_file
);
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
*/
darshan-runtime/lib/darshan-mpi-init-finalize.c
deleted
100644 → 0
View file @
601e5ef7
/*
* (C) 2012 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
/* for RTLD_NEXT */
#include
"darshan-runtime-config.h"
#include
<stdlib.h>
#include
<stdio.h>
#include
"mpi.h"
#include
"darshan.h"
#include
"darshan-dynamic.h"
#ifdef DARSHAN_PRELOAD
#include
<dlfcn.h>
#define DARSHAN_FORWARD_DECL(name,ret,args) \
ret (*__real_ ## name)args = NULL;
#define MAP_OR_FAIL(func) \
__real_ ## func = dlsym(RTLD_NEXT, #func); \
if (!(__real_ ## func)) { \
fprintf(stderr, "Darshan failed to map symbol: %s\n", #func); \
}
DARSHAN_FORWARD_DECL
(
PMPI_File_close
,
int
,
(
MPI_File
*
fh
));
DARSHAN_FORWARD_DECL
(
PMPI_File_set_size
,
int
,
(
MPI_File
fh
,
MPI_Offset
size
));
DARSHAN_FORWARD_DECL
(
PMPI_File_iread_at
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
__D_MPI_REQUEST
*
request
));
DARSHAN_FORWARD_DECL
(
PMPI_File_iread
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
__D_MPI_REQUEST
*
request
));
DARSHAN_FORWARD_DECL
(
PMPI_File_iread_shared
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
__D_MPI_REQUEST
*
request
));
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_iwrite_at
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
__D_MPI_REQUEST
*
request
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_iwrite_at
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
__D_MPI_REQUEST
*
request
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_iwrite
,
int
,
(
MPI_File
fh
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
__D_MPI_REQUEST
*
request
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_iwrite
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
__D_MPI_REQUEST
*
request
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_iwrite_shared
,
int
,
(
MPI_File
fh
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
__D_MPI_REQUEST
*
request
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_iwrite_shared
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
__D_MPI_REQUEST
*
request
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_open
,
int
,
(
MPI_Comm
comm
,
const
char
*
filename
,
int
amode
,
MPI_Info
info
,
MPI_File
*
fh
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_open
,
int
,
(
MPI_Comm
comm
,
char
*
filename
,
int
amode
,
MPI_Info
info
,
MPI_File
*
fh
));
#endif
DARSHAN_FORWARD_DECL
(
PMPI_File_read_all_begin
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
));
DARSHAN_FORWARD_DECL
(
PMPI_File_read_all
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
DARSHAN_FORWARD_DECL
(
PMPI_File_read_at_all
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
DARSHAN_FORWARD_DECL
(
PMPI_File_read_at_all_begin
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
));
DARSHAN_FORWARD_DECL
(
PMPI_File_read_at
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
DARSHAN_FORWARD_DECL
(
PMPI_File_read
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
DARSHAN_FORWARD_DECL
(
PMPI_File_read_ordered_begin
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
));
DARSHAN_FORWARD_DECL
(
PMPI_File_read_ordered
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
DARSHAN_FORWARD_DECL
(
PMPI_File_read_shared
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_set_view
,
int
,
(
MPI_File
fh
,
MPI_Offset
disp
,
MPI_Datatype
etype
,
MPI_Datatype
filetype
,
const
char
*
datarep
,
MPI_Info
info
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_set_view
,
int
,
(
MPI_File
fh
,
MPI_Offset
disp
,
MPI_Datatype
etype
,
MPI_Datatype
filetype
,
char
*
datarep
,
MPI_Info
info
));
#endif
DARSHAN_FORWARD_DECL
(
PMPI_File_sync
,
int
,
(
MPI_File
fh
));
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_write_all_begin
,
int
,
(
MPI_File
fh
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_write_all_begin
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_write_all
,
int
,
(
MPI_File
fh
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_write_all
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_write_at_all_begin
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_write_at_all_begin
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_write_at_all
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_write_at_all
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_write_at
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_write_at
,
int
,
(
MPI_File
fh
,
MPI_Offset
offset
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_write
,
int
,
(
MPI_File
fh
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_write
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_write_ordered_begin
,
int
,
(
MPI_File
fh
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_write_ordered_begin
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_write_ordered
,
int
,
(
MPI_File
fh
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_write_ordered
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#endif
#ifdef HAVE_MPIIO_CONST
DARSHAN_FORWARD_DECL
(
PMPI_File_write_shared
,
int
,
(
MPI_File
fh
,
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#else
DARSHAN_FORWARD_DECL
(
PMPI_File_write_shared
,
int
,
(
MPI_File
fh
,
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Status
*
status
));
#endif
DARSHAN_FORWARD_DECL
(
PMPI_Finalize
,
int
,
());
DARSHAN_FORWARD_DECL
(
PMPI_Init
,
int
,
(
int
*
argc
,
char
***
argv
));
DARSHAN_FORWARD_DECL
(
PMPI_Init_thread
,
int
,
(
int
*
argc
,
char
***
argv
,
int
required
,
int
*
provided
));
DARSHAN_FORWARD_DECL
(
PMPI_Wtime
,
double
,
());
DARSHAN_FORWARD_DECL
(
PMPI_Allreduce
,
int
,
(
void
*
sendbuf
,
void
*
recvbuf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Op
op
,
MPI_Comm
comm
));
DARSHAN_FORWARD_DECL
(
PMPI_Bcast
,
int
,
(
void
*
buffer
,
int
count
,
MPI_Datatype
datatype
,
int
root
,
MPI_Comm
comm
));
DARSHAN_FORWARD_DECL
(
PMPI_Comm_rank
,
int
,
(
MPI_Comm
comm
,
int
*
rank
));
DARSHAN_FORWARD_DECL
(
PMPI_Comm_size
,
int
,
(
MPI_Comm
comm
,
int
*
size
));
DARSHAN_FORWARD_DECL
(
PMPI_Scan
,
int
,
(
void
*
sendbuf
,
void
*
recvbuf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Op
op
,
MPI_Comm
comm
));
DARSHAN_FORWARD_DECL
(
PMPI_Type_commit
,
int
,
(
MPI_Datatype
*
datatype
));
DARSHAN_FORWARD_DECL
(
PMPI_Type_contiguous
,
int
,
(
int
count
,
MPI_Datatype
oldtype
,
MPI_Datatype
*
newtype
));
DARSHAN_FORWARD_DECL
(
PMPI_Type_extent
,
int
,
(
MPI_Datatype
datatype
,
MPI_Aint
*
extent
));
DARSHAN_FORWARD_DECL
(
PMPI_Type_free
,
int
,
(
MPI_Datatype
*
datatype
));
DARSHAN_FORWARD_DECL
(
PMPI_Type_hindexed
,
int
,
(
int
count
,
int
*
array_of_blocklengths
,
MPI_Aint
*
array_of_displacements
,
MPI_Datatype
oldtype
,
MPI_Datatype
*
newtype
));
DARSHAN_FORWARD_DECL
(
PMPI_Op_create
,
int
,
(
MPI_User_function
*
function
,
int
commute
,
MPI_Op
*
op
));
DARSHAN_FORWARD_DECL
(
PMPI_Op_free
,
int
,
(
MPI_Op
*
op
));
DARSHAN_FORWARD_DECL
(
PMPI_Reduce
,
int
,
(
void
*
sendbuf
,
void
*
recvbuf
,
int
count
,
MPI_Datatype
datatype
,
MPI_Op
op
,
int
root
,
MPI_Comm
comm
));
DARSHAN_FORWARD_DECL
(
PMPI_Type_get_envelope
,
int
,
(
MPI_Datatype
datatype
,
int
*
num_integers
,
int
*
num_addresses
,
int
*
num_datatypes
,
int
*
combiner
));
DARSHAN_FORWARD_DECL
(
PMPI_Type_size
,
int
,
(
MPI_Datatype
datatype
,
int
*
size
));
void
resolve_mpi_symbols
(
void
)
{
/*
* Overloaded functions
*/
MAP_OR_FAIL
(
PMPI_File_close
);
MAP_OR_FAIL
(
PMPI_File_set_size
);
MAP_OR_FAIL
(
PMPI_File_iread_at
);
MAP_OR_FAIL
(
PMPI_File_iread
);
MAP_OR_FAIL
(
PMPI_File_iread_shared
);
MAP_OR_FAIL
(
PMPI_File_iwrite_at
);
MAP_OR_FAIL
(
PMPI_File_iwrite
);
MAP_OR_FAIL
(
PMPI_File_iwrite_shared
);
MAP_OR_FAIL
(
PMPI_File_open
);
MAP_OR_FAIL
(
PMPI_File_read_all_begin
);
MAP_OR_FAIL
(
PMPI_File_read_all
);
MAP_OR_FAIL
(
PMPI_File_read_at_all_begin
);
MAP_OR_FAIL
(
PMPI_File_read_at_all
);
MAP_OR_FAIL
(
PMPI_File_read_at
);
MAP_OR_FAIL
(
PMPI_File_read
);
MAP_OR_FAIL
(
PMPI_File_read_ordered_begin
);
MAP_OR_FAIL
(
PMPI_File_read_ordered
);
MAP_OR_FAIL
(
PMPI_File_read_shared
);
MAP_OR_FAIL
(
PMPI_File_set_view
);
MAP_OR_FAIL
(
PMPI_File_sync
);
MAP_OR_FAIL
(
PMPI_File_write_all_begin
);
MAP_OR_FAIL
(
PMPI_File_write_all
);
MAP_OR_FAIL
(
PMPI_File_write_at_all_begin
);
MAP_OR_FAIL
(
PMPI_File_write_at_all
);
MAP_OR_FAIL
(
PMPI_File_write_at
);
MAP_OR_FAIL
(
PMPI_File_write
);
MAP_OR_FAIL
(
PMPI_File_write_ordered_begin
);
MAP_OR_FAIL
(
PMPI_File_write_ordered
);
MAP_OR_FAIL
(
PMPI_File_write_shared
);
MAP_OR_FAIL
(
PMPI_Finalize
);
MAP_OR_FAIL
(
PMPI_Init
);
MAP_OR_FAIL
(
PMPI_Init_thread
);
/*
* These function are not intercepted but are used
* by darshan itself.
*/
MAP_OR_FAIL
(
PMPI_Wtime
);
MAP_OR_FAIL
(
PMPI_Allreduce
);
MAP_OR_FAIL
(
PMPI_Bcast
);
MAP_OR_FAIL
(
PMPI_Comm_rank
);
MAP_OR_FAIL
(
PMPI_Comm_size
);
MAP_OR_FAIL
(
PMPI_Scan
);
MAP_OR_FAIL
(
PMPI_Type_commit
);
MAP_OR_FAIL
(
PMPI_Type_contiguous
);
MAP_OR_FAIL
(
PMPI_Type_extent
);
MAP_OR_FAIL
(
PMPI_Type_free
);
MAP_OR_FAIL
(
PMPI_Type_size
);
MAP_OR_FAIL
(
PMPI_Type_hindexed
);
MAP_OR_FAIL
(
PMPI_Op_create
);
MAP_OR_FAIL
(
PMPI_Op_free
);
MAP_OR_FAIL
(
PMPI_Reduce
);
MAP_OR_FAIL
(
PMPI_Type_get_envelope
);
return
;
}
#endif
int
MPI_Init
(
int
*
argc
,
char
***
argv
)
{
int
ret
;