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_get_size.c \
fs_gpfs_file_open.c \ fs_gpfs_file_open.c \
fs_gpfs_file_set_info.c\ fs_gpfs_file_set_info.c\
fs_gpfs_file_get_info.c\
fs_gpfs_file_set_size.c \ fs_gpfs_file_set_size.c \
fs_gpfs_file_sync.c \ fs_gpfs_file_sync.c \
fs_gpfs.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_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_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_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 ************************** * ************************* 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_get_amode(struct ompi_file_t *fh, int *amode);
int mca_fs_gpfs_file_set_info(struct mca_io_ompio_file_t *fh, int mca_fs_gpfs_file_set_info(struct mca_io_ompio_file_t *fh,
struct ompi_info_t *info); struct ompi_info_t *info);
//int mca_fs_gpfs_file_get_info(struct ompi_file_t *fh, int mca_fs_gpfs_file_get_info(struct mca_io_ompio_file_t *fh,
//struct ompi_info_t **info_used); struct ompi_info_t **info_used);
int mca_fs_gpfs_prefetch_hints(int access_mode, int mca_fs_gpfs_prefetch_hints(int access_mode,
mca_io_ompio_file_t *fh, struct ompi_info_t *info); mca_io_ompio_file_t *fh, struct ompi_info_t *info);
int mca_fs_gpfs_io_selection(mca_io_ompio_file_t *fh, int mca_fs_gpfs_io_selection(mca_io_ompio_file_t *fh,

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

@ -38,7 +38,7 @@
int int
mca_fs_gpfs_file_close (mca_io_ompio_file_t *fh) 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 (fh->f_comm,
fh->f_comm->c_coll.coll_barrier_module); 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,305 +169,289 @@ struct {
int mca_fs_gpfs_file_set_info(mca_io_ompio_file_t *fh, struct ompi_info_t *info) { 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"); //DEBUG: fprintf(stderr, "GPFS SET INFO\n");
int ret; int rc = 0;
//CN: Why subfunction? int flag;
ret = mca_fs_gpfs_prefetch_hints(fh->f_amode, fh, info); int valueLen = MPI_MAX_INFO_VAL;
return ret; char value[MPI_MAX_INFO_VAL + 1];
} char gpfsHintsKey[50];
const char* split = ",";
//CN: The functionality of this function translates between siox keys and GPFS structs char* token;
//CN: Would this not be the job of siox - providing a gps hint struct? int ret = OMPI_SUCCESS;
//CN: If we want to do this, we schould do this in a modular way, allowing to exchange siox easiely ompi_info_t *info_selected;
int mca_fs_gpfs_prefetch_hints(int access_mode, info_selected = info;
mca_io_ompio_file_t *fh, struct ompi_info_t *info) { gpfs_file_t gpfs_file_handle = fh->fd;
//CN: Is this future proof, no description what gpfs_file_t is exactly strcpy(gpfsHintsKey, "useSIOXLib");
//CN: In gpfs.h it seems void* on WINDOWS and int on UNIX ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
//CN: Does this fit fh->fd in all cases? if (flag) {
gpfs_file_t gpfs_file_handle = fh->fd; if(strcmp(value, "true") == 0) {
//using the SIOX lib and the I/O pattern selection
int rc = 0; ret = mca_fs_gpfs_io_selection(fh, info, info_selected);
int flag; if (ret != OMPI_SUCCESS)
int valueLen = MPI_MAX_INFO_VAL; return ret;
char value[MPI_MAX_INFO_VAL + 1]; }
char gpfsHintsKey[50]; else {
const char* split = ","; //CN: Is there something left to do here?
char* token; //TODO Sending the MPI_INFO to SIOX for knowledgebase
int ret = OMPI_SUCCESS; }
ompi_info_t *info_selected; }
info_selected = info;
//Setting GPFS Hint - gpfsAccessRange
strcpy(gpfsHintsKey, "useSIOXLib"); strcpy(gpfsHintsKey, "gpfsAccessRange");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag); ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag) { if (flag) {
if(strcmp(value, "true") == 0) { printf("GPFS Access Range is set: %s: %s\n", gpfsHintsKey, value);
//using the SIOX lib and the I/O pattern selection gpfs_hint_AccessRange.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_AccessRange);
ret = mca_fs_gpfs_io_selection(fh, info, info_selected); gpfs_hint_AccessRange.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
if (ret != OMPI_SUCCESS) gpfs_hint_AccessRange.gpfsFcntlHeader.fcntlReserved = 0;
return ret;
} gpfs_hint_AccessRange.gpfsAccessRange.structLen =
else { sizeof(gpfs_hint_AccessRange.gpfsAccessRange);
//CN: Is there something left to do here? gpfs_hint_AccessRange.gpfsAccessRange.structType = GPFS_ACCESS_RANGE;
//TODO Sending the MPI_INFO to SIOX for knowledgebase token = strtok(value, split);
} gpfs_hint_AccessRange.gpfsAccessRange.start = atol(token);
} token = strtok(NULL, split);
gpfs_hint_AccessRange.gpfsAccessRange.length = atol(token);
//Setting GPFS Hint - gpfsAccessRange token = strtok(NULL, split);
strcpy(gpfsHintsKey, "sioxAccessRange"); gpfs_hint_AccessRange.gpfsAccessRange.isWrite = atoi(token);
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag) { rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_AccessRange);
printf("GPFS Access Range is set: %s: %s\n", gpfsHintsKey, value); if (rc != 0) {
gpfs_hint_AccessRange.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_AccessRange); rc = errno;
gpfs_hint_AccessRange.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; printf(
gpfs_hint_AccessRange.gpfsFcntlHeader.fcntlReserved = 0; "gpfs_hint_AccessRange gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
gpfs_hint_AccessRange.gpfsAccessRange.structLen = ret = OMPI_ERROR;
sizeof(gpfs_hint_AccessRange.gpfsAccessRange); }
gpfs_hint_AccessRange.gpfsAccessRange.structType = GPFS_ACCESS_RANGE; }
token = strtok(value, split);
gpfs_hint_AccessRange.gpfsAccessRange.start = atol(token); //Setting GPFS Hint - gpfsFreeRange
token = strtok(NULL, split); strcpy(gpfsHintsKey, "gpfsFreeRange");
gpfs_hint_AccessRange.gpfsAccessRange.length = atol(token); ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
token = strtok(NULL, split); if (flag) {
gpfs_hint_AccessRange.gpfsAccessRange.isWrite = atoi(token); printf("GPFS Free Range is set: %s: %s\n", gpfsHintsKey, value);
gpfs_hint_FreeRange.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_FreeRange);
rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_AccessRange); gpfs_hint_FreeRange.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
if (rc != 0) { gpfs_hint_FreeRange.gpfsFcntlHeader.fcntlReserved = 0;
rc = errno;
printf( gpfs_hint_FreeRange.gpfsFreeRange.structLen =
"gpfs_hints_1 gpfs_fcntl(file handle: %d): Error number is %d, %s\n", sizeof(gpfs_hint_FreeRange.gpfsFreeRange);
gpfs_file_handle, rc, strerror(rc)); gpfs_hint_FreeRange.gpfsFreeRange.structType = GPFS_FREE_RANGE;
ret = OMPI_ERROR; token = strtok(value, split);
} gpfs_hint_FreeRange.gpfsFreeRange.start = atol(token);
} token = strtok(NULL, split);
gpfs_hint_FreeRange.gpfsFreeRange.length = atol(token);
//Setting GPFS Hint - gpfsFreeRange
strcpy(gpfsHintsKey, "sioxFreeRange"); rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_FreeRange);
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag); if (rc != 0) {
if (flag) { rc = errno;
printf("GPFS Free Range is set: %s: %s\n", gpfsHintsKey, value); printf(
gpfs_hint_FreeRange.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_FreeRange); "gpfs_hint_FreeRange gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_hint_FreeRange.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; gpfs_file_handle, rc, strerror(rc));
gpfs_hint_FreeRange.gpfsFcntlHeader.fcntlReserved = 0; ret = OMPI_ERROR;
}
gpfs_hint_FreeRange.gpfsFreeRange.structLen = }
sizeof(gpfs_hint_FreeRange.gpfsFreeRange);
gpfs_hint_FreeRange.gpfsFreeRange.structType = GPFS_FREE_RANGE; //CN: TODO
token = strtok(value, split); //Setting GPFS Hint - gpfsRangeArray
gpfs_hint_FreeRange.gpfsFreeRange.start = atol(token); //Setting GPFS Hint - gpfsMultipleAccessRange
token = strtok(NULL, split);
gpfs_hint_FreeRange.gpfsFreeRange.length = atol(token); //Setting GPFS Hint - gpfsClearFileCache
strcpy(gpfsHintsKey, "gpfsClearFileCache");
rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_FreeRange); ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (rc != 0) { if (flag & strcmp(value, "true") == 0) {
rc = errno; printf("GPFS Clear File Cache is set: %s: %s\n", gpfsHintsKey, value);
printf( gpfs_hint_ClearFileCache.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_ClearFileCache);
"gpfs_hints_2 gpfs_fcntl(file handle: %d): Error number is %d, %s\n", gpfs_hint_ClearFileCache.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
gpfs_file_handle, rc, strerror(rc)); gpfs_hint_ClearFileCache.gpfsFcntlHeader.fcntlReserved = 0;
ret = OMPI_ERROR;
} gpfs_hint_ClearFileCache.gpfsClearFileCache.structLen =
} sizeof(gpfs_hint_ClearFileCache.gpfsClearFileCache);
gpfs_hint_ClearFileCache.gpfsClearFileCache.structType = GPFS_CLEAR_FILE_CACHE;
//CN: TODO
//Setting GPFS Hint - gpfsRangeArray rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_ClearFileCache);
//Setting GPFS Hint - gpfsMultipleAccessRange if (rc != 0) {
rc = errno;
//Setting GPFS Hint - gpfsClearFileCache printf(
strcpy(gpfsHintsKey, "sioxClearFileCache"); "gpfs_hint_ClearFileCache gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag); gpfs_file_handle, rc, strerror(rc));
if (flag & strcmp(value, "true") == 0) { ret = OMPI_ERROR;
printf("GPFS Clear File Cache is set: %s: %s\n", gpfsHintsKey, value); }
gpfs_hint_ClearFileCache.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_ClearFileCache); }
gpfs_hint_ClearFileCache.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
gpfs_hint_ClearFileCache.gpfsFcntlHeader.fcntlReserved = 0; //Setting GPFS Hint - gpfsCancelHints
strcpy(gpfsHintsKey, "gpfsCancelHints");
gpfs_hint_ClearFileCache.gpfsClearFileCache.structLen = ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
sizeof(gpfs_hint_ClearFileCache.gpfsClearFileCache); if (flag & strcmp(value, "true") == 0) {
gpfs_hint_ClearFileCache.gpfsClearFileCache.structType = GPFS_CLEAR_FILE_CACHE; printf("GPFS Cancel Hints is set: %s: %s\n", gpfsHintsKey, value);
gpfs_hint_CancelHints.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_CancelHints);
rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_ClearFileCache); gpfs_hint_CancelHints.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
if (rc != 0) { gpfs_hint_CancelHints.gpfsFcntlHeader.fcntlReserved = 0;
rc = errno;
printf( gpfs_hint_CancelHints.gpfsCancelHints.structLen =
"gpfs_hints_5 gpfs_fcntl(file handle: %d): Error number is %d, %s\n", sizeof(gpfs_hint_CancelHints.gpfsCancelHints);
gpfs_file_handle, rc, strerror(rc)); gpfs_hint_CancelHints.gpfsCancelHints.structType = GPFS_CANCEL_HINTS;
ret = OMPI_ERROR;
} rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_CancelHints);
} if (rc != 0) {
rc = errno;
//Setting GPFS Hint - gpfsCancelHints printf(
strcpy(gpfsHintsKey, "sioxCancelHints"); "gpfs_hint_CancelHints gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag); gpfs_file_handle, rc, strerror(rc));
if (flag & strcmp(value, "true") == 0) { ret = OMPI_ERROR;
printf("GPFS Cancel Hints is set: %s: %s\n", gpfsHintsKey, value); }
gpfs_hint_CancelHints.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_CancelHints); }
gpfs_hint_CancelHints.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
gpfs_hint_CancelHints.gpfsFcntlHeader.fcntlReserved = 0; //Setting GPFS Hint - gpfsDataShipStart
strcpy(gpfsHintsKey, "gpfsDataShipStart");
gpfs_hint_CancelHints.gpfsCancelHints.structLen = ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
sizeof(gpfs_hint_CancelHints.gpfsCancelHints); if (flag) {
gpfs_hint_CancelHints.gpfsCancelHints.structType = GPFS_CANCEL_HINTS; printf("GPFS Data Ship Start is set: %s: %s\n", gpfsHintsKey, value);
gpfs_hint_DataShipStart.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_DataShipStart);
rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_CancelHints); gpfs_hint_DataShipStart.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
if (rc != 0) { gpfs_hint_DataShipStart.gpfsFcntlHeader.fcntlReserved = 0;
rc = errno;
printf( gpfs_hint_DataShipStart.gpfsDataShipStart.structLen =
"gpfs_hints_6 gpfs_fcntl(file handle: %d): Error number is %d, %s\n", sizeof(gpfs_hint_DataShipStart.gpfsDataShipStart);
gpfs_file_handle, rc, strerror(rc)); gpfs_hint_DataShipStart.gpfsDataShipStart.structType = GPFS_DATA_SHIP_START;
ret = OMPI_ERROR; token = strtok(value, split);
} gpfs_hint_DataShipStart.gpfsDataShipStart.numInstances = atoi(token);
} gpfs_hint_DataShipStart.gpfsDataShipStart.reserved = 0;
//Setting GPFS Hint - gpfsDataShipStart rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_DataShipStart);
strcpy(gpfsHintsKey, "sioxDataShipStart"); if (rc != 0) {
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag); rc = errno;
if (flag) { printf(
printf("GPFS Data Ship Start is set: %s: %s\n", gpfsHintsKey, value); "gpfs_hint_DataShipStart gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_hint_DataShipStart.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_DataShipStart); gpfs_file_handle, rc, strerror(rc));
gpfs_hint_DataShipStart.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; ret = OMPI_ERROR;
gpfs_hint_DataShipStart.gpfsFcntlHeader.fcntlReserved = 0; }
}
gpfs_hint_DataShipStart.gpfsDataShipStart.structLen =
sizeof(gpfs_hint_DataShipStart.gpfsDataShipStart); //CN: TODO
gpfs_hint_DataShipStart.gpfsDataShipStart.structType = GPFS_DATA_SHIP_START; //Setting GPFS Hint - gpfsDataShipMap
token = strtok(value, split); //Setting GPFS Hint - gpfsDataShipMapVariable
gpfs_hint_DataShipStart.gpfsDataShipStart.numInstances = atoi(token);
gpfs_hint_DataShipStart.gpfsDataShipStart.reserved = 0; //Setting GPFS Hint - gpfsDataShipStop
strcpy(gpfsHintsKey, "gpfsDataShipStop");
rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_DataShipStart); ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (rc != 0) { if (flag & strcmp(value, "true") == 0) {
rc = errno; printf("GPFS Data Ship Stop is set: %s: %s\n", gpfsHintsKey, value);
printf( gpfs_hint_DataShipStop.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_DataShipStop);
"gpfs_hints_7 gpfs_fcntl(file handle: %d): Error number is %d, %s\n", gpfs_hint_DataShipStop.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
gpfs_file_handle, rc, strerror(rc)); gpfs_hint_DataShipStop.gpfsFcntlHeader.fcntlReserved = 0;
ret = OMPI_ERROR;
} gpfs_hint_DataShipStop.gpfsDataShipStop.structLen =
} sizeof(gpfs_hint_DataShipStop.gpfsDataShipStop);
gpfs_hint_DataShipStop.gpfsDataShipStop.structType = GPFS_DATA_SHIP_STOP;
//CN: TODO
//Setting GPFS Hint - gpfsDataShipMap rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_DataShipStop);
//Setting GPFS Hint - gpfsDataShipMapVariable if (rc != 0) {
rc = errno;
//Setting GPFS Hint - gpfsDataShipStop printf(
strcpy(gpfsHintsKey, "sioxDataShipStop"); "gpfs_hint_DataShipStop gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag); gpfs_file_handle, rc, strerror(rc));
if (flag & strcmp(value, "true") == 0) { ret = OMPI_ERROR;
printf("GPFS Data Ship Stop is set: %s: %s\n", gpfsHintsKey, value); }
gpfs_hint_DataShipStop.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_DataShipStop); }
gpfs_hint_DataShipStop.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
gpfs_hint_DataShipStop.gpfsFcntlHeader.fcntlReserved = 0; //Setting GPFS Hint - gpfsSetReplication
strcpy(gpfsHintsKey, "gpfsSetReplication");
gpfs_hint_DataShipStop.gpfsDataShipStop.structLen = ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
sizeof(gpfs_hint_DataShipStop.gpfsDataShipStop); if (flag) {
gpfs_hint_DataShipStop.gpfsDataShipStop.structType = GPFS_DATA_SHIP_STOP; printf("GPFS Set Replication is set: %s: %s\n", gpfsHintsKey, value);
gpfs_hint_SetReplication.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_SetReplication);
rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_DataShipStop); gpfs_hint_SetReplication.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
if (rc != 0) { gpfs_hint_SetReplication.gpfsFcntlHeader.fcntlReserved = 0;
rc = errno;
printf( gpfs_hint_SetReplication.gpfsSetReplication.structLen =
"gpfs_hints_10 gpfs_fcntl(file handle: %d): Error number is %d, %s\n", sizeof(gpfs_hint_SetReplication.gpfsSetReplication);
gpfs_file_handle, rc, strerror(rc)); gpfs_hint_SetReplication.gpfsSetReplication.structType = GPFS_FCNTL_SET_REPLICATION;
ret = OMPI_ERROR; token = strtok(value, split);
} gpfs_hint_SetReplication.gpfsSetReplication.metadataReplicas = atoi(token);
} gpfs_hint_SetReplication.gpfsSetReplication.maxMetadataReplicas = atoi(token);
gpfs_hint_SetReplication.gpfsSetReplication.dataReplicas = atoi(token);
//Setting GPFS Hint - gpfsSetReplication gpfs_hint_SetReplication.gpfsSetReplication.maxDataReplicas = atoi(token);
strcpy(gpfsHintsKey, "sioxSetReplication"); gpfs_hint_SetReplication.gpfsSetReplication.reserved = 0;
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
if (flag) { rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_SetReplication);
printf("GPFS Set Replication is set: %s: %s\n", gpfsHintsKey, value); if (rc != 0) {
gpfs_hint_SetReplication.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_SetReplication); rc = errno;
gpfs_hint_SetReplication.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; printf(
gpfs_hint_SetReplication.gpfsFcntlHeader.fcntlReserved = 0; "gpfs_hint_SetReplication gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_file_handle, rc, strerror(rc));
gpfs_hint_SetReplication.gpfsSetReplication.structLen = ret = OMPI_ERROR;
sizeof(gpfs_hint_SetReplication.gpfsSetReplication); }
gpfs_hint_SetReplication.gpfsSetReplication.structType = GPFS_FCNTL_SET_REPLICATION; }
token = strtok(value, split);
gpfs_hint_SetReplication.gpfsSetReplication.metadataReplicas = atoi(token); //CN: TODO
gpfs_hint_SetReplication.gpfsSetReplication.maxMetadataReplicas = atoi(token); //Setting GPFS Hint - gpfsSetStoragePool
gpfs_hint_SetReplication.gpfsSetReplication.dataReplicas = atoi(token);
gpfs_hint_SetReplication.gpfsSetReplication.maxDataReplicas = atoi(token); //Setting GPFS Hint - gpfsByteRange
gpfs_hint_SetReplication.gpfsSetReplication.reserved = 0; strcpy(gpfsHintsKey, "gpfsByteRange");
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_SetReplication); if (flag) {
if (rc != 0) { printf("GPFS Byte Range is set: %s: %s\n", gpfsHintsKey, value);
rc = errno; gpfs_hint_ByteRange.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_ByteRange);
printf( gpfs_hint_ByteRange.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
"gpfs_hints_11 gpfs_fcntl(file handle: %d): Error number is %d, %s\n", gpfs_hint_ByteRange.gpfsFcntlHeader.fcntlReserved = 0;
gpfs_file_handle, rc, strerror(rc));
ret = OMPI_ERROR; token = strtok(value, split);
} gpfs_hint_ByteRange.gpfsByteRange.startOffset = atol(token);
} token = strtok(value, split);
gpfs_hint_ByteRange.gpfsByteRange.numOfBlks = atol(token);
//CN: TODO
//Setting GPFS Hint - gpfsSetStoragePool rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_ByteRange);
if (rc != 0) {
//Setting GPFS Hint - gpfsByteRange rc = errno;
strcpy(gpfsHintsKey, "sioxByteRange"); printf(
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag); "gpfs_hint_ByteRange gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
if (flag) { gpfs_file_handle, rc, strerror(rc));
printf("GPFS Byte Range is set: %s: %s\n", gpfsHintsKey, value); ret = OMPI_ERROR;
gpfs_hint_ByteRange.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_ByteRange); }
gpfs_hint_ByteRange.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; }
gpfs_hint_ByteRange.gpfsFcntlHeader.fcntlReserved = 0;
//Setting GPFS Hint - gpfsRestripeData
token = strtok(value, split); strcpy(gpfsHintsKey, "gpfsRestripeData");
gpfs_hint_ByteRange.gpfsByteRange.startOffset = atol(token); ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag);
token = strtok(value, split); if (flag) {
gpfs_hint_ByteRange.gpfsByteRange.numOfBlks = atol(token); printf("GPFS Restripe Data is set: %s: %s\n", gpfsHintsKey, value);
gpfs_hint_RestripeData.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_RestripeData);
rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_ByteRange); gpfs_hint_RestripeData.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
if (rc != 0) { gpfs_hint_RestripeData.gpfsFcntlHeader.fcntlReserved = 0;
rc = errno;
printf( gpfs_hint_RestripeData.gpfsRestripeData.structLen =
"gpfs_hints_13 gpfs_fcntl(file handle: %d): Error number is %d, %s\n", sizeof(gpfs_hint_RestripeData.gpfsRestripeData);
gpfs_file_handle, rc, strerror(rc)); gpfs_hint_RestripeData.gpfsRestripeData.structType = GPFS_FCNTL_RESTRIPE_DATA;
ret = OMPI_ERROR; token = strtok(value, split);
} gpfs_hint_RestripeData.gpfsRestripeData.options = atoi(token);
} gpfs_hint_RestripeData.gpfsRestripeData.reserved1 = 0;
gpfs_hint_RestripeData.gpfsRestripeData.reserved2 = 0;
//Setting GPFS Hint - gpfsRestripeData
strcpy(gpfsHintsKey, "sioxRestripeData"); rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_RestripeData);
ompi_info_get(info_selected, gpfsHintsKey, valueLen, value, &flag); if (rc != 0) {
if (flag) { rc = errno;
printf("GPFS Restripe Data is set: %s: %s\n", gpfsHintsKey, value); printf(
gpfs_hint_RestripeData.gpfsFcntlHeader.totalLength = sizeof(gpfs_hint_RestripeData); "gpfs_hint_RestripeData gpfs_fcntl(file handle: %d): Error number is %d, %s\n",
gpfs_hint_RestripeData.gpfsFcntlHeader.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; gpfs_file_handle, rc, strerror(rc));
gpfs_hint_RestripeData.gpfsFcntlHeader.fcntlReserved = 0; ret = OMPI_ERROR;
}
gpfs_hint_RestripeData.gpfsRestripeData.structLen = }
sizeof(gpfs_hint_RestripeData.gpfsRestripeData);
gpfs_hint_RestripeData.gpfsRestripeData.structType = GPFS_FCNTL_RESTRIPE_DATA; //CN: TODO
token = strtok(value, split); //Setting GPFS Hint - gpfsRestripeRange
gpfs_hint_RestripeData.gpfsRestripeData.options = atoi(token); //Setting GPFS Hint - gpfsGetReplication
gpfs_hint_RestripeData.gpfsRestripeData.reserved1 = 0; //Setting GPFS Hint - gpfsGetStoragePool
gpfs_hint_RestripeData.gpfsRestripeData.reserved2 = 0; //Setting GPFS Hint - gpfsGetFilesetName
//Setting GPFS Hint - gpfsGetSnapshotName
rc = gpfs_fcntl(gpfs_file_handle, &gpfs_hint_RestripeData); //Setting GPFS Hint - gpfsSetImmutable
if (rc != 0) { //Setting GPFS Hint - gpfsGetImmutable
rc = errno; //Setting GPFS Hint - gpfsSetExpTime
printf( //Setting GPFS Hint - gpfsGetExpTime
"gpfs_hints_14 gpfs_fcntl(file handle: %d): Error number is %d, %s\n", //Setting GPFS Hint - gpfsSetAppendOnly
gpfs_file_handle, rc, strerror(rc)); //Setting GPFS Hint - gpfsGetAppendOnly
ret = OMPI_ERROR;
} return ret;
}
//CN: TODO
//Setting GPFS Hint - gpfsRestripeRange
//Setting GPFS Hint - gpfsGetReplication
//Setting GPFS Hint - gpfsGetStoragePool
//Setting GPFS Hint - gpfsGetFilesetName
//Setting GPFS Hint - gpfsGetSnapshotName
//Setting GPFS Hint - gpfsSetImmutable
//Setting GPFS Hint - gpfsGetImmutable
//Setting GPFS Hint - gpfsSetExpTime
//Setting GPFS Hint - gpfsGetExpTime
//Setting GPFS Hint - gpfsSetAppendOnly
//Setting GPFS Hint - gpfsGetAppendOnly
return ret;
} }
//CN: Will this function set info keys with siox prefix? //CN: Will this function set info keys with siox prefix?