Skip to content

Commit 8c7f9d2

Browse files
author
shanedsnyder
authored
Merge pull request #991 from darshan-hpc/snyder/dev-lustre-pfl
enhanced Lustre module
2 parents c28416f + 893cf0d commit 8c7f9d2

File tree

17 files changed

+853
-744
lines changed

17 files changed

+853
-744
lines changed

darshan-runtime/configure.ac

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,14 @@ if test "x$enable_darshan_runtime" = xyes ; then
522522
AC_CHECK_HEADER([lustre/lustreapi.h],
523523
[AC_CHECK_LIB(lustreapi, llapi_layout_get_by_xattr,
524524
[BUILD_LUSTRE_MODULE=1
525-
DARSHAN_LUSTRE_LD_FLAGS="-llustreapi"],
526-
[AS_IF([test "x$enable_lustre_mod" = xyes],
525+
DARSHAN_LUSTRE_LD_FLAGS="-llustreapi"
526+
enable_lustre_mod=yes],
527+
[AS_IF([test "x$enable_lustre_mod" = xyes],
527528
[AC_MSG_ERROR(Cannot find required llapi_layout_get_by_xattr function for the Lustre module)])
528-
])
529-
AS_IF([test "x$enable_lustre_mod" = xyes],
529+
enable_lustre_mod=no])],
530+
[AS_IF([test "x$enable_lustre_mod" = xyes],
530531
[AC_MSG_ERROR(Cannot find required headers for the Lustre module)])
531-
enable_lustre_mod=yes],
532-
[enable_lustre_mod=no])
532+
enable_lustre_mod=no])
533533
fi
534534

535535
AC_ARG_ENABLE([mdhim-mod],

darshan-runtime/lib/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ endif
118118
H_SRCS = darshan-common.h \
119119
darshan.h \
120120
darshan-config.h \
121-
darshan-lustre.h \
122121
darshan-dxt.h \
123122
darshan-ldms.h \
124123
uthash.h \

darshan-runtime/lib/darshan-core.c

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void (*mod_static_init_fns[])(void) =
9898
/* XXX need to use extern to get Lustre module's instrumentation function
9999
* since modules have no way of providing this to darshan-core
100100
*/
101-
extern void darshan_instrument_lustre_file(const char *filepath, int fd);
101+
extern void darshan_instrument_lustre_file(darshan_record_id rec_id, int fd);
102102
#endif
103103

104104
/* prototypes for internal helper functions */
@@ -958,36 +958,6 @@ static void add_entry(char* buf, int* space_left, struct mntent* entry)
958958
else
959959
mnt_data_array[mnt_data_count].fs_info.block_size = 4096;
960960

961-
#ifdef DARSHAN_LUSTRE
962-
/* attempt to retrieve OST and MDS counts from Lustre */
963-
mnt_data_array[mnt_data_count].fs_info.ost_count = -1;
964-
mnt_data_array[mnt_data_count].fs_info.mdt_count = -1;
965-
if ( statfsbuf.f_type == LL_SUPER_MAGIC )
966-
{
967-
int n_ost, n_mdt;
968-
int ret_ost, ret_mdt;
969-
DIR *mount_dir;
970-
971-
mount_dir = opendir( entry->mnt_dir );
972-
if ( mount_dir )
973-
{
974-
/* n_ost and n_mdt are used for both input and output to ioctl */
975-
n_ost = 0;
976-
n_mdt = 1;
977-
978-
ret_ost = ioctl( dirfd(mount_dir), LL_IOC_GETOBDCOUNT, &n_ost );
979-
ret_mdt = ioctl( dirfd(mount_dir), LL_IOC_GETOBDCOUNT, &n_mdt );
980-
981-
if ( !(ret_ost < 0 || ret_mdt < 0) )
982-
{
983-
mnt_data_array[mnt_data_count].fs_info.ost_count = n_ost;
984-
mnt_data_array[mnt_data_count].fs_info.mdt_count = n_mdt;
985-
}
986-
closedir( mount_dir );
987-
}
988-
}
989-
#endif
990-
991961
/* store mount information with the job-level metadata in darshan log */
992962
ret = snprintf(tmp_mnt, 256, "\n%s\t%s",
993963
entry->mnt_type, entry->mnt_dir);
@@ -2664,27 +2634,27 @@ void *darshan_core_register_record(
26642634
__DARSHAN_CORE_UNLOCK();
26652635
return(NULL);
26662636
}
2637+
}
26672638

2668-
/* check to see if we've already stored the id->name mapping for
2669-
* this record, and add a new name record if not
2670-
*/
2671-
HASH_FIND(hlink, __darshan_core->name_hash, &rec_id,
2672-
sizeof(darshan_record_id), ref);
2673-
if(!ref)
2674-
{
2675-
ret = darshan_add_name_record_ref(__darshan_core, rec_id, name, mod_id);
2676-
if(ret == 0)
2677-
{
2678-
DARSHAN_MOD_FLAG_SET(__darshan_core->log_hdr_p->partial_flag, mod_id);
2679-
__DARSHAN_CORE_UNLOCK();
2680-
return(NULL);
2681-
}
2682-
}
2683-
else
2639+
/* check to see if we've already stored the id->name mapping for
2640+
* this record, and add a new name record if not
2641+
*/
2642+
HASH_FIND(hlink, __darshan_core->name_hash, &rec_id,
2643+
sizeof(darshan_record_id), ref);
2644+
if(!ref)
2645+
{
2646+
ret = darshan_add_name_record_ref(__darshan_core, rec_id, name, mod_id);
2647+
if(ret == 0)
26842648
{
2685-
DARSHAN_MOD_FLAG_SET(ref->mod_flags, mod_id);
2649+
DARSHAN_MOD_FLAG_SET(__darshan_core->log_hdr_p->partial_flag, mod_id);
2650+
__DARSHAN_CORE_UNLOCK();
2651+
return(NULL);
26862652
}
26872653
}
2654+
else
2655+
{
2656+
DARSHAN_MOD_FLAG_SET(ref->mod_flags, mod_id);
2657+
}
26882658

26892659
__darshan_core->mod_array[mod_id]->rec_mem_avail -= rec_size;
26902660
if((mod_id != DXT_POSIX_MOD) && (mod_id != DXT_MPIIO_MOD))
@@ -2731,7 +2701,7 @@ char *darshan_core_lookup_record_name(darshan_record_id rec_id)
27312701
return(name);
27322702
}
27332703

2734-
void darshan_instrument_fs_data(int fs_type, const char *path, int fd)
2704+
void darshan_instrument_fs_data(int fs_type, darshan_record_id rec_id, int fd)
27352705
{
27362706
#ifdef DARSHAN_LUSTRE
27372707
/* allow Lustre to generate a record if we configured with Lustre support */
@@ -2745,7 +2715,7 @@ void darshan_instrument_fs_data(int fs_type, const char *path, int fd)
27452715
*/
27462716
if(1 || fs_type == LL_SUPER_MAGIC)
27472717
{
2748-
darshan_instrument_lustre_file(path, fd);
2718+
darshan_instrument_lustre_file(rec_id, fd);
27492719
return;
27502720
}
27512721
#endif

0 commit comments

Comments
 (0)