Commit b0871728 authored by Philip Carns's avatar Philip Carns

Fixes #123, track up to 64 file systems at run time, and prioritize storing

information about non-nfs file systems over nfs file systems.


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@862 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 807e1788
......@@ -25,10 +25,18 @@ darshan-2.2.9-pre1
- Ability to disable shared-file reduction by setting the
DARSHAN_DISABLE_SHARED_REDUCTION environment variable.
- More thorough output from darshan-parser --perf, suggested by Huong Luu.
- Increased uncompressed log header size from 1 KiB to 4 KiB to support
additional metadata annotations and more mounted file system information.
- Increased metadata annotation room from 64 bytes to 1KiB in header.
- CP_F_{FASTEST/SLOWEST}_RANK_TIME counters now take MPI-IO time into
account, not just POSIX time, issue reported by Huong Luu.
- Better handling of systems with many mounted file systems (after which
point Darshan will assume file resides on / file system), issue reported
and investigated by David Shrader:
- Track up to 64 rather than 32 mounted file systems at runtime.
- Increase header space available for storing mount point information in
log file from approximately 1 KiB to approximately 3 KiB.
- Prioritize storing information about non-NFS volumes over NFS volumes
if too many file systems are mounted to record them all.
darshan-2.2.8
=============
......
......@@ -208,7 +208,7 @@ 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);
#define CP_MAX_MNTS 32
#define CP_MAX_MNTS 64
#define CP_MAX_MNT_PATH 256
#define CP_MAX_MNT_TYPE 32
struct mnt_data
......@@ -2090,6 +2090,49 @@ static int mnt_data_cmp(const void* a, const void* b)
return(0);
}
/* adds an entry to table of mounted file systems */
static void add_entry(char* trailing_data, int* space_left, struct mntent *entry)
{
int ret;
char tmp_mnt[256];
struct statfs statfsbuf;
strncpy(mnt_data_array[mnt_data_count].path, entry->mnt_dir,
CP_MAX_MNT_PATH-1);
strncpy(mnt_data_array[mnt_data_count].type, entry->mnt_type,
CP_MAX_MNT_TYPE-1);
mnt_data_array[mnt_data_count].hash =
darshan_hash((void*)mnt_data_array[mnt_data_count].path,
strlen(mnt_data_array[mnt_data_count].path), 0);
/* NOTE: we now try to detect the preferred block size for each file
* system using fstatfs(). On Lustre we assume a size of 1 MiB
* because fstatfs() reports 4 KiB.
*/
#ifndef LL_SUPER_MAGIC
#define LL_SUPER_MAGIC 0x0BD00BD0
#endif
ret = statfs(entry->mnt_dir, &statfsbuf);
if(ret == 0 && statfsbuf.f_type != LL_SUPER_MAGIC)
mnt_data_array[mnt_data_count].block_size = statfsbuf.f_bsize;
else if(ret == 0 && statfsbuf.f_type == LL_SUPER_MAGIC)
mnt_data_array[mnt_data_count].block_size = 1024*1024;
else
mnt_data_array[mnt_data_count].block_size = 4096;
/* store mount information for use in header of darshan log */
ret = snprintf(tmp_mnt, 256, "\n%" PRId64 "\t%s\t%s",
mnt_data_array[mnt_data_count].hash,
entry->mnt_type, entry->mnt_dir);
if(ret < 256 && strlen(tmp_mnt) <= (*space_left))
{
strcat(trailing_data, tmp_mnt);
(*space_left) -= strlen(tmp_mnt);
}
mnt_data_count++;
return;
}
/* darshan_get_exe_and_mounts_root()
*
* collects command line and list of mounted file systems into a string that
......@@ -2101,10 +2144,7 @@ static void darshan_get_exe_and_mounts_root(struct darshan_job_runtime* final_jo
struct mntent *entry;
char* exclude;
int tmp_index = 0;
int ret;
struct statfs statfsbuf;
int skip = 0;
char tmp_mnt[256];
/* skip these fs types */
static char* fs_exclusions[] = {
......@@ -2128,10 +2168,14 @@ static void darshan_get_exe_and_mounts_root(struct darshan_job_runtime* final_jo
strcat(trailing_data, final_job->exe);
space_left = CP_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
* mount points
*/
tab = setmntent("/etc/mtab", "r");
if(!tab)
return;
/* loop through list of mounted file systems */
while(mnt_data_count<CP_MAX_MNTS && (entry = getmntent(tab)) != NULL)
{
......@@ -2148,44 +2192,24 @@ static void darshan_get_exe_and_mounts_root(struct darshan_job_runtime* final_jo
tmp_index++;
}
if(skip)
if(skip || (strcmp(entry->mnt_type, "nfs") == 0))
continue;
strncpy(mnt_data_array[mnt_data_count].path, entry->mnt_dir,
CP_MAX_MNT_PATH-1);
strncpy(mnt_data_array[mnt_data_count].type, entry->mnt_type,
CP_MAX_MNT_TYPE-1);
mnt_data_array[mnt_data_count].hash =
darshan_hash((void*)mnt_data_array[mnt_data_count].path,
strlen(mnt_data_array[mnt_data_count].path), 0);
/* NOTE: we now try to detect the preferred block size for each file
* system using fstatfs(). On Lustre we assume a size of 1 MiB
* because fstatfs() reports 4 KiB.
*/
#ifndef LL_SUPER_MAGIC
#define LL_SUPER_MAGIC 0x0BD00BD0
#endif
ret = statfs(entry->mnt_dir, &statfsbuf);
if(ret == 0 && statfsbuf.f_type != LL_SUPER_MAGIC)
mnt_data_array[mnt_data_count].block_size = statfsbuf.f_bsize;
else if(ret == 0 && statfsbuf.f_type == LL_SUPER_MAGIC)
mnt_data_array[mnt_data_count].block_size = 1024*1024;
else
mnt_data_array[mnt_data_count].block_size = 4096;
add_entry(trailing_data, &space_left, entry);
}
endmntent(tab);
/* store mount information for use in header of darshan log */
ret = snprintf(tmp_mnt, 256, "\n%" PRId64 "\t%s\t%s",
mnt_data_array[mnt_data_count].hash,
entry->mnt_type, entry->mnt_dir);
if(ret < 256 && strlen(tmp_mnt) <= space_left)
{
strcat(trailing_data, tmp_mnt);
space_left -= strlen(tmp_mnt);
}
tab = setmntent("/etc/mtab", "r");
if(!tab)
return;
/* loop through list of mounted file systems */
while(mnt_data_count<CP_MAX_MNTS && (entry = getmntent(tab)) != NULL)
{
if(strcmp(entry->mnt_type, "nfs") != 0)
continue;
mnt_data_count++;
add_entry(trailing_data, &space_left, entry);
}
endmntent(tab);
/* Sort mount points in order of longest path to shortest path. This is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment