root/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_hints.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_PVFS2_SetInfo

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /* 
   3  *
   4  *   Copyright (C) 1997 University of Chicago. 
   5  *   See COPYRIGHT notice in top-level directory.
   6  */
   7 
   8 #include <stdlib.h>
   9 #include "ad_pvfs2.h"
  10 
  11 #include "hint_fns.h"
  12 
  13 void ADIOI_PVFS2_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
  14 {
  15     char *value;
  16     int flag, tmp_value;
  17     static char myname[] = "ADIOI_PVFS_SETINFO";
  18 
  19     if ((fd->info) == MPI_INFO_NULL) {
  20         /* part of the open call */
  21         MPI_Info_create(&(fd->info));
  22         ADIOI_Info_set(fd->info, "romio_pvfs2_debugmask", "0");
  23         fd->hints->fs_hints.pvfs2.debugmask = 0;
  24 
  25         ADIOI_Info_set(fd->info, "striping_factor", "0");
  26         fd->hints->striping_factor = 0;
  27 
  28         ADIOI_Info_set(fd->info, "striping_unit", "0");
  29         fd->hints->striping_unit = 0;
  30 
  31         /* disable the aggressive strided optimizations by default */
  32         ADIOI_Info_set(fd->info, "romio_pvfs2_posix_read", "disable");
  33         ADIOI_Info_set(fd->info, "romio_pvfs2_posix_write", "disable");
  34         fd->hints->fs_hints.pvfs2.posix_read = ADIOI_HINT_DISABLE;
  35         fd->hints->fs_hints.pvfs2.posix_write = ADIOI_HINT_DISABLE;
  36 
  37         ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_read", "disable");
  38         ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_write", "disable");
  39         fd->hints->fs_hints.pvfs2.dtype_read = ADIOI_HINT_DISABLE;
  40         fd->hints->fs_hints.pvfs2.dtype_write = ADIOI_HINT_DISABLE;
  41 
  42         ADIOI_Info_set(fd->info, "romio_pvfs2_listio_read", "disable");
  43         ADIOI_Info_set(fd->info, "romio_pvfs2_listio_write", "disable");
  44         fd->hints->fs_hints.pvfs2.listio_read = ADIOI_HINT_DISABLE;
  45         fd->hints->fs_hints.pvfs2.listio_write = ADIOI_HINT_DISABLE;
  46 
  47         
  48         /* any user-provided hints? */
  49         if (users_info != MPI_INFO_NULL) {
  50             value = (char *) ADIOI_Malloc( (MPI_MAX_INFO_VAL+1)*sizeof(char));
  51             /* pvfs2 debugging */
  52             ADIOI_Info_get(users_info, "romio_pvfs2_debugmask", 
  53                     MPI_MAX_INFO_VAL, value, &flag);
  54             if (flag) {
  55                 tmp_value = fd->hints->fs_hints.pvfs2.debugmask = 
  56                     PVFS_debug_eventlog_to_mask(value);
  57 
  58                 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
  59                 /* --BEGIN ERROR HANDLING-- */
  60                 if (tmp_value != fd->hints->fs_hints.pvfs2.debugmask) {
  61                     MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
  62                                                        "romio_pvfs2_debugmask",
  63                                                        error_code);
  64                     return;
  65                 }
  66                 /* --END ERROR HANDLING-- */
  67                 
  68                 ADIOI_Info_set(fd->info, "romio_pvfs2_debugmask", value);
  69             }
  70 
  71             /* the striping factor */
  72             ADIOI_Info_check_and_install_int(fd, users_info, "striping_factor",
  73                     &(fd->hints->striping_factor), myname, error_code);
  74 
  75 
  76             /* the striping unit */
  77             ADIOI_Info_check_and_install_int(fd, users_info, "striping_unit",
  78                     &(fd->hints->striping_unit), myname, error_code);
  79 
  80             /* distribution name */
  81             ADIOI_Info_get(users_info, "romio_pvfs2_distribution_name",
  82                     MPI_MAX_INFO_VAL, value, &flag);
  83             if (flag) {
  84             }
  85 
  86             /* POSIX read */
  87             ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_posix_read",
  88                     &(fd->hints->fs_hints.pvfs2.posix_read), myname, error_code);
  89 
  90             /* POSIX write */
  91             ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_posix_write",
  92                     &(fd->hints->fs_hints.pvfs2.posix_write), myname, error_code);
  93 
  94             /* Datatype read */
  95             ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_dtype_read",
  96                     &(fd->hints->fs_hints.pvfs2.dtype_read), myname, error_code);
  97 
  98             /* Datatype write */
  99             ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_dtype_write",
 100                     &(fd->hints->fs_hints.pvfs2.dtype_write), myname, error_code);
 101 
 102             /* Listio read */
 103             ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_listio_read",
 104                     &(fd->hints->fs_hints.pvfs2.listio_read), myname, error_code);
 105 
 106             /* Datatype write */
 107             ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_listio_write",
 108                     &(fd->hints->fs_hints.pvfs2.listio_write), myname, error_code);
 109             ADIOI_Free(value);
 110         }
 111     }
 112     /* set the values for collective I/O and data sieving parameters */
 113     ADIOI_GEN_SetInfo(fd, users_info, error_code);
 114 
 115     *error_code = MPI_SUCCESS;
 116 }
 117 
 118 /*
 119  * vim: ts=8 sts=4 sw=4 noexpandtab
 120  */

/* [<][>][^][v][top][bottom][index][help] */