1
1

Changed parameter name from siox to gpfs

Adding get_info function for gpfs module
annotate printf information

Signed-off-by: Edgar Gabriel <egabriel@central.uh.edu>
Этот коммит содержится в:
XuanWang1982 2015-08-10 16:04:25 +02:00 коммит произвёл Edgar Gabriel
родитель d3c11396fd
Коммит cd76e53479
6 изменённых файлов: 337 добавлений и 303 удалений

Просмотреть файл

@ -38,6 +38,7 @@ fs_gpfs_sources = \
fs_gpfs_file_get_size.c \
fs_gpfs_file_open.c \
fs_gpfs_file_set_info.c\
fs_gpfs_file_get_info.c\
fs_gpfs_file_set_size.c \
fs_gpfs_file_sync.c \
fs_gpfs.c \

Просмотреть файл

@ -48,7 +48,8 @@ static mca_fs_base_module_1_0_0_t gpfs = { mca_fs_gpfs_module_init, /* initializ
mca_fs_gpfs_module_finalize, /* close a module on a communicator */
mca_fs_gpfs_file_open, mca_fs_gpfs_file_close, mca_fs_gpfs_file_delete,
mca_fs_gpfs_file_set_size, mca_fs_gpfs_file_get_size,
mca_fs_gpfs_file_set_info, mca_fs_gpfs_file_sync };
mca_fs_gpfs_file_set_info, mca_fs_gpfs_file_sync,
mca_fs_gpfs_file_get_info};
/*
* *******************************************************************
* ************************* structure ends **************************

Просмотреть файл

@ -59,8 +59,8 @@ int mca_fs_gpfs_file_get_size(struct mca_io_ompio_file_t *fh,
int mca_fs_gpfs_file_get_amode(struct ompi_file_t *fh, int *amode);
int mca_fs_gpfs_file_set_info(struct mca_io_ompio_file_t *fh,
struct ompi_info_t *info);
//int mca_fs_gpfs_file_get_info(struct ompi_file_t *fh,
//struct ompi_info_t **info_used);
int mca_fs_gpfs_file_get_info(struct mca_io_ompio_file_t *fh,
struct ompi_info_t **info_used);
int mca_fs_gpfs_prefetch_hints(int access_mode,
mca_io_ompio_file_t *fh, struct ompi_info_t *info);
int mca_fs_gpfs_io_selection(mca_io_ompio_file_t *fh,

Просмотреть файл

@ -38,7 +38,7 @@
int
mca_fs_gpfs_file_close (mca_io_ompio_file_t *fh)
{
printf("Using mca_fs_gpfs_file_close to close a file.\n");
//DEBUG printf("Using mca_fs_gpfs_file_close to close a file.\n");
fh->f_comm->c_coll.coll_barrier (fh->f_comm,
fh->f_comm->c_coll.coll_barrier_module);

48
ompi/mca/fs/gpfs/fs_gpfs_file_get_info.c Обычный файл
Просмотреть файл

@ -0,0 +1,48 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2011 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2015 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2011 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "fs_gpfs.h"
#include "mpi.h"
#include "ompi/constants.h"
#include "ompi/mca/fs/fs.h"
#include <unistd.h>
#include <string.h>
#include <gpfs.h>
#include <fcntl.h>
#include <errno.h>
#include <gpfs_fcntl.h>
/*
* file_get_info_gpfs
*
* Function: - get_info of a file
* Accepts: - same arguments as MPI_File_get_info()
* Returns: - new info object
*/
int mca_fs_gpfs_file_get_info(mca_io_ompio_file_t *fh,
ompi_info_t **info_used) {
fprintf(stderr, "GPFS GET INFO\n");
int ret = OMPI_SUCCESS;
ret = MPI_Info_dup(fh->f_info, *info_used);
return ret;
}

Просмотреть файл

