Commit 999ee9c8 authored by Shane Snyder's avatar Shane Snyder

darshan-util edits for var. length name records

parent d6dad7f3
...@@ -159,7 +159,7 @@ endif ...@@ -159,7 +159,7 @@ endif
clean:: clean::
rm -f *.o *.po *.a *.so darshan-analyzer darshan-convert darshan-parser darshan-merge jenkins-hash-gen rm -f *.o *.po *.a *.so darshan-analyzer darshan-convert darshan-diff darshan-parser darshan-merge jenkins-hash-gen
distclean:: clean distclean:: clean
rm -f darshan-runtime-config.h aclocal.m4 autom4te.cache/* config.status config.log Makefile util/bin/darshan-job-summary.pl rm -f darshan-runtime-config.h aclocal.m4 autom4te.cache/* config.status config.log Makefile util/bin/darshan-job-summary.pl
......
...@@ -52,10 +52,10 @@ int process_log(const char *fname, double *io_ratio, int *used_mpio, int *used_p ...@@ -52,10 +52,10 @@ int process_log(const char *fname, double *io_ratio, int *used_mpio, int *used_p
return -1; return -1;
} }
ret = darshan_log_getjob(file, &job); ret = darshan_log_get_job(file, &job);
if (ret < 0) if (ret < 0)
{ {
fprintf(stderr, "darshan_log_getjob() failed on file %s.\n", fname); fprintf(stderr, "darshan_log_get_job() failed on file %s.\n", fname);
darshan_log_close(file); darshan_log_close(file);
return -1; return -1;
} }
......
...@@ -55,7 +55,7 @@ static int darshan_log_get_bgq_rec(darshan_fd fd, void* bgq_buf) ...@@ -55,7 +55,7 @@ static int darshan_log_get_bgq_rec(darshan_fd fd, void* bgq_buf)
int i; int i;
int ret; int ret;
ret = darshan_log_getmod(fd, DARSHAN_BGQ_MOD, bgq_buf, ret = darshan_log_get_mod(fd, DARSHAN_BGQ_MOD, bgq_buf,
sizeof(struct darshan_bgq_record)); sizeof(struct darshan_bgq_record));
if(ret < 0) if(ret < 0)
return(-1); return(-1);
...@@ -84,7 +84,7 @@ static int darshan_log_put_bgq_rec(darshan_fd fd, void* bgq_buf, int ver) ...@@ -84,7 +84,7 @@ static int darshan_log_put_bgq_rec(darshan_fd fd, void* bgq_buf, int ver)
struct darshan_bgq_record *rec = (struct darshan_bgq_record *)bgq_buf; struct darshan_bgq_record *rec = (struct darshan_bgq_record *)bgq_buf;
int ret; int ret;
ret = darshan_log_putmod(fd, DARSHAN_BGQ_MOD, rec, ret = darshan_log_put_mod(fd, DARSHAN_BGQ_MOD, rec,
sizeof(struct darshan_bgq_record), ver); sizeof(struct darshan_bgq_record), ver);
if(ret < 0) if(ret < 0)
return(-1); return(-1);
......
...@@ -140,21 +140,25 @@ void obfuscate_exe(int key, char *exe) ...@@ -140,21 +140,25 @@ void obfuscate_exe(int key, char *exe)
return; return;
} }
void obfuscate_filenames(int key, struct darshan_record_ref *rec_hash) void obfuscate_filenames(int key, struct darshan_name_record_ref *name_hash)
{ {
struct darshan_record_ref *ref, *tmp; struct darshan_name_record_ref *ref, *tmp;
uint32_t hashed; uint32_t hashed;
char tmp_string[128] = {0}; char tmp_string[128] = {0};
darshan_record_id tmp_id;
HASH_ITER(hlink, rec_hash, ref, tmp) HASH_ITER(hlink, name_hash, ref, tmp)
{ {
hashed = darshan_hashlittle(ref->name, strlen(ref->name), key); tmp_id = ref->name_record->id;
hashed = darshan_hashlittle(ref->name_record->name,
strlen(ref->name_record->name), key);
sprintf(tmp_string, "%u", hashed); sprintf(tmp_string, "%u", hashed);
free(ref->name); free(ref->name_record);
ref->name = malloc(strlen(tmp_string) + 1); ref->name_record = malloc(sizeof(struct darshan_name_record) +
assert(ref->name); strlen(tmp_string));
memcpy(ref->name, tmp_string, strlen(tmp_string)); assert(ref->name_record);
ref->name[strlen(tmp_string)] = '\0'; ref->name_record->id = tmp_id;
strcpy(ref->name_record->name, tmp_string);
} }
return; return;
...@@ -202,16 +206,17 @@ void add_annotation (char *annotation, ...@@ -202,16 +206,17 @@ void add_annotation (char *annotation,
return; return;
} }
static void remove_hash_recs(struct darshan_record_ref **rec_hash, darshan_record_id hash) static void remove_hash_recs(struct darshan_name_record_ref **name_hash,
darshan_record_id hash)
{ {
struct darshan_record_ref *ref, *tmp; struct darshan_name_record_ref *ref, *tmp;
HASH_ITER(hlink, *rec_hash, ref, tmp) HASH_ITER(hlink, *name_hash, ref, tmp)
{ {
if(ref->id != hash) if(ref->name_record->id != hash)
{ {
HASH_DELETE(hlink, *rec_hash, ref); HASH_DELETE(hlink, *name_hash, ref);
free(ref->name); free(ref->name_record);
free(ref); free(ref);
} }
} }
...@@ -232,8 +237,8 @@ int main(int argc, char **argv) ...@@ -232,8 +237,8 @@ int main(int argc, char **argv)
int mount_count; int mount_count;
char** mnt_pts; char** mnt_pts;
char** fs_types; char** fs_types;
struct darshan_record_ref *rec_hash = NULL; struct darshan_name_record_ref *name_hash = NULL;
struct darshan_record_ref *ref, *tmp; struct darshan_name_record_ref *ref, *tmp;
char mod_buf[DEF_MOD_BUF_SIZE]; char mod_buf[DEF_MOD_BUF_SIZE];
enum darshan_comp_type comp_type; enum darshan_comp_type comp_type;
int bzip2; int bzip2;
...@@ -259,7 +264,7 @@ int main(int argc, char **argv) ...@@ -259,7 +264,7 @@ int main(int argc, char **argv)
} }
/* read job info */ /* read job info */
ret = darshan_log_getjob(infile, &job); ret = darshan_log_get_job(infile, &job);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(infile); darshan_log_close(infile);
...@@ -272,7 +277,7 @@ int main(int argc, char **argv) ...@@ -272,7 +277,7 @@ int main(int argc, char **argv)
if (obfuscate) obfuscate_job(key, &job); if (obfuscate) obfuscate_job(key, &job);
if (annotation) add_annotation(annotation, &job); if (annotation) add_annotation(annotation, &job);
ret = darshan_log_putjob(outfile, &job); ret = darshan_log_put_job(outfile, &job);
if (ret < 0) if (ret < 0)
{ {
darshan_log_close(infile); darshan_log_close(infile);
...@@ -280,7 +285,7 @@ int main(int argc, char **argv) ...@@ -280,7 +285,7 @@ int main(int argc, char **argv)
return(-1); return(-1);
} }
ret = darshan_log_getexe(infile, tmp_string); ret = darshan_log_get_exe(infile, tmp_string);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(infile); darshan_log_close(infile);
...@@ -291,7 +296,7 @@ int main(int argc, char **argv) ...@@ -291,7 +296,7 @@ int main(int argc, char **argv)
if (obfuscate) obfuscate_exe(key, tmp_string); if (obfuscate) obfuscate_exe(key, tmp_string);
ret = darshan_log_putexe(outfile, tmp_string); ret = darshan_log_put_exe(outfile, tmp_string);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(infile); darshan_log_close(infile);
...@@ -299,7 +304,7 @@ int main(int argc, char **argv) ...@@ -299,7 +304,7 @@ int main(int argc, char **argv)
return(-1); return(-1);
} }
ret = darshan_log_getmounts(infile, &mnt_pts, &fs_types, &mount_count); ret = darshan_log_get_mounts(infile, &mnt_pts, &fs_types, &mount_count);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(infile); darshan_log_close(infile);
...@@ -308,7 +313,7 @@ int main(int argc, char **argv) ...@@ -308,7 +313,7 @@ int main(int argc, char **argv)
return(-1); return(-1);
} }
ret = darshan_log_putmounts(outfile, mnt_pts, fs_types, mount_count); ret = darshan_log_put_mounts(outfile, mnt_pts, fs_types, mount_count);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(infile); darshan_log_close(infile);
...@@ -316,7 +321,7 @@ int main(int argc, char **argv) ...@@ -316,7 +321,7 @@ int main(int argc, char **argv)
return(-1); return(-1);
} }
ret = darshan_log_gethash(infile, &rec_hash); ret = darshan_log_get_namehash(infile, &name_hash);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(infile); darshan_log_close(infile);
...@@ -328,10 +333,10 @@ int main(int argc, char **argv) ...@@ -328,10 +333,10 @@ int main(int argc, char **argv)
/* NOTE: obfuscating filepaths breaks the ability to map files /* NOTE: obfuscating filepaths breaks the ability to map files
* to the corresponding FS & mount info maintained by darshan * to the corresponding FS & mount info maintained by darshan
*/ */
if(obfuscate) obfuscate_filenames(key, rec_hash); if(obfuscate) obfuscate_filenames(key, name_hash);
if(hash) remove_hash_recs(&rec_hash, hash); if(hash) remove_hash_recs(&name_hash, hash);
ret = darshan_log_puthash(outfile, rec_hash); ret = darshan_log_put_namehash(outfile, name_hash);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(infile); darshan_log_close(infile);
...@@ -402,10 +407,10 @@ int main(int argc, char **argv) ...@@ -402,10 +407,10 @@ int main(int argc, char **argv)
free(fs_types); free(fs_types);
} }
HASH_ITER(hlink, rec_hash, ref, tmp) HASH_ITER(hlink, name_hash, ref, tmp)
{ {
HASH_DELETE(hlink, rec_hash, ref); HASH_DELETE(hlink, name_hash, ref);
free(ref->name); free(ref->name_record);
free(ref); free(ref);
} }
......
...@@ -53,8 +53,8 @@ int main(int argc, char *argv[]) ...@@ -53,8 +53,8 @@ int main(int argc, char *argv[])
darshan_fd file1, file2; darshan_fd file1, file2;
struct darshan_job job1, job2; struct darshan_job job1, job2;
char exe1[4096], exe2[4096]; char exe1[4096], exe2[4096];
struct darshan_record_ref *name_hash1 = NULL, *name_hash2 = NULL; struct darshan_name_record_ref *name_hash1 = NULL, *name_hash2 = NULL;
struct darshan_record_ref *name_ref1, *name_ref2; struct darshan_name_record_ref *name_ref1, *name_ref2;
struct darshan_file_record_ref *rec_hash1 = NULL, *rec_hash2 = NULL; struct darshan_file_record_ref *rec_hash1 = NULL, *rec_hash2 = NULL;
struct darshan_file_record_ref *rec_ref1, *rec_ref2, *rec_tmp; struct darshan_file_record_ref *rec_ref1, *rec_ref2, *rec_tmp;
struct darshan_mod_record_ref *mod_rec1, *mod_rec2; struct darshan_mod_record_ref *mod_rec1, *mod_rec2;
...@@ -89,7 +89,7 @@ int main(int argc, char *argv[]) ...@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
} }
/* get job data for each log file */ /* get job data for each log file */
ret = darshan_log_getjob(file1, &job1); ret = darshan_log_get_job(file1, &job1);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(file1); darshan_log_close(file1);
...@@ -98,7 +98,7 @@ int main(int argc, char *argv[]) ...@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
return(-1); return(-1);
} }
ret = darshan_log_getjob(file2, &job2); ret = darshan_log_get_job(file2, &job2);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(file1); darshan_log_close(file1);
...@@ -108,7 +108,7 @@ int main(int argc, char *argv[]) ...@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
} }
/* get exe string for each log file */ /* get exe string for each log file */
ret = darshan_log_getexe(file1, exe1); ret = darshan_log_get_exe(file1, exe1);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(file1); darshan_log_close(file1);
...@@ -117,7 +117,7 @@ int main(int argc, char *argv[]) ...@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
return(-1); return(-1);
} }
ret = darshan_log_getexe(file2, exe2); ret = darshan_log_get_exe(file2, exe2);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(file1); darshan_log_close(file1);
...@@ -144,7 +144,7 @@ int main(int argc, char *argv[]) ...@@ -144,7 +144,7 @@ int main(int argc, char *argv[])
(int64_t)(job2.end_time - job2.start_time + 1)); (int64_t)(job2.end_time - job2.start_time + 1));
/* get hash of record ids to file names for each log */ /* get hash of record ids to file names for each log */
ret = darshan_log_gethash(file1, &name_hash1); ret = darshan_log_get_namehash(file1, &name_hash1);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(file1); darshan_log_close(file1);
...@@ -153,7 +153,7 @@ int main(int argc, char *argv[]) ...@@ -153,7 +153,7 @@ int main(int argc, char *argv[])
return(-1); return(-1);
} }
ret = darshan_log_gethash(file2, &name_hash2); ret = darshan_log_get_namehash(file2, &name_hash2);
if(ret < 0) if(ret < 0)
{ {
darshan_log_close(file1); darshan_log_close(file1);
...@@ -246,14 +246,14 @@ int main(int argc, char *argv[]) ...@@ -246,14 +246,14 @@ int main(int argc, char *argv[])
HASH_FIND(hlink, name_hash1, &(base_rec1->id), HASH_FIND(hlink, name_hash1, &(base_rec1->id),
sizeof(darshan_record_id), name_ref1); sizeof(darshan_record_id), name_ref1);
assert(name_ref1); assert(name_ref1);
file_name1 = name_ref1->name; file_name1 = name_ref1->name_record->name;
} }
if(mod_buf2) if(mod_buf2)
{ {
HASH_FIND(hlink, name_hash2, &(base_rec2->id), HASH_FIND(hlink, name_hash2, &(base_rec2->id),
sizeof(darshan_record_id), name_ref2); sizeof(darshan_record_id), name_ref2);
assert(name_ref2); assert(name_ref2);
file_name2 = name_ref2->name; file_name2 = name_ref2->name_record->name;
} }
mod_logutils[i]->log_print_diff(mod_buf1, file_name1, mod_buf2, file_name2); mod_logutils[i]->log_print_diff(mod_buf1, file_name1, mod_buf2, file_name2);
...@@ -314,7 +314,7 @@ int main(int argc, char *argv[]) ...@@ -314,7 +314,7 @@ int main(int argc, char *argv[])
HASH_FIND(hlink, name_hash2, &(base_rec2->id), HASH_FIND(hlink, name_hash2, &(base_rec2->id),
sizeof(darshan_record_id), name_ref2); sizeof(darshan_record_id), name_ref2);
assert(name_ref2); assert(name_ref2);
file_name2 = name_ref2->name; file_name2 = name_ref2->name_record->name;
mod_logutils[i]->log_print_diff(NULL, NULL, mod_rec2->mod_dat, file_name2); mod_logutils[i]->log_print_diff(NULL, NULL, mod_rec2->mod_dat, file_name2);
...@@ -340,13 +340,13 @@ int main(int argc, char *argv[]) ...@@ -340,13 +340,13 @@ int main(int argc, char *argv[])
HASH_ITER(hlink, name_hash1, name_ref1, name_ref2) HASH_ITER(hlink, name_hash1, name_ref1, name_ref2)
{ {
HASH_DELETE(hlink, name_hash1, name_ref1); HASH_DELETE(hlink, name_hash1, name_ref1);
free(name_ref1->name); free(name_ref1->name_record);
free(name_ref1); free(name_ref1);
} }
HASH_ITER(hlink, name_hash2, name_ref2, name_ref1) HASH_ITER(hlink, name_hash2, name_ref2, name_ref1)
{ {
HASH_DELETE(hlink, name_hash2, name_ref2); HASH_DELETE(hlink, name_hash2, name_ref2);
free(name_ref2->name); free(name_ref2->name_record);
free(name_ref2); free(name_ref2);
} }
......
...@@ -55,7 +55,7 @@ static int darshan_log_get_hdf5_file(darshan_fd fd, void* hdf5_buf) ...@@ -55,7 +55,7 @@ static int darshan_log_get_hdf5_file(darshan_fd fd, void* hdf5_buf)
int i; int i;
int ret; int ret;
ret = darshan_log_getmod(fd, DARSHAN_HDF5_MOD, hdf5_buf, ret = darshan_log_get_mod(fd, DARSHAN_HDF5_MOD, hdf5_buf,
sizeof(struct darshan_hdf5_file)); sizeof(struct darshan_hdf5_file));
if(ret < 0) if(ret < 0)
return(-1); return(-1);
...@@ -84,7 +84,7 @@ static int darshan_log_put_hdf5_file(darshan_fd fd, void* hdf5_buf, int ver) ...@@ -84,7 +84,7 @@ static int darshan_log_put_hdf5_file(darshan_fd fd, void* hdf5_buf, int ver)
struct darshan_hdf5_file *file = (struct darshan_hdf5_file *)hdf5_buf; struct darshan_hdf5_file *file = (struct darshan_hdf5_file *)hdf5_buf;
int ret; int ret;
ret = darshan_log_putmod(fd, DARSHAN_HDF5_MOD, file, ret = darshan_log_put_mod(fd, DARSHAN_HDF5_MOD, file,
sizeof(struct darshan_hdf5_file), ver); sizeof(struct darshan_hdf5_file), ver);
if(ret < 0) if(ret < 0)
return(-1); return(-1);
......
This diff is collapsed.
...@@ -33,7 +33,7 @@ struct darshan_fd_s ...@@ -33,7 +33,7 @@ struct darshan_fd_s
enum darshan_comp_type comp_type; enum darshan_comp_type comp_type;
/* log file offset/length maps for each log file region */ /* log file offset/length maps for each log file region */
struct darshan_log_map job_map; struct darshan_log_map job_map;
struct darshan_log_map rec_map; struct darshan_log_map name_map;
struct darshan_log_map mod_map[DARSHAN_MAX_MODS]; struct darshan_log_map mod_map[DARSHAN_MAX_MODS];
/* module-specific log-format versions contained in log */ /* module-specific log-format versions contained in log */
uint32_t mod_ver[DARSHAN_MAX_MODS]; uint32_t mod_ver[DARSHAN_MAX_MODS];
...@@ -43,10 +43,9 @@ struct darshan_fd_s ...@@ -43,10 +43,9 @@ struct darshan_fd_s
}; };
typedef struct darshan_fd_s* darshan_fd; typedef struct darshan_fd_s* darshan_fd;
struct darshan_record_ref struct darshan_name_record_ref
{ {
char *name; struct darshan_name_record *name_record;
darshan_record_id id;
UT_hash_handle hlink; UT_hash_handle hlink;
}; };
...@@ -119,19 +118,19 @@ extern struct darshan_mod_logutil_funcs *mod_logutils[]; ...@@ -119,19 +118,19 @@ extern struct darshan_mod_logutil_funcs *mod_logutils[];
darshan_fd darshan_log_open(const char *name); darshan_fd darshan_log_open(const char *name);
darshan_fd darshan_log_create(const char *name, enum darshan_comp_type comp_type, darshan_fd darshan_log_create(const char *name, enum darshan_comp_type comp_type,
int partial_flag); int partial_flag);
int darshan_log_getjob(darshan_fd fd, struct darshan_job *job); int darshan_log_get_job(darshan_fd fd, struct darshan_job *job);
int darshan_log_putjob(darshan_fd fd, struct darshan_job *job); int darshan_log_put_job(darshan_fd fd, struct darshan_job *job);
int darshan_log_getexe(darshan_fd fd, char *buf); int darshan_log_get_exe(darshan_fd fd, char *buf);
int darshan_log_putexe(darshan_fd fd, char *buf); int darshan_log_put_exe(darshan_fd fd, char *buf);
int darshan_log_getmounts(darshan_fd fd, char*** mnt_pts, int darshan_log_get_mounts(darshan_fd fd, char*** mnt_pts,
char*** fs_types, int* count); char*** fs_types, int* count);
int darshan_log_putmounts(darshan_fd fd, char** mnt_pts, int darshan_log_put_mounts(darshan_fd fd, char** mnt_pts,
char** fs_types, int count); char** fs_types, int count);
int darshan_log_gethash(darshan_fd fd, struct darshan_record_ref **hash); int darshan_log_get_namehash(darshan_fd fd, struct darshan_name_record_ref **hash);
int darshan_log_puthash(darshan_fd fd, struct darshan_record_ref *hash); int darshan_log_put_namehash(darshan_fd fd, struct darshan_name_record_ref *hash);
int darshan_log_getmod(darshan_fd fd, darshan_module_id mod_id, int darshan_log_get_mod(darshan_fd fd, darshan_module_id mod_id,
void *mod_buf, int mod_buf_sz); void *mod_buf, int mod_buf_sz);
int darshan_log_putmod(darshan_fd fd, darshan_module_id mod_id, int darshan_log_put_mod(darshan_fd fd, darshan_module_id mod_id,
void *mod_buf, int mod_buf_sz, int ver); void *mod_buf, int mod_buf_sz, int ver);
void darshan_log_close(darshan_fd file); void darshan_log_close(darshan_fd file);
......
...@@ -192,9 +192,9 @@ int main(int argc, char *argv[]) ...@@ -192,9 +192,9 @@ int main(int argc, char *argv[])
char **merge_mnt_pts; char **merge_mnt_pts;
char **merge_fs_types; char **merge_fs_types;
int merge_mnt_count = 0; int merge_mnt_count = 0;
struct darshan_record_ref *in_hash = NULL; struct darshan_name_record_ref *in_hash = NULL;
struct darshan_record_ref *merge_hash = NULL; struct darshan_name_record_ref *merge_hash = NULL;
struct darshan_record_ref *ref, *tmp, *found; struct darshan_name_record_ref *ref, *tmp, *found;
struct darshan_shared_record_ref *shared_rec_hash = NULL; struct darshan_shared_record_ref *shared_rec_hash = NULL;
struct darshan_shared_record_ref *sref, *stmp; struct darshan_shared_record_ref *sref, *stmp;
struct darshan_base_record *base_rec; struct darshan_base_record *base_rec;
...@@ -225,7 +225,7 @@ int main(int argc, char *argv[]) ...@@ -225,7 +225,7 @@ int main(int argc, char *argv[])
} }
/* read job-level metadata from the input file */ /* read job-level metadata from the input file */
ret = darshan_log_getjob(in_fd, &in_job); ret = darshan_log_get_job(in_fd, &in_job);
if(ret < 0) if(ret < 0)
{ {
fprintf(stderr, fprintf(stderr,
...@@ -254,7 +254,7 @@ int main(int argc, char *argv[]) ...@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
/* get job data, exe, & mounts directly from the first input log */ /* get job data, exe, & mounts directly from the first input log */
memcpy(&merge_job, &in_job, sizeof(struct darshan_job)); memcpy(&merge_job, &in_job, sizeof(struct darshan_job));
ret = darshan_log_getexe(in_fd, merge_exe); ret = darshan_log_get_exe(in_fd, merge_exe);
if(ret < 0) if(ret < 0)
{ {
fprintf(stderr, fprintf(stderr,
...@@ -264,7 +264,7 @@ int main(int argc, char *argv[]) ...@@ -264,7 +264,7 @@ int main(int argc, char *argv[])
return(-1); return(-1);
} }
ret = darshan_log_getmounts(in_fd, &merge_mnt_pts, ret = darshan_log_get_mounts(in_fd, &merge_mnt_pts,
&merge_fs_types, &merge_mnt_count); &merge_fs_types, &merge_mnt_count);
if(ret < 0) if(ret < 0)
{ {
...@@ -285,7 +285,7 @@ int main(int argc, char *argv[]) ...@@ -285,7 +285,7 @@ int main(int argc, char *argv[])
} }
/* read the hash of ids->names for the input log */ /* read the hash of ids->names for the input log */
ret = darshan_log_gethash(in_fd, &in_hash); ret = darshan_log_get_namehash(in_fd, &in_hash);
if(ret < 0) if(ret < 0)
{ {
fprintf(stderr, fprintf(stderr,
...@@ -295,17 +295,19 @@ int main(int argc, char *argv[]) ...@@ -295,17 +295,19 @@ int main(int argc, char *argv[])
return(-1); return(-1);
} }
/* iterate the input hash, copying over record_id->file_name mappings /* iterate the input hash, copying over record id->name mappings
* that have not already been copied to the output hash * that have not already been copied to the output hash
*/ */
HASH_ITER(hlink, in_hash, ref, tmp) HASH_ITER(hlink, in_hash, ref, tmp)
{ {
HASH_FIND(hlink, merge_hash, &(ref->id), sizeof(darshan_record_id), found); HASH_FIND(hlink, merge_hash, &(ref->name_record->id),
sizeof(darshan_record_id), found);
if(!found) if(!found)
{ {
HASH_ADD(hlink, merge_hash, id, sizeof(darshan_record_id), ref); HASH_ADD(hlink, merge_hash, name_record->id,
sizeof(darshan_record_id), ref);
} }
else if(strcmp(ref->name, found->name)) else if(strcmp(ref->name_record->name, found->name_record->name))
{ {
fprintf(stderr, fprintf(stderr,
"Error: invalid Darshan record table entry.\n"); "Error: invalid Darshan record table entry.\n");
...@@ -330,7 +332,7 @@ int main(int argc, char *argv[]) ...@@ -330,7 +332,7 @@ int main(int argc, char *argv[])
} }
/* write the darshan job info, exe string, and mount data to output file */ /* write the darshan job info, exe string, and mount data to output file */
ret = darshan_log_putjob(merge_fd, &merge_job); ret = darshan_log_put_job(merge_fd, &merge_job);
if(ret < 0) if(ret < 0)
{ {
fprintf(stderr, "Error: unable to write job data to output darshan log.\n"); fprintf(stderr, "Error: unable to write job data to output darshan log.\n");
...@@ -339,7 +341,7 @@ int main(int argc, char *argv[]) ...@@ -339,7 +341,7 @@ int main(int argc, char *argv[])
return(-1); return(-1);
} }
ret = darshan_log_putexe(merge_fd, merge_exe); ret = darshan_log_put_exe(merge_fd, merge_exe);
if(ret < 0) if(ret < 0)
{ {
fprintf(stderr, "Error: unable to write exe string to output darshan log.\n"); fprintf(stderr, "Error: unable to write exe string to output darshan log.\n");
...@@ -348,7 +350,7 @@ int main(int argc, char *argv[]) ...@@ -348,7 +350,7 @@ int main(int argc, char *argv[])
return(-1); return(-1);
} }
ret = darshan_log_putmounts(merge_fd, merge_mnt_pts, merge_fs_types, merge_mnt_count); ret = darshan_log_put_mounts(merge_fd, merge_mnt_pts, merge_fs_types, merge_mnt_count);
if(ret < 0) if(ret < 0)
{ {
fprintf(stderr, "Error: unable to write mount data to output darshan log.\n"); fprintf(stderr, "Error: unable to write mount data to output darshan log.\n");
...@@ -358,7 +360,7 @@ int main(int argc, char *argv[]) ...@@ -358,7 +360,7 @@ int main(int argc, char *argv[])
} }
/* write the merged table of records to output file */ /* write the merged table of records to output file */
ret = darshan_log_puthash(merge_fd, merge_hash); ret = darshan_log_put_namehash(merge_fd, merge_hash);
if(ret < 0) if(ret < 0)
{ {
fprintf(stderr, "Error: unable to write record table to output darshan log.\n"); fprintf(stderr, "Error: unable to write record table to output darshan log.\n");
......
...@@ -55,7 +55,7 @@ static int darshan_log_get_mpiio_file(darshan_fd fd, void* mpiio_buf) ...@@ -55,7 +55,7 @@ static int darshan_log_get_mpiio_file(darshan_fd fd, void* mpiio_buf)
int i; int i;
int ret; int ret;
ret = darshan_log_getmod(fd, DARSHAN_MPIIO_MOD, mpiio_buf, ret = darshan_log_get_mod(fd, DARSHAN_MPIIO_MOD, mpiio_buf,
sizeof(struct darshan_mpiio_file)); sizeof(struct darshan_mpiio_file));
if(ret < 0) if(ret < 0)
return(-1); return(-1);
...@@ -84,7 +84,7 @@ static int darshan_log_put_mpiio_file(darshan_fd fd, void* mpiio_buf, int ver) ...@@ -84,7 +84,7 @@ static int darshan_log_put_mpiio_file(darshan_fd fd, void* mpiio_buf, int ver)
struct darshan_mpiio_file *file = (struct darshan_mpiio_file *)mpiio_buf; struct darshan_mpiio_file *file = (struct darshan_mpiio_file *)mpiio_buf;
int ret; int ret;
ret = darshan_log_putmod(fd, DARSHAN_MPIIO_MOD, file, ret = darshan_log_put_mod(fd, DARSHAN_MPIIO_MOD, file,
sizeof(struct darshan_mpiio_file), ver);