[dcmf] [PATCH 1/2] Issue 2632: Use stat64() to determine the true block size for BGL file system.
Bob Cernohous
bobc at us.ibm.com
Wed Feb 6 13:02:53 CST 2008
The BGL ADIO in romio always defaulted to a 1M (assuming GPFS) blocksize
when tuning collective i/o. Changed to using stat64() to determine the
real blocksize for any file.
When the file is opened, the file system specific (BGL) pointer
(ADIOI_FileD->fs_ptr) is allocated and initialized with the blocksize.
This pointer is passed as needed to the tuning functions.
Also added ADIOI_BGL_Close() to free the file system specific storage.
Did a little cleanup of compiler warnings in the affected code.
Signed-off-by: Bob Cernohous <bobc at us.ibm.com>
---
.../src/mpi/romio/adio/ad_bgl/ad_bgl_close.c | 64 ++++++++++++++++++++
1 files changed, 64 insertions(+), 0 deletions(-)
create mode 100755 lib/mpi/mpich2/src/mpi/romio/adio/ad_bgl/ad_bgl_close.c
diff --git a/lib/mpi/mpich2/src/mpi/romio/adio/ad_bgl/ad_bgl_close.c b/lib/mpi/mpich2/src/mpi/romio/adio/ad_bgl/ad_bgl_close.c
new file mode 100755
index 0000000..02ad46e
--- /dev/null
+++ b/lib/mpi/mpich2/src/mpi/romio/adio/ad_bgl/ad_bgl_close.c
@@ -0,0 +1,64 @@
+/* begin_generated_IBM_copyright_prolog */
+/* */
+/* ---------------------------------------------------------------- */
+/* (C)Copyright IBM Corp. 2007, 2008 */
+/* IBM CPL License */
+/* ---------------------------------------------------------------- */
+/* */
+/* end_generated_IBM_copyright_prolog */
+/**
+ * \file ad_bgl_open.c
+ * \brief ???
+ */
+
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * Copyright (C) 1997 University of Chicago.
+ * See COPYRIGHT notice in top-level directory.
+ */
+
+#include "ad_bgl.h"
+#include "ad_bgl_aggrs.h"
+//
+// #include "adio.h"
+//
+// #ifdef HAVE_UNISTD_H
+// #include <unistd.h>
+// #endif
+//
+// #ifdef PROFILE
+// #include "mpe.h"
+// #endif
+//
+
+void ADIOI_BGL_Close(ADIO_File fd, int *error_code)
+{
+ int err, derr=0;
+ static char myname[] = "ADIOI_BGL_CLOSE";
+
+#ifdef PROFILE
+ MPE_Log_event(9, 0, "start close");
+#endif
+
+ err = close(fd->fd_sys);
+ if (fd->fd_direct >= 0) {
+ derr = close(fd->fd_direct);
+ }
+
+#ifdef PROFILE
+ MPE_Log_event(10, 0, "end close");
+#endif
+
+ ADIOI_Free(fd->fs_ptr);
+ fd->fs_ptr = NULL;
+ fd->fd_sys = -1;
+ fd->fd_direct = -1;
+
+ if (err == -1 || derr == -1) {
+ *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
+ myname, __LINE__, MPI_ERR_IO,
+ "**io",
+ "**io %s", strerror(errno));
+ }
+ else *error_code = MPI_SUCCESS;
+}
--
1.5.3.7
More information about the dcmf
mailing list