@ -169,23 +169,6 @@ struct {
int mca_fs_gpfs_file_set_info(mca_io_ompio_file_t *fh, struct ompi_info_t *info) {
//DEBUG: fprintf(stderr, "GPFS SET INFO\n");
int ret;
//CN: Why subfunction?
ret = mca_fs_gpfs_prefetch_hints(fh->f_amode, fh, info);
return ret;
}
//CN: The functionality of this function translates between siox keys and GPFS structs
//CN: Would this not be the job of siox - providing a gps hint struct?
//CN: If we want to do this, we schould do this in a modular way, allowing to exchange siox easiely
int mca_fs_gpfs_prefetch_hints(int access_mode,
mca_io_ompio_file_t *fh, struct ompi_info_t *info) {
//CN: Is this future proof, no description what gpfs_file_t is exactly
//CN: In gpfs.h it seems void* on WINDOWS and int on UNIX
//CN: Does this fit fh->fd in all cases?
gpfs_file_t gpfs_file_handle = fh->fd;
int rc = 0;
int flag;
int valueLen = MPI_MAX_INFO_VAL;
@ -196,6 +179,7 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
int ret = OMPI_SUCCESS;
ompi_info_t *info_selected;
info_selected = info;
gpfs_file_t gpfs_file_handle = fh->fd;
strcpy(gpfsHintsKey, "useSIOXLib");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
@ -213,7 +197,7 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
}
//Setting GPFS Hint - gpfsAccessRange
strcpy(gpfsHintsKey, "sioxAccessRange");
strcpy(gpfsHintsKey, "gpfsAccessRange");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag) {
printf("GPFS Access Range is set: %s: %s\n", gpfsHintsKey, value);
@ -235,14 +219,14 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
if (rc != 0) {
rc = errno;
printf(
"gpfs_hints_1 gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
"gpfs_hint_AccessRange gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR;
}
}
//Setting GPFS Hint - gpfsFreeRange
strcpy(gpfsHintsKey, "sioxFreeRange");
strcpy(gpfsHintsKey, "gpfsFreeRange");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag) {
printf("GPFS Free Range is set: %s: %s\n", gpfsHintsKey, value);
@ -262,7 +246,7 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
if (rc != 0) {
rc = errno;
printf(
"gpfs_hints_2 gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
"gpfs_hint_FreeRange gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR;
}
@ -273,7 +257,7 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
//Setting GPFS Hint - gpfsMultipleAccessRange
//Setting GPFS Hint - gpfsClearFileCache
strcpy(gpfsHintsKey, "sioxClearFileCache");
strcpy(gpfsHintsKey, "gpfsClearFileCache");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag & strcmp(value, "true") == 0) {
printf("GPFS Clear File Cache is set: %s: %s\n", gpfsHintsKey, value);
@ -289,14 +273,14 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
if (rc != 0) {
rc = errno;
printf(
"gpfs_hints_5 gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
"gpfs_hint_ClearFileCache gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR;
}
}
//Setting GPFS Hint - gpfsCancelHints
strcpy(gpfsHintsKey, "sioxCancelHints");
strcpy(gpfsHintsKey, "gpfsCancelHints");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag & strcmp(value, "true") == 0) {
printf("GPFS Cancel Hints is set: %s: %s\n", gpfsHintsKey, value);
@ -312,14 +296,14 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
if (rc != 0) {
rc = errno;
printf(
"gpfs_hints_6 gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
"gpfs_hint_CancelHints gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR;
}
}
//Setting GPFS Hint - gpfsDataShipStart
strcpy(gpfsHintsKey, "sioxDataShipStart");
strcpy(gpfsHintsKey, "gpfsDataShipStart");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag) {
printf("GPFS Data Ship Start is set: %s: %s\n", gpfsHintsKey, value);
@ -338,7 +322,7 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
if (rc != 0) {
rc = errno;
printf(
"gpfs_hints_7 gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
"gpfs_hint_DataShipStart gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR;
}
@ -349,7 +333,7 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
//Setting GPFS Hint - gpfsDataShipMapVariable
//Setting GPFS Hint - gpfsDataShipStop
strcpy(gpfsHintsKey, "sioxDataShipStop");
strcpy(gpfsHintsKey, "gpfsDataShipStop");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag & strcmp(value, "true") == 0) {
printf("GPFS Data Ship Stop is set: %s: %s\n", gpfsHintsKey, value);
@ -365,14 +349,14 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
if (rc != 0) {
rc = errno;
printf(
"gpfs_hints_10 gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
"gpfs_hint_DataShipStop gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR;
}
}
//Setting GPFS Hint - gpfsSetReplication
strcpy(gpfsHintsKey, "sioxSetReplication");
strcpy(gpfsHintsKey, "gpfsSetReplication");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag) {
printf("GPFS Set Replication is set: %s: %s\n", gpfsHintsKey, value);
@ -394,7 +378,7 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
if (rc != 0) {
rc = errno;
printf(
"gpfs_hints_11 gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
"gpfs_hint_SetReplication gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR;
}
@ -404,7 +388,7 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
//Setting GPFS Hint - gpfsSetStoragePool
//Setting GPFS Hint - gpfsByteRange
strcpy(gpfsHintsKey, "sioxByteRange");
strcpy(gpfsHintsKey, "gpfsByteRange");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag) {
printf("GPFS Byte Range is set: %s: %s\n", gpfsHintsKey, value);
@ -421,14 +405,14 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
if (rc != 0) {
rc = errno;
printf(
"gpfs_hints_13 gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
"gpfs_hint_ByteRange gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR;
}
}
//Setting GPFS Hint - gpfsRestripeData
strcpy(gpfsHintsKey, "sioxRestripeData");
strcpy(gpfsHintsKey, "gpfsRestripeData");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag) {
printf("GPFS Restripe Data is set: %s: %s\n", gpfsHintsKey, value);
@ -448,7 +432,7 @@ int mca_fs_gpfs_prefetch_hints(int access_mode,
if (rc != 0) {
rc = errno;
printf(
"gpfs_hints_14 gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
"gpfs_hint_RestripeData gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR;
}