00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "adio.h"
00012
00013 #ifdef HAVE_UNISTD_H
00014 #include <unistd.h>
00015 #endif
00016
00017 #ifdef HAVE_SYS_PARAM_H
00018 #include <sys/param.h>
00019 #endif
00020
00021 #ifdef HAVE_PVFS_H
00022 #include "pvfs.h"
00023 #endif
00024
00025 #ifdef HAVE_PVFS2_H
00026 #include "pvfs2.h"
00027 #endif
00028
00029 #ifdef HAVE_ZOIDFS_H
00030 #include "zoidfs.h"
00031 #endif
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifdef HAVE_STRUCT_STATFS
00045 # ifdef HAVE_SYS_VFS_H
00046 # include <sys/vfs.h>
00047 # endif
00048 # ifdef HAVE_SYS_STATVFS_H
00049 # include <sys/statvfs.h>
00050 # endif
00051 # ifdef HAVE_SYS_PARAM_H
00052 # include <sys/param.h>
00053 # endif
00054 # ifdef HAVE_SYS_MOUNT_H
00055 # include <sys/mount.h>
00056 # endif
00057
00058
00059
00060 # if defined(ROMIO_NFS) && !defined(NFS_SUPER_MAGIC)
00061 # define NFS_SUPER_MAGIC 0x6969
00062 # endif
00063
00064 # if defined(ROMIO_PANFS) && !defined(PAN_KERNEL_FS_CLIENT_SUPER_MAGIC)
00065 # define PAN_KERNEL_FS_CLIENT_SUPER_MAGIC 0xAAD7AAEA
00066 # endif
00067 #endif
00068
00069 # if defined(ROMIO_XFS) && !defined(XFS_SUPER_MAGIC)
00070 # define XFS_SUPER_MAGIC 0x58465342
00071 # endif
00072
00073 #if !defined(PVFS2_SUPER_MAGIC)
00074 #define PVFS2_SUPER_MAGIC (0x20030528)
00075 #endif
00076
00077 #ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
00078 # ifdef HAVE_SYS_STATVFS_H
00079 # include <sys/statvfs.h>
00080 # endif
00081 # ifdef HAVE_SYS_VFS_H
00082 # include <sys/vfs.h>
00083 # endif
00084 # ifdef HAVE_SYS_PARAM_H
00085 # include <sys/param.h>
00086 # endif
00087 # ifdef HAVE_SYS_MOUNT_H
00088 # include <sys/mount.h>
00089 # endif
00090 #endif
00091
00092 #ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE
00093 # ifdef HAVE_SYS_TYPES_H
00094 # include <sys/types.h>
00095 # endif
00096 # ifdef HAVE_SYS_STAT_H
00097 # include <sys/stat.h>
00098 # endif
00099 #endif
00100
00101
00102
00103
00104 #if defined(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE) || \
00105 defined(HAVE_STRUCT_STATFS) || \
00106 defined(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE)
00107 #ifndef ROMIO_NTFS
00108 #define ROMIO_NEEDS_ADIOPARENTDIR
00109 static void ADIO_FileSysType_parentdir(char *filename, char **dirnamep);
00110 #endif
00111 #endif
00112 static void ADIO_FileSysType_prefix(char *filename, int *fstype,
00113 int *error_code);
00114 static void ADIO_FileSysType_fncall(char *filename, int *fstype,
00115 int *error_code);
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 #ifdef ROMIO_NEEDS_ADIOPARENTDIR
00131
00132 #ifndef PATH_MAX
00133 #define PATH_MAX 65535
00134 #endif
00135
00136
00137
00138
00139
00140 #if !defined(S_ISLNK)
00141 # if defined(S_IFLNK)
00142
00143 # define S_ISLNK(mode) ((mode) & S_IFLNK)
00144 # else
00145
00146 # define S_ISLNK(mode) 0
00147 # endif
00148 #endif
00149
00150
00151
00152
00153
00154
00155 static void ADIO_FileSysType_parentdir(char *filename, char **dirnamep)
00156 {
00157 int err;
00158 char *dir = NULL, *slash;
00159 struct stat statbuf;
00160
00161 err = lstat(filename, &statbuf);
00162
00163 if (err || (!S_ISLNK(statbuf.st_mode))) {
00164
00165
00166
00167 dir = ADIOI_Strdup(filename);
00168 }
00169 else {
00170
00171
00172
00173
00174
00175 int namelen;
00176 char *linkbuf;
00177
00178 linkbuf = ADIOI_Malloc(PATH_MAX+1);
00179 namelen = readlink(filename, linkbuf, PATH_MAX+1);
00180 if (namelen == -1) {
00181
00182
00183
00184
00185 dir = ADIOI_Strdup(filename);
00186 }
00187 else {
00188
00189 linkbuf[namelen] = '\0';
00190 dir = ADIOI_Strdup(linkbuf);
00191 ADIOI_Free(linkbuf);
00192 }
00193 }
00194
00195 slash = strrchr(dir, '/');
00196 if (!slash) ADIOI_Strncpy(dir, ".", 2);
00197 else {
00198 if (slash == dir) *(dir + 1) = '\0';
00199 else *slash = '\0';
00200 }
00201
00202 *dirnamep = dir;
00203 return;
00204 }
00205 #endif
00206
00207 #ifdef ROMIO_BGL
00208
00209
00210
00211
00212 extern void ad_bgl_get_env_vars();
00213 extern long bglocklessmpio_f_type;
00214
00215 static void check_for_lockless_exceptions(long stat_type, int *fstype)
00216 {
00217
00218
00219
00220
00221 if (stat_type == bglocklessmpio_f_type)
00222
00223 *fstype = ADIO_BGLOCKLESS;
00224 }
00225 #endif
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243 static void ADIO_FileSysType_fncall(char *filename, int *fstype, int *error_code)
00244 {
00245 #ifndef ROMIO_NTFS
00246 char *dir;
00247 int err;
00248 #endif
00249
00250 #ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
00251 struct statvfs vfsbuf;
00252 #endif
00253 #ifdef HAVE_STRUCT_STATFS
00254 struct statfs fsbuf;
00255 #endif
00256 #ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE
00257 struct stat sbuf;
00258 #endif
00259 static char myname[] = "ADIO_RESOLVEFILETYPE_FNCALL";
00260
00261 *error_code = MPI_SUCCESS;
00262
00263 #ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
00264 do {
00265 err = statvfs(filename, &vfsbuf);
00266 } while (err && (errno == ESTALE));
00267
00268 if (err && (errno == ENOENT)) {
00269
00270
00271
00272
00273
00274
00275 ADIO_FileSysType_parentdir(filename, &dir);
00276 err = statvfs(dir, &vfsbuf);
00277
00278 ADIOI_Free(dir);
00279 }
00280
00281
00282 if (err) {
00283 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00284 myname, __LINE__, MPI_ERR_NO_SUCH_FILE,
00285 "**filename", "**filename %s", filename);
00286 return;
00287 }
00288
00289
00290
00291 if (!strncmp(vfsbuf.f_basetype, "nfs", 3)) {
00292 *fstype = ADIO_NFS;
00293 return;
00294 }
00295 if (!strncmp(vfsbuf.f_basetype, "xfs", 3)) {
00296 *fstype = ADIO_XFS;
00297 return;
00298 }
00299
00300 # ifdef ROMIO_UFS
00301
00302 *fstype = ADIO_UFS;
00303 return;
00304 # endif
00305
00306
00307 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00308 myname, __LINE__, MPI_ERR_NO_SUCH_FILE,
00309 "**filename", "**filename %s", filename);
00310
00311 #endif
00312
00313 #ifdef HAVE_STRUCT_STATFS
00314 do {
00315 err = statfs(filename, &fsbuf);
00316 } while (err && (errno == ESTALE));
00317
00318 if (err && (errno == ENOENT)) {
00319 ADIO_FileSysType_parentdir(filename, &dir);
00320 err = statfs(dir, &fsbuf);
00321 ADIOI_Free(dir);
00322 }
00323
00324
00325 if (err) {
00326 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00327 myname, __LINE__, MPI_ERR_NO_SUCH_FILE,
00328 "**filename", "**filename %s", filename);
00329 return;
00330 }
00331
00332
00333 # ifdef ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME
00334 if ( !strncmp("nfs",fsbuf.f_fstypename,3) ) {
00335 *fstype = ADIO_NFS;
00336 return;
00337 }
00338 # endif
00339
00340 # ifdef ROMIO_BGL
00341
00342
00343
00344
00345 ad_bgl_get_env_vars();
00346
00347 *fstype = ADIO_BGL;
00348 check_for_lockless_exceptions(fsbuf.f_type, fstype);
00349 *error_code = MPI_SUCCESS;
00350 return;
00351 # endif
00352
00353
00354 # ifdef NFS_SUPER_MAGIC
00355 if (fsbuf.f_type == NFS_SUPER_MAGIC) {
00356 *fstype = ADIO_NFS;
00357 return;
00358 }
00359 # endif
00360
00361 #ifdef ROMIO_LUSTRE
00362 # ifndef LL_SUPER_MAGIC
00363 # define LL_SUPER_MAGIC 0x0BD00BD0
00364 # endif
00365 if (fsbuf.f_type == LL_SUPER_MAGIC) {
00366 *fstype = ADIO_LUSTRE;
00367 return;
00368 }
00369 #endif
00370
00371 # ifdef PAN_KERNEL_FS_CLIENT_SUPER_MAGIC
00372 if (fsbuf.f_type == PAN_KERNEL_FS_CLIENT_SUPER_MAGIC) {
00373 *fstype = ADIO_PANFS;
00374 return;
00375 }
00376 # endif
00377
00378 # ifdef MOUNT_NFS
00379 if (fsbuf.f_type == MOUNT_NFS) {
00380 *fstype = ADIO_NFS;
00381 return;
00382 }
00383 # endif
00384
00385 # ifdef MOUNT_PFS
00386 if (fsbuf.f_type == MOUNT_PFS) {
00387 *fstype = ADIO_PFS;
00388 return;
00389 }
00390 # endif
00391
00392 # ifdef PVFS_SUPER_MAGIC
00393 if (fsbuf.f_type == PVFS_SUPER_MAGIC) {
00394 *fstype = ADIO_PVFS;
00395 return;
00396 }
00397 # endif
00398
00399 # ifdef PVFS2_SUPER_MAGIC
00400 if (fsbuf.f_type == PVFS2_SUPER_MAGIC) {
00401 *fstype = ADIO_PVFS2;
00402 return;
00403 }
00404 # endif
00405
00406 # ifdef XFS_SUPER_MAGIC
00407 if (fsbuf.f_type == XFS_SUPER_MAGIC) {
00408 *fstype = ADIO_XFS;
00409 return;
00410 }
00411 # endif
00412
00413 # ifdef ROMIO_UFS
00414
00415 *fstype = ADIO_UFS;
00416 return;
00417 # endif
00418
00419 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00420 myname, __LINE__, MPI_ERR_NO_SUCH_FILE,
00421 "**filename", "**filename %s", filename);
00422
00423 #endif
00424
00425 #ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE
00426 do {
00427 err = stat(filename, &sbuf);
00428 } while (err && (errno == ESTALE));
00429
00430 if (err && (errno == ENOENT)) {
00431 ADIO_FileSysType_parentdir(filename, &dir);
00432 err = stat(dir, &sbuf);
00433 ADIOI_Free(dir);
00434 }
00435
00436 if (err) {
00437
00438 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00439 myname, __LINE__, MPI_ERR_NO_SUCH_FILE,
00440 "**filename", "**filename %s", filename);
00441
00442 return;
00443 }
00444 else {
00445 if (!strcmp(sbuf.st_fstype, "nfs")) *fstype = ADIO_NFS;
00446 else *fstype = ADIO_SFS;
00447 }
00448 #endif
00449
00450 #ifdef ROMIO_NTFS
00451 ADIOI_UNREFERENCED_ARG(filename);
00452 ADIOI_UNREFERENCED_ARG(error_code);
00453 *fstype = ADIO_NTFS;
00454 #elif defined(ROMIO_NFS)
00455 *fstype = ADIO_NFS;
00456 #elif defined(ROMIO_UFS)
00457 *fstype = ADIO_UFS;
00458 #else
00459
00460 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00461 myname, __LINE__, MPI_ERR_NO_SUCH_FILE,
00462 "**filename", "**filename %s", filename);
00463
00464 #endif
00465 }
00466
00467
00468
00469
00470
00471 static void ADIO_FileSysType_fncall_scalable(MPI_Comm comm, char *filename, int * file_system, int * error_code)
00472 {
00473 int rank;
00474 int buf[2];
00475 MPI_Comm_rank(comm, &rank);
00476
00477 if (rank == 0) {
00478 ADIO_FileSysType_fncall(filename, file_system, error_code);
00479 buf[0] = *file_system;
00480 buf[1] = *error_code;
00481 }
00482 MPI_Bcast(buf, 2, MPI_INT, 0, comm);
00483 *file_system = buf[0];
00484 *error_code = buf[1];
00485 }
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505 static void ADIO_FileSysType_prefix(char *filename, int *fstype, int *error_code)
00506 {
00507 static char myname[] = "ADIO_RESOLVEFILETYPE_PREFIX";
00508 *error_code = MPI_SUCCESS;
00509
00510 if (!strncmp(filename, "pfs:", 4) || !strncmp(filename, "PFS:", 4)) {
00511 *fstype = ADIO_PFS;
00512 }
00513 else if (!strncmp(filename, "piofs:", 6) || !strncmp(filename, "PIOFS:", 6)) {
00514 *fstype = ADIO_PIOFS;
00515 }
00516 else if (!strncmp(filename, "ufs:", 4) || !strncmp(filename, "UFS:", 4)) {
00517 *fstype = ADIO_UFS;
00518 }
00519 else if (!strncmp(filename, "nfs:", 4) || !strncmp(filename, "NFS:", 4)) {
00520 *fstype = ADIO_NFS;
00521 }
00522 else if (!strncmp(filename, "panfs:", 6) || !strncmp(filename, "PANFS:", 6)) {
00523 *fstype = ADIO_PANFS;
00524 }
00525 else if (!strncmp(filename, "hfs:", 4) || !strncmp(filename, "HFS:", 4)) {
00526 *fstype = ADIO_HFS;
00527 }
00528 else if (!strncmp(filename, "xfs:", 4) || !strncmp(filename, "XFS:", 4)) {
00529 *fstype = ADIO_XFS;
00530 }
00531 else if (!strncmp(filename, "sfs:", 4) || !strncmp(filename, "SFS:", 4)) {
00532 *fstype = ADIO_SFS;
00533 }
00534 else if (!strncmp(filename, "pvfs:", 5) || !strncmp(filename, "PVFS:", 5)) {
00535 *fstype = ADIO_PVFS;
00536 }
00537 else if (!strncmp(filename, "pvfs2:", 6)||!strncmp(filename, "PVFS2:", 6)) {
00538 *fstype = ADIO_PVFS2;
00539 }
00540 else if (!strncmp(filename, "zoidfs:", 7)||
00541 !strncmp(filename, "ZOIDFS:", 7)) {
00542 *fstype = ADIO_ZOIDFS;
00543 }
00544 else if (!strncmp(filename, "testfs:", 7)
00545 || !strncmp(filename, "TESTFS:", 7))
00546 {
00547 *fstype = ADIO_TESTFS;
00548 }
00549 else if (!strncmp(filename, "ftp:", 4)
00550 || !strncmp(filename, "gsiftp:", 7))
00551 {
00552 *fstype = ADIO_GRIDFTP;
00553 }
00554 else if (!strncmp(filename, "lustre:", 7)
00555 || !strncmp(filename, "LUSTRE:", 7))
00556 {
00557 *fstype = ADIO_LUSTRE;
00558 }
00559 else if (!strncmp(filename, "bgl:", 4) || !strncmp(filename, "BGL:", 4)) {
00560 *fstype = ADIO_BGL;
00561 }
00562 else if (!strncmp(filename, "bglockless:", 11) ||
00563 !strncmp(filename, "BGLOCKLESS:", 11)) {
00564 *fstype = ADIO_BGLOCKLESS;
00565 }
00566 else {
00567 #ifdef ROMIO_NTFS
00568 *fstype = ADIO_NTFS;
00569 #else
00570 *fstype = 0;
00571
00572 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00573 myname, __LINE__, MPI_ERR_NO_SUCH_FILE,
00574 "**filename", "**filename %s", filename);
00575
00576 #endif
00577 }
00578 }
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599 void ADIO_ResolveFileType(MPI_Comm comm, char *filename, int *fstype,
00600 ADIOI_Fns **ops, int *error_code)
00601 {
00602 int myerrcode, file_system, min_code, max_code;
00603 char *tmp;
00604 static char myname[] = "ADIO_RESOLVEFILETYPE";
00605
00606 file_system = -1;
00607 tmp = strchr(filename, ':');
00608 if (!tmp) {
00609 int have_nfs_enabled=0;
00610 *error_code = MPI_SUCCESS;
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629 #ifdef ROMIO_NFS
00630 have_nfs_enabled=1;
00631 #endif
00632 if (!have_nfs_enabled) {
00633 ADIO_FileSysType_fncall_scalable(comm, filename, &file_system, &myerrcode);
00634 if (myerrcode != MPI_SUCCESS) {
00635 *error_code = myerrcode;
00636 return;
00637 }
00638 } else {
00639 ADIO_FileSysType_fncall(filename, &file_system, &myerrcode);
00640 if (myerrcode != MPI_SUCCESS) {
00641 *error_code = myerrcode;
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654 MPI_Allreduce(error_code, &max_code, 1, MPI_INT, MPI_MAX, comm);
00655 if (max_code != MPI_SUCCESS) {
00656 *error_code = max_code;
00657 return;
00658 }
00659
00660 MPI_Allreduce(&file_system, &min_code, 1, MPI_INT,
00661 MPI_MIN, comm);
00662 if (min_code == ADIO_NFS) file_system = ADIO_NFS;
00663 }
00664 }
00665
00666 }
00667 else {
00668
00669
00670
00671
00672
00673 ADIO_FileSysType_prefix(filename, &file_system, &myerrcode);
00674 if (myerrcode != MPI_SUCCESS) {
00675 *error_code = myerrcode;
00676 return;
00677 }
00678 }
00679
00680
00681 if (file_system == ADIO_PFS) {
00682 #ifndef ROMIO_PFS
00683 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00684 myname, __LINE__, MPI_ERR_IO,
00685 "**iofstypeunsupported", 0);
00686 return;
00687 #else
00688 *ops = &ADIO_PFS_operations;
00689 #endif
00690 }
00691 if (file_system == ADIO_PIOFS) {
00692 #ifndef ROMIO_PIOFS
00693 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00694 myname, __LINE__, MPI_ERR_IO,
00695 "**iofstypeunsupported", 0);
00696 return;
00697 #else
00698 *ops = &ADIO_PIOFS_operations;
00699 #endif
00700 }
00701 if (file_system == ADIO_UFS) {
00702 #ifndef ROMIO_UFS
00703 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00704 myname, __LINE__, MPI_ERR_IO,
00705 "**iofstypeunsupported", 0);
00706 return;
00707 #else
00708 *ops = &ADIO_UFS_operations;
00709 #endif
00710 }
00711 if (file_system == ADIO_NFS) {
00712 #ifndef ROMIO_NFS
00713 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00714 myname, __LINE__, MPI_ERR_IO,
00715 "**iofstypeunsupported", 0);
00716 return;
00717 #else
00718 *ops = &ADIO_NFS_operations;
00719 #endif
00720 }
00721 if (file_system == ADIO_PANFS) {
00722 #ifndef ROMIO_PANFS
00723 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00724 myname, __LINE__, MPI_ERR_IO,
00725 "**iofstypeunsupported", 0);
00726 return;
00727 #else
00728 *ops = &ADIO_PANFS_operations;
00729 #endif
00730 }
00731 if (file_system == ADIO_HFS) {
00732 #ifndef ROMIO_HFS
00733 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00734 myname, __LINE__, MPI_ERR_IO,
00735 "**iofstypeunsupported", 0);
00736 return;
00737 #else
00738 *ops = &ADIO_HFS_operations;
00739 #endif
00740 }
00741 if (file_system == ADIO_XFS) {
00742 #ifndef ROMIO_XFS
00743 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00744 myname, __LINE__, MPI_ERR_IO,
00745 "**iofstypeunsupported", 0);
00746 return;
00747 #else
00748 *ops = &ADIO_XFS_operations;
00749 #endif
00750 }
00751 if (file_system == ADIO_SFS) {
00752 #ifndef ROMIO_SFS
00753 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00754 myname, __LINE__, MPI_ERR_IO,
00755 "**iofstypeunsupported", 0);
00756 return;
00757 #else
00758 *ops = &ADIO_SFS_operations;
00759 #endif
00760 }
00761 if (file_system == ADIO_PVFS) {
00762 #ifndef ROMIO_PVFS
00763 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00764 myname, __LINE__, MPI_ERR_IO,
00765 "**iofstypeunsupported", 0);
00766 return;
00767 #else
00768 *ops = &ADIO_PVFS_operations;
00769 #endif
00770 }
00771 if (file_system == ADIO_PVFS2) {
00772 #ifndef ROMIO_PVFS2
00773 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00774 myname, __LINE__, MPI_ERR_IO,
00775 "**iofstypeunsupported", 0);
00776 return;
00777 #else
00778 *ops = &ADIO_PVFS2_operations;
00779 #endif
00780 }
00781 if (file_system == ADIO_NTFS) {
00782 #ifndef ROMIO_NTFS
00783 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00784 myname, __LINE__, MPI_ERR_IO,
00785 "**iofstypeunsupported", 0);
00786 return;
00787 #else
00788 *ops = &ADIO_NTFS_operations;
00789 #endif
00790 }
00791 if (file_system == ADIO_TESTFS) {
00792 #ifndef ROMIO_TESTFS
00793 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00794 myname, __LINE__, MPI_ERR_IO,
00795 "**iofstypeunsupported", 0);
00796 return;
00797 #else
00798 *ops = &ADIO_TESTFS_operations;
00799 #endif
00800 }
00801 if (file_system == ADIO_BGL) {
00802 #ifndef ROMIO_BGL
00803 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00804 myname, __LINE__, MPI_ERR_IO,
00805 "**iofstypeunsupported", 0);
00806 return;
00807 #else
00808 *ops = &ADIO_BGL_operations;
00809 #endif
00810 }
00811 if (file_system == ADIO_BGLOCKLESS) {
00812 #ifndef ROMIO_BGLOCKLESS
00813 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00814 myname, __LINE__, MPI_ERR_IO,
00815 "**iofstypeunsupported", 0);
00816 return;
00817 #else
00818 *ops = &ADIO_BGLOCKLESS_operations;
00819 #endif
00820 }
00821
00822 if (file_system == ADIO_GRIDFTP) {
00823 #ifndef ROMIO_GRIDFTP
00824 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00825 myname, __LINE__, MPI_ERR_IO,
00826 "**iofstypeunsupported", 0);
00827 return;
00828 #else
00829 *ops = &ADIO_GRIDFTP_operations;
00830 #endif
00831 }
00832 if (file_system == ADIO_LUSTRE) {
00833 #ifndef ROMIO_LUSTRE
00834 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**iofstypeunsupported", 0);
00835 return;
00836 #else
00837 *ops = &ADIO_LUSTRE_operations;
00838 #endif
00839 }
00840 if (file_system == ADIO_ZOIDFS) {
00841 #ifndef ROMIO_ZOIDFS
00842 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00843 myname, __LINE__, MPI_ERR_IO,
00844 "**iofstypeunsupported", 0);
00845 return;
00846 #else
00847 *ops = &ADIO_ZOIDFS_operations;
00848 #endif
00849 }
00850 *error_code = MPI_SUCCESS;
00851 *fstype = file_system;
00852 return;
00853 }
00854
00855
00856