Commit 6dc3d526 authored by fisaila's avatar fisaila
Browse files

Added functionality for counters about the datatypes in memory and in file....

Added functionality for counters about the datatypes in memory and in file. Thus works only when an epoch is one MPI-IO operation. 
Epoches can be enabled desabled though the DARSHAN_EPOCH environment variable. 
Corrected a bug which prevented internal timing to work with epoches. 



git-svn-id: https://svn.mcs.anl.gov/repos/darshan/branches/darshan-florin-extensions-addcounters-datatypes@835 3b7491f3-a168-0410-bf4b-c445ed680a29
parent a2300617
......@@ -33,10 +33,10 @@ LIBS = -lz @LIBBZ2@
lib::
@mkdir -p $@
lib/darshan-mpi-io.o: lib/darshan-mpi-io.c darshan.h darshan-dynamic.h $(DARSHAN_LOG_FORMAT) | lib
lib/darshan-mpi-io.o: lib/darshan-mpi-io.c lib/darshan-mpi-datatypes.c darshan.h darshan-dynamic.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-mpi-io.po: lib/darshan-mpi-io.c darshan.h darshan-dynamic.h $(DARSHAN_LOG_FORMAT) | lib
lib/darshan-mpi-io.po: lib/darshan-mpi-io.c lib/darshan-mpi-datatypes.c darshan.h darshan-dynamic.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/darshan-mpi-init-finalize.o: lib/darshan-mpi-init-finalize.c darshan.h darshan-dynamic.h $(DARSHAN_LOG_FORMAT) | lib
......@@ -45,6 +45,12 @@ lib/darshan-mpi-init-finalize.o: lib/darshan-mpi-init-finalize.c darshan.h darsh
lib/darshan-mpi-init-finalize.po: lib/darshan-mpi-init-finalize.c darshan.h darshan-dynamic.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/darshan-mpi-datatypes.o: lib/darshan-mpi-datatypes.c darshan.h darshan-dynamic.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-mpi-datatypes.po: lib/darshan-mpi-datatypes.c darshan.h darshan-dynamic.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/darshan-pnetcdf.o: lib/darshan-pnetcdf.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS) -c $< -o $@
......@@ -78,13 +84,13 @@ lib/lookup8.po: lib/lookup8.c
%.i: %.c
$(CC) -E $(CFLAGS) -c $< -o $@
lib/libdarshan-mpi-io.a: lib/darshan-mpi-io.o lib/darshan-mpi-init-finalize.o lib/darshan-pnetcdf.o lib/darshan-hdf5.o
lib/libdarshan-mpi-io.a: lib/darshan-mpi-io.o lib/darshan-mpi-init-finalize.o lib/darshan-pnetcdf.o lib/darshan-hdf5.o lib/darshan-mpi-datatypes.o
ar rcs $@ $^
lib/libdarshan-posix.a: lib/darshan-posix.o lib/lookup3.o lib/lookup8.o
ar rcs $@ $^
lib/libdarshan.so: lib/darshan-mpi-io.po lib/darshan-mpi-init-finalize.po lib/darshan-pnetcdf.po lib/darshan-hdf5.po lib/darshan-posix.po lib/lookup3.po lib/lookup8.po
lib/libdarshan.so: lib/darshan-mpi-io.po lib/darshan-mpi-init-finalize.po lib/darshan-pnetcdf.po lib/darshan-hdf5.po lib/darshan-posix.po lib/lookup3.po lib/lookup8.po lib/darshan-mpi-datatypes.po
$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -ldl -o $@ $^ -lpthread -lrt -lz
install:: all
......
......@@ -25,7 +25,7 @@
#define CP_MEM_ALIGNMENT_OVERRIDE "DARSHAN_MEMALIGN"
/* maximum number of files per process we will track */
#define CP_MAX_FILES 1024
#define CP_MAX_FILES 10 //Intial default 1024
/* TODO: figure out how to pick good value here */
/* hash table size parameters */
......
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2001 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
//#include "mpi.h"
#include "adio.h"
#include "adio_extern.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
ADIOI_Flatlist_node * get_flatlist(MPI_Datatype dt){
int is_contig;
ADIOI_Datatype_iscontig(dt,&is_contig);
if (is_contig)
return NULL;
else {
ADIOI_Flatlist_node *flat_buf;
ADIOI_Flatten_datatype(dt);
flat_buf = ADIOI_Flatlist;
while ((flat_buf)&&(flat_buf->type != dt)) flat_buf = flat_buf->next;
if (flat_buf) {
if (flat_buf->incr_size[0] == -1) {
int i;
flat_buf->incr_size[0] = 0;
for (i=1;i<flat_buf->count;i++)
flat_buf->incr_size[i] = flat_buf->incr_size[i-1] + flat_buf->blocklens[i-1];
}
}
return flat_buf;
}
}
void print_flatlist(MPI_Datatype dt) {
int b_index;
ADIOI_Flatlist_node *flat_buf;
flat_buf = get_flatlist(dt);
if (flat_buf)
for (b_index=0; b_index < flat_buf->count; b_index++) {
printf ("%3d-th: offset=%8lld len=%8lld \n",b_index, flat_buf->indices[b_index],flat_buf->blocklens[b_index]);
}
else
printf ("NULL flat_buf\n");
}
void print_flatlist2(ADIOI_Flatlist_node *flat_buf) {
int b_index;
if (flat_buf)
for (b_index=0; b_index < flat_buf->count; b_index++) {
printf ("%3d-th: offset=%8lld len=%8lld \n",b_index, flat_buf->indices[b_index],flat_buf->blocklens[b_index]);
}
else
printf ("NULL flat_buf\n");
}
#define LEFT 0
#define RIGHT 1
// assumes : x > 0
// result: between 0 and flat_buf->count inclusively
// returns the index of the flat_buf where x is located
// LEFT
// ____***____***____****--
// 000000011111112222222233
// RIGHT
// 000011111112222222333333
int find_bin_search(MPI_Offset x, MPI_Datatype datatype, int leftright){
ADIOI_Flatlist_node *flat_buf = get_flatlist(datatype);
if (!flat_buf) return 0;
int l = 0 ,r = flat_buf->count - 1 ,found = -1;
while (l <= r) {
int m = (l + r) / 2;
if (x < flat_buf->indices[m] - flat_buf->indices[0] + flat_buf->blocklens[m]) {
if (l == m) {
found = m;
break;
}
if (x >= flat_buf->indices[m - 1] - flat_buf->indices[0] + flat_buf->blocklens[m - 1]) {
found = m;
break;
}
r = m - 1 ;
}
else {
if (m == r) {
found = m +1;
//found = m;
break;
}
if (x < flat_buf->indices[m + 1] - flat_buf->indices[0]) {
found = m + 1;
//found = m;
break;
}
l = m +1;
}
}
// return found - ((flat_buf->blocklens[0] == 0)?1:0);
if ((leftright == RIGHT)
&& (found < flat_buf->count)
&& (x < flat_buf->indices[found] - flat_buf->indices[0] + flat_buf->blocklens[found])
&& (x >= flat_buf->indices[found] - flat_buf->indices[0])) found++;
return found;
}
// Finds the file offset within the extent range
// assumes : x > 0
int find_size_bin_search(MPI_Offset x, ADIOI_Flatlist_node *flat_buf){
int l = 0 ,r = flat_buf->count - 1 ,size = -1;
while (l <= r) {
int m = (l + r) / 2;
//printf("\n*** l=%d r=%d\n",l,r);
if (x < flat_buf->incr_size[m] + flat_buf->blocklens[m]) {
if (l == m) {
size = flat_buf->indices[m] + x - flat_buf->incr_size[m];
break;
}
if (x >= flat_buf->incr_size[m]) {
size = flat_buf->indices[m] + x - flat_buf->incr_size[m];
break;
}
r = m - 1 ;
}
else {
// ???
if (m == r) {
size = flat_buf->indices[m] + x - flat_buf->incr_size[m];
break;
}
if (x < flat_buf->incr_size[m + 1] + flat_buf->blocklens[m + 1]) {
size = flat_buf->indices[m + 1] + x - flat_buf->incr_size[m + 1];
break;
}
l = m +1;
}
}
return size;
}
void free_datatype(MPI_Datatype type) {
int ni, na, nd, combiner;
MPI_Type_get_envelope(type, &ni, &na, &nd, &combiner);
if (combiner != MPI_COMBINER_NAMED)
MPI_Type_free(&type);
}
/*int my_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype){
ADIO_File adio_fh = MPIO_File_resolve(fh);
*disp = adio_fh->disp;
*etype = adio_fh->etype;
*filetype = adio_fh->filetype;
return MPI_SUCCESS;
}
*/
MPI_Offset func_1_per( MPI_Offset x, ADIOI_Flatlist_node *flat_buf){
return find_size_bin_search(x, flat_buf) - flat_buf->indices[0];
}
/* Maps a view offset on a file offset */
MPI_Offset func_1(MPI_File fh, MPI_Offset x){
int is_contig, etype_size;
MPI_Offset disp_plus_lb, ret;
MPI_Datatype etype, filetype;
char datarep[MPI_MAX_DATAREP_STRING];
MPI_Aint lb, extent;
MPI_File_get_view(fh, &disp_plus_lb, &etype, &filetype, datarep);
//my_get_view(fh, &disp_plus_lb, &etype, &filetype);
MPI_Type_get_extent(filetype, &lb, &extent);
MPI_Type_size(etype, &etype_size);
x = x * etype_size;
disp_plus_lb += lb;
ADIOI_Datatype_iscontig(filetype, &is_contig);
if (is_contig)
ret = x + disp_plus_lb;
else {
int sz;
MPI_Type_size(filetype, &sz);
ret = disp_plus_lb + x / sz * extent + func_1_per(x % sz, get_flatlist(filetype));
}
free_datatype(etype);
free_datatype(filetype);
return ret;
}
/* Maps a view offset on a file offset:
trasforms first etype -> bytes
and then moves on the previous byte */
MPI_Offset func_1_inf(MPI_File fh, MPI_Offset x, int memtype_size){
int is_contig, etype_size;
MPI_Offset disp_plus_lb, ret;
MPI_Datatype etype, filetype;
char datarep[MPI_MAX_DATAREP_STRING];
MPI_Aint lb, extent;
MPI_File_get_view(fh, &disp_plus_lb, &etype, &filetype, datarep);
//my_get_view(fh, &disp_plus_lb, &etype, &filetype);
MPI_Type_get_extent(filetype, &lb, &extent);
MPI_Type_size(etype, &etype_size);
x = x * etype_size + memtype_size - 1;
disp_plus_lb += lb;
ADIOI_Datatype_iscontig(filetype, &is_contig);
if (is_contig)
ret = x + disp_plus_lb;
else {
int sz;
MPI_Type_size(filetype, &sz);
ret = disp_plus_lb + x / sz * extent + func_1_per(x % sz, get_flatlist(filetype));
}
free_datatype(etype);
free_datatype(filetype);
return ret;
}
/* This version compacts the neighboring contiguous blocks */
int count_contiguous_blocks_memory(MPI_Datatype datatype, int count) {
ADIOI_Flatlist_node *flat_buf;
flat_buf = get_flatlist(datatype);
return (flat_buf)?(flat_buf->count*count):1;
}
#define BEGIN_BLOCK(x,block_size) (((x)/(block_size))*(block_size))
#define END_BLOCK(x,block_size) (((x)/(block_size)+1)*(block_size)-1)
#define BEGIN_NEXT_BLOCK(x,block_size) (((x)/(block_size)+1)*(block_size))
int count_contiguous_blocks_file(MPI_File fh, MPI_Offset foff1, MPI_Offset foff2) {
MPI_Offset disp;
MPI_Datatype etype, filetype;
char datarep[MPI_MAX_DATAREP_STRING];
int is_contig;
int ret;
assert(foff1 <= foff2);
MPI_File_get_view(fh, &disp, &etype, &filetype, datarep);
//my_get_view(fh, &disp, &etype, &filetype);
ADIOI_Datatype_iscontig(filetype, &is_contig);
if (is_contig)
ret=1;
else {
MPI_Aint extent, lb;
ADIOI_Flatlist_node *flat_buf;
flat_buf = get_flatlist(filetype);
MPI_Type_get_extent(filetype, &lb, &extent);
assert(disp+lb <= foff1);
assert(lb == flat_buf->indices[0]);
if (foff2 < ((flat_buf->blocklens[0] == 0)?flat_buf->indices[1]:flat_buf->indices[0]))
ret=0;
else{
int ind1, ind2;
ind1 = find_bin_search((foff1 - disp - lb) % extent, filetype, LEFT);
ind2 = find_bin_search((foff2 - disp - lb) % extent, filetype, RIGHT);
if ((foff2 - disp - lb) < BEGIN_NEXT_BLOCK(foff1 - disp - lb, extent))
ret = ind2 - ind1;
else
ret = flat_buf->count - ind1 - ((flat_buf->blocklens[flat_buf->count-1] == 0)?1:0)+
(BEGIN_BLOCK(foff2 - disp - lb, extent)-
BEGIN_NEXT_BLOCK(foff1 - disp - lb, extent))
/ extent * (flat_buf->count-
((flat_buf->blocklens[0] == 0)?1:0) -
((flat_buf->blocklens[flat_buf->count-1] == 0)?1:0)-
(((flat_buf->blocklens[flat_buf->count-1])&&(flat_buf->blocklens[flat_buf->count-1] + flat_buf->indices[flat_buf->count-1] - flat_buf->indices[0] == extent ))?1:0))
+ ind2 - (((ind2>0)&&(flat_buf->blocklens[0] == 0))?1:0) -
(((ind2>0)&&(flat_buf->indices[0]==0))?1:0);
}
}
free_datatype(etype);
free_datatype(filetype);
return ret;
}
......@@ -140,10 +140,17 @@ extern char* __progname;
} \
} while(0)
#define CP_RECORD_MPI_WRITE(__ret, __fh, __count, __datatype, __counter, __tm1, __tm2) do { \
int count_contiguous_blocks_memory(MPI_Datatype datatype, int count);
int count_contiguous_blocks_file(MPI_File fh, MPI_Offset foff1, MPI_Offset foff2);
MPI_Offset func_1_inf(MPI_File fh, MPI_Offset x, int memtype_size);
MPI_Offset func_1(MPI_File fh, MPI_Offset x);
/*
#define CP_RECORD_MPI_WRITE(__ret, __fh, __count, __datatype, __counter, __tm1, __tm2, __voff) do { \
struct darshan_file_runtime* file; \
int size = 0; \
MPI_Aint extent = 0; \
MPI_Offset foff1, foff2; \
if(__ret != MPI_SUCCESS) break; \
file = darshan_file_by_fh(__fh); \
if(!file) break; \
......@@ -158,7 +165,68 @@ extern char* __progname;
if(CP_F_VALUE(file, CP_F_WRITE_START_TIMESTAMP) == 0) \
CP_F_SET(file, CP_F_WRITE_START_TIMESTAMP, __tm1); \
CP_F_SET(file, CP_F_WRITE_END_TIMESTAMP, __tm2); \
CP_SET(file, CP_AVG_MEM_DTYPE_SIZE, size); \
CP_SET(file, CP_AVG_MEM_DTYPE_EXTENT, extent * __count); \
CP_SET(file, CP_AVG_MEM_DTYPE_BLOCKS, count_contiguous_blocks_memory(__datatype, __count)); \
MPI_File_get_byte_offset(__fh, __voff, &foff1); \
MPI_File_get_byte_offset(__fh, __voff + size, &foff2); \
CP_SET(file, CP_MIN_FILE_OFFSET, foff1); \
CP_SET(file, CP_MAX_FILE_OFFSET, foff2); \
CP_SET(file, CP_AVG_FILE_DTYPE_EXTENT, foff2 -foff1); \
CP_SET(file, CP_AVG_FILE_DTYPE_BLOCKS, count_contiguous_blocks_file(fh, foff1, foff2 )); \
} while(0)
*/
static struct darshan_file_runtime* darshan_file_by_fh(MPI_File fh);
void CP_RECORD_MPI_WRITE(int __ret, MPI_File __fh, int __count, MPI_Datatype __datatype,
int64_t __counter, double __tm1, double __tm2, MPI_Offset __voff) {
struct darshan_file_runtime* file;
int size = 0;
MPI_Aint extent = 0;
MPI_Offset foff1, foff2;
int mem_blocks, file_blocks; //
if(__ret != MPI_SUCCESS) return;
file = darshan_file_by_fh(__fh);
if(!file) return;
DARSHAN_MPI_CALL(PMPI_Type_size)(__datatype, &size);
size = size * __count;
DARSHAN_MPI_CALL(PMPI_Type_extent)(__datatype, &extent);
CP_BUCKET_INC(file, CP_SIZE_WRITE_AGG_0_100, size);
CP_BUCKET_INC(file, CP_EXTENT_WRITE_0_100, extent);
CP_INC(file, __counter, 1);
CP_DATATYPE_INC(file, __datatype);
CP_F_INC_NO_OVERLAP(file, __tm1, __tm2, file->last_mpi_write_end, CP_F_MPI_WRITE_TIME);
if(CP_F_VALUE(file, CP_F_WRITE_START_TIMESTAMP) == 0)
CP_F_SET(file, CP_F_WRITE_START_TIMESTAMP, __tm1);
CP_F_SET(file, CP_F_WRITE_END_TIMESTAMP, __tm2);
CP_SET(file, CP_AVG_MEM_DTYPE_SIZE, size);
CP_SET(file, CP_AVG_MEM_DTYPE_EXTENT, extent * __count);
mem_blocks = count_contiguous_blocks_memory(__datatype, __count); //
CP_SET(file, CP_AVG_MEM_DTYPE_BLOCKS, mem_blocks); //
CP_SET(file, CP_MAX_MEM_DTYPE_SIZE, size); //
CP_SET(file, CP_MAX_MEM_DTYPE_EXTENT, extent); //
CP_SET(file, CP_MAX_MEM_DTYPE_BLOCKS, mem_blocks); //
CP_SET(file, CP_MIN_MEM_DTYPE_SIZE, size); //
CP_SET(file, CP_MIN_MEM_DTYPE_EXTENT, extent); //
CP_SET(file, CP_MIN_MEM_DTYPE_BLOCKS, mem_blocks); //
//MPI_File_get_byte_offset(__fh, __voff, &foff1);
//MPI_File_get_byte_offset(__fh, __voff + __count, &foff2);
foff1 = func_1(__fh, __voff); //
foff2 = func_1_inf(__fh, __voff, size); //
// printf("foff1 = %lld foff1_func_1 = %lld foff2 = %lld foff2_func_1_inf = %lld __voff =%lld __count=%d\n",
// foff1, func_1(__fh, __voff), foff2, func_1_inf(__fh, __voff, size), __voff, __count);
file_blocks = count_contiguous_blocks_file(__fh, foff1, foff2 );
CP_SET(file, CP_MIN_FILE_OFFSET, foff1);
CP_SET(file, CP_MAX_FILE_OFFSET, foff2);
CP_SET(file, CP_AVG_FILE_DTYPE_EXTENT, foff2 - foff1 + 1);
CP_SET(file, CP_AVG_FILE_DTYPE_BLOCKS, file_blocks);
CP_SET(file, CP_MAX_FILE_DTYPE_EXTENT, foff2 - foff1 + 1); //
CP_SET(file, CP_MAX_FILE_DTYPE_BLOCKS, file_blocks); //
CP_SET(file, CP_MIN_FILE_DTYPE_EXTENT, foff2 - foff1 + 1); //
CP_SET(file, CP_MIN_FILE_DTYPE_BLOCKS, file_blocks); //
}
#define CP_RECORD_MPI_READ(__ret, __fh, __count, __datatype, __counter, __tm1, __tm2) do { \
struct darshan_file_runtime* file; \
......@@ -204,7 +272,7 @@ static void pairwise_variance_reduce (
static void debug_mounts(const char* mtab_file, const char* out_file);
#endif
static struct darshan_file_runtime* darshan_file_by_fh(MPI_File fh);
//static struct darshan_file_runtime* darshan_file_by_fh(MPI_File fh);
static void darshan_file_close_fh(MPI_File fh);
static struct darshan_file_runtime* darshan_file_by_name_setfh(const char* name, MPI_File fh);
......@@ -1050,6 +1118,8 @@ int MPI_File_iread_shared(MPI_File fh, void * buf, int count,
return(ret);
}
#ifdef HAVE_MPIIO_CONST
int MPI_File_write(MPI_File fh, const void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
......@@ -1060,13 +1130,15 @@ int MPI_File_write(MPI_File fh, void *buf, int count,
{
int ret;
double tm1, tm2;
MPI_Offset off;
crt_fh = &fh;
tm1 = darshan_wtime();
MPI_File_get_position(fh, &off);
ret = DARSHAN_MPI_CALL(PMPI_File_write)(fh, buf, count, datatype, status);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_INDEP_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_INDEP_WRITES, tm1, tm2, off);
CP_UNLOCK();
crt_fh = NULL;
return(ret);
......@@ -1089,7 +1161,7 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
count, datatype, status);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_INDEP_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_INDEP_WRITES, tm1, tm2, offset);
CP_UNLOCK();
crt_fh = NULL;
return(ret);
......@@ -1114,10 +1186,9 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void * buf,
count, datatype, status);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_COLL_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_COLL_WRITES, tm1, tm2, offset);
CP_UNLOCK();
crt_fh = NULL;
darshan_end_epoch();
return(ret);
......@@ -1131,17 +1202,23 @@ int MPI_File_write_all(MPI_File fh, void * buf, int count, MPI_Datatype datatype
{
int ret;
double tm1, tm2;
MPI_Offset off;
darshan_start_epoch();
crt_fh = &fh;
tm1 = darshan_wtime();
MPI_File_get_position(fh, &off);
ret = DARSHAN_MPI_CALL(PMPI_File_write_all)(fh, buf, count,
datatype, status);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_COLL_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_COLL_WRITES, tm1, tm2, off);
CP_UNLOCK();
crt_fh = NULL;
darshan_end_epoch();
return(ret);
}
......@@ -1153,14 +1230,16 @@ int MPI_File_write_shared(MPI_File fh, void * buf, int count, MPI_Datatype datat
{
int ret;
double tm1, tm2;
MPI_Offset off;
crt_fh = &fh;
tm1 = darshan_wtime();
MPI_File_get_position(fh, &off);
ret = DARSHAN_MPI_CALL(PMPI_File_write_shared)(fh, buf, count,
datatype, status);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_INDEP_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_INDEP_WRITES, tm1, tm2, off);
CP_UNLOCK();
crt_fh = NULL;
return(ret);
......@@ -1176,14 +1255,16 @@ int MPI_File_write_ordered(MPI_File fh, void * buf, int count,
{
int ret;
double tm1, tm2;
MPI_Offset off;
crt_fh = &fh;
tm1 = darshan_wtime();
MPI_File_get_position(fh, &off);
ret = DARSHAN_MPI_CALL(PMPI_File_write_ordered)(fh, buf, count,
datatype, status);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_COLL_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_COLL_WRITES, tm1, tm2, off);
CP_UNLOCK();
crt_fh = NULL;
return(ret);
......@@ -1206,7 +1287,7 @@ int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void * buf,
buf, count, datatype);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_SPLIT_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_SPLIT_WRITES, tm1, tm2, offset);
CP_UNLOCK();
crt_fh = NULL;
return(ret);
......@@ -1220,13 +1301,15 @@ int MPI_File_write_all_begin(MPI_File fh, void * buf, int count, MPI_Datatype da
{
int ret;
double tm1, tm2;
MPI_Offset off;
crt_fh = &fh;
tm1 = darshan_wtime();
MPI_File_get_position(fh, &off);
ret = DARSHAN_MPI_CALL(PMPI_File_write_all_begin)(fh, buf, count, datatype);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_SPLIT_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_SPLIT_WRITES, tm1, tm2, off);
CP_UNLOCK();
crt_fh = NULL;
return(ret);
......@@ -1240,14 +1323,16 @@ int MPI_File_write_ordered_begin(MPI_File fh, void * buf, int count, MPI_Datatyp
{
int ret;
double tm1, tm2;
MPI_Offset off;
crt_fh = &fh;
tm1 = darshan_wtime();
MPI_File_get_position(fh, &off);
ret = DARSHAN_MPI_CALL(PMPI_File_write_ordered_begin)(fh, buf, count,
datatype);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_SPLIT_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_SPLIT_WRITES, tm1, tm2, off);
CP_UNLOCK();
crt_fh = NULL;
return(ret);
......@@ -1270,7 +1355,7 @@ int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void * buf,
count, datatype, request);
tm2 = darshan_wtime();
CP_LOCK();
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_NB_WRITES, tm1, tm2);
CP_RECORD_MPI_WRITE(ret, fh, count, datatype, CP_NB_WRITES, tm1, tm2, offset);
CP_UNLOCK();
crt_fh = NULL;
return(ret);
......@@ -1284,13 +1369,15 @@ int MPI_File_iwrite(MPI_File fh, void * buf, int count, MPI_Datatype datatype, _
{
int ret;
double tm1, tm2;
MPI_Offset off;
crt_fh = &fh;
tm1 = darshan_wtime();
MPI_File_get_position(fh, &off);
ret = DARSHAN_MPI_CALL(PMPI_File_iwrite)(fh, buf, count, datatype, request);