00001
00002
00003
00004
00005
00006
00007
00008 #include <stdlib.h>
00009 #include "ad_pvfs2.h"
00010
00011 void ADIOI_PVFS2_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
00012 {
00013 char *value;
00014 int flag, tmp_value;
00015 static char myname[] = "ADIOI_PVFS_SETINFO";
00016
00017 if ((fd->info) == MPI_INFO_NULL) {
00018
00019 MPI_Info_create(&(fd->info));
00020 ADIOI_Info_set(fd->info, "romio_pvfs2_debugmask", "0");
00021 fd->hints->fs_hints.pvfs2.debugmask = 0;
00022
00023 ADIOI_Info_set(fd->info, "striping_factor", "0");
00024 fd->hints->striping_factor = 0;
00025
00026 ADIOI_Info_set(fd->info, "striping_unit", "0");
00027 fd->hints->striping_unit = 0;
00028
00029
00030 ADIOI_Info_set(fd->info, "romio_pvfs2_posix_read", "disable");
00031 ADIOI_Info_set(fd->info, "romio_pvfs2_posix_write", "disable");
00032 fd->hints->fs_hints.pvfs2.posix_read = ADIOI_HINT_DISABLE;
00033 fd->hints->fs_hints.pvfs2.posix_write = ADIOI_HINT_DISABLE;
00034
00035 ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_read", "disable");
00036 ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_write", "disable");
00037 fd->hints->fs_hints.pvfs2.dtype_read = ADIOI_HINT_DISABLE;
00038 fd->hints->fs_hints.pvfs2.dtype_write = ADIOI_HINT_DISABLE;
00039
00040 ADIOI_Info_set(fd->info, "romio_pvfs2_listio_read", "disable");
00041 ADIOI_Info_set(fd->info, "romio_pvfs2_listio_write", "disable");
00042 fd->hints->fs_hints.pvfs2.listio_read = ADIOI_HINT_DISABLE;
00043 fd->hints->fs_hints.pvfs2.listio_write = ADIOI_HINT_DISABLE;
00044
00045
00046
00047 if (users_info != MPI_INFO_NULL) {
00048
00049 value = (char *) ADIOI_Malloc( (MPI_MAX_INFO_VAL+1)*sizeof(char));
00050 ADIOI_Info_get(users_info, "romio_pvfs2_debugmask",
00051 MPI_MAX_INFO_VAL, value, &flag);
00052 if (flag) {
00053 tmp_value = fd->hints->fs_hints.pvfs2.debugmask =
00054 PVFS_debug_eventlog_to_mask(value);
00055
00056 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
00057
00058 if (tmp_value != fd->hints->fs_hints.pvfs2.debugmask) {
00059 MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
00060 "romio_pvfs2_debugmask",
00061 error_code);
00062 return;
00063 }
00064
00065
00066 ADIOI_Info_set(fd->info, "romio_pvfs2_debugmask", value);
00067 }
00068
00069
00070 ADIOI_Info_get(users_info, "striping_factor",
00071 MPI_MAX_INFO_VAL, value, &flag);
00072 if (flag) {
00073 tmp_value = fd->hints->striping_factor = atoi(value);
00074
00075 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
00076
00077 if (tmp_value != fd->hints->striping_factor) {
00078 MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
00079 "striping_factor",
00080 error_code);
00081 return;
00082 }
00083
00084
00085 ADIOI_Info_set(fd->info, "striping_factor", value);
00086 }
00087
00088
00089 ADIOI_Info_get(users_info, "striping_unit",
00090 MPI_MAX_INFO_VAL, value, &flag);
00091 if (flag) {
00092 tmp_value = fd->hints->striping_unit = atoi(value);
00093 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
00094
00095 if (tmp_value != fd->hints->striping_unit) {
00096 MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
00097 "striping_unit",
00098 error_code);
00099 return;
00100 }
00101
00102
00103 ADIOI_Info_set(fd->info, "striping_unit", value);
00104 }
00105
00106
00107 ADIOI_Info_get(users_info, "romio_pvfs2_distribution_name",
00108 MPI_MAX_INFO_VAL, value, &flag);
00109 if (flag) {
00110 }
00111
00112
00113
00114 ADIOI_Info_get(users_info, "romio_pvfs2_posix_read",
00115 MPI_MAX_INFO_VAL, value, &flag);
00116 if (flag) {
00117 if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE"))
00118 {
00119 ADIOI_Info_set(fd->info, "romio_pvfs2_posix_read", value);
00120 fd->hints->fs_hints.pvfs2.posix_read = ADIOI_HINT_ENABLE;
00121 }
00122 else if ( !strcmp(value, "disable") ||
00123 !strcmp(value, "DISABLE"))
00124 {
00125 ADIOI_Info_set(fd->info , "romio_pvfs2_posix_read", value);
00126 fd->hints->fs_hints.pvfs2.posix_read = ADIOI_HINT_DISABLE;
00127 }
00128 tmp_value = fd->hints->fs_hints.pvfs2.posix_read;
00129 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
00130 if (tmp_value != fd->hints->fs_hints.pvfs2.posix_read) {
00131 MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
00132 "posix_read",
00133 error_code);
00134 return;
00135 }
00136 }
00137
00138
00139 ADIOI_Info_get(users_info, "romio_pvfs2_posix_write",
00140 MPI_MAX_INFO_VAL, value, &flag);
00141 if (flag) {
00142 if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE"))
00143 {
00144 ADIOI_Info_set(fd->info, "romio_pvfs2_posix_write", value);
00145 fd->hints->fs_hints.pvfs2.posix_write = ADIOI_HINT_ENABLE;
00146 }
00147 else if ( !strcmp(value, "disable") ||
00148 !strcmp(value, "DISABLE"))
00149 {
00150 ADIOI_Info_set(fd->info , "romio_pvfs2_posix_write", value);
00151 fd->hints->fs_hints.pvfs2.posix_write = ADIOI_HINT_DISABLE;
00152 }
00153 tmp_value = fd->hints->fs_hints.pvfs2.posix_write;
00154 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
00155 if (tmp_value != fd->hints->fs_hints.pvfs2.posix_write) {
00156 MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
00157 "posix_write",
00158 error_code);
00159 return;
00160 }
00161 }
00162
00163
00164 ADIOI_Info_get(users_info, "romio_pvfs2_dtype_read",
00165 MPI_MAX_INFO_VAL, value, &flag);
00166 if (flag) {
00167 if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE"))
00168 {
00169 ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_read", value);
00170 fd->hints->fs_hints.pvfs2.dtype_read = ADIOI_HINT_ENABLE;
00171 }
00172 else if ( !strcmp(value, "disable") ||
00173 !strcmp(value, "DISABLE"))
00174 {
00175 ADIOI_Info_set(fd->info , "romio_pvfs2_dtype_read", value);
00176 fd->hints->fs_hints.pvfs2.dtype_read = ADIOI_HINT_DISABLE;
00177 }
00178 tmp_value = fd->hints->fs_hints.pvfs2.dtype_read;
00179 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
00180 if (tmp_value != fd->hints->fs_hints.pvfs2.dtype_read) {
00181 MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
00182 "dtype_read",
00183 error_code);
00184 return;
00185 }
00186 }
00187
00188
00189 ADIOI_Info_get(users_info, "romio_pvfs2_dtype_write",
00190 MPI_MAX_INFO_VAL, value, &flag);
00191 if (flag) {
00192 if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE"))
00193 {
00194 ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_write", value);
00195 fd->hints->fs_hints.pvfs2.dtype_write = ADIOI_HINT_ENABLE;
00196 }
00197 else if ( !strcmp(value, "disable") ||
00198 !strcmp(value, "DISABLE"))
00199 {
00200 ADIOI_Info_set(fd->info , "romio_pvfs2_dtype_write", value);
00201 fd->hints->fs_hints.pvfs2.dtype_write = ADIOI_HINT_DISABLE;
00202 }
00203 tmp_value = fd->hints->fs_hints.pvfs2.dtype_write;
00204 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
00205 if (tmp_value != fd->hints->fs_hints.pvfs2.dtype_write) {
00206 MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
00207 "dtype_write",
00208 error_code);
00209 return;
00210 }
00211 }
00212
00213
00214 ADIOI_Info_get(users_info, "romio_pvfs2_listio_read",
00215 MPI_MAX_INFO_VAL, value, &flag);
00216 if (flag) {
00217 if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE"))
00218 {
00219 ADIOI_Info_set(fd->info, "romio_pvfs2_listio_read", value);
00220 fd->hints->fs_hints.pvfs2.listio_read = ADIOI_HINT_ENABLE;
00221 }
00222 else if ( !strcmp(value, "disable") ||
00223 !strcmp(value, "DISABLE"))
00224 {
00225 ADIOI_Info_set(fd->info , "romio_pvfs2_listio_read", value);
00226 fd->hints->fs_hints.pvfs2.listio_read = ADIOI_HINT_DISABLE;
00227 }
00228 tmp_value = fd->hints->fs_hints.pvfs2.listio_read;
00229 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
00230 if (tmp_value != fd->hints->fs_hints.pvfs2.listio_read) {
00231 MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
00232 "listio_read",
00233 error_code);
00234 return;
00235 }
00236 }
00237
00238
00239 ADIOI_Info_get(users_info, "romio_pvfs2_listio_write",
00240 MPI_MAX_INFO_VAL, value, &flag);
00241 if (flag) {
00242 if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE"))
00243 {
00244 ADIOI_Info_set(fd->info, "romio_pvfs2_listio_write", value);
00245 fd->hints->fs_hints.pvfs2.listio_write = ADIOI_HINT_ENABLE;
00246 }
00247 else if ( !strcmp(value, "disable") ||
00248 !strcmp(value, "DISABLE"))
00249 {
00250 ADIOI_Info_set(fd->info , "romio_pvfs2_listio_write", value);
00251 fd->hints->fs_hints.pvfs2.listio_write = ADIOI_HINT_DISABLE;
00252 }
00253 tmp_value = fd->hints->fs_hints.pvfs2.listio_write;
00254 MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
00255 if (tmp_value != fd->hints->fs_hints.pvfs2.listio_write) {
00256 MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
00257 "listio_write",
00258 error_code);
00259 return;
00260 }
00261 }
00262 ADIOI_Free(value);
00263
00264 }
00265 }
00266
00267 ADIOI_GEN_SetInfo(fd, users_info, error_code);
00268
00269 *error_code = MPI_SUCCESS;
00270 }
00271
00272
00273
00274