1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
3 * Copyright (C) 1997 University of Chicago.
4 * See COPYRIGHT notice in top-level directory.
7 /* This file is quickly becoming the single one, outside the ADIO
8 * implementations, which has "what ADIO components are built in" code in it.
17 #ifdef HAVE_SYS_PARAM_H
18 #include <sys/param.h>
33 /* Notes on detection process:
35 * There are three more "general" mechanisms that we use for detecting
37 * - struct statfs's f_type field
38 * - struct statvfs's f_basetype field
39 * - struct stat's st_fstype field
41 * Otherwise we'll fall back on some OS-specific approach.
44 #ifdef HAVE_STRUCT_STATFS
45 # ifdef HAVE_SYS_VFS_H
48 # ifdef HAVE_SYS_STATVFS_H
49 # include <sys/statvfs.h>
51 # ifdef HAVE_SYS_PARAM_H
52 # include <sys/param.h>
54 # ifdef HAVE_SYS_MOUNT_H
55 # include <sys/mount.h>
57 /* On Linux platforms, linux/nfs_fs.h is all messed up and cannot be
60 # if defined(ROMIO_NFS) && !defined(NFS_SUPER_MAGIC)
61 # define NFS_SUPER_MAGIC 0x6969
64 # if defined(ROMIO_PANFS) && !defined(PAN_KERNEL_FS_CLIENT_SUPER_MAGIC)
65 # define PAN_KERNEL_FS_CLIENT_SUPER_MAGIC 0xAAD7AAEA
69 # if defined(ROMIO_XFS) && !defined(XFS_SUPER_MAGIC)
70 # define XFS_SUPER_MAGIC 0x58465342
73 #if !defined(PVFS2_SUPER_MAGIC)
74 #define PVFS2_SUPER_MAGIC (0x20030528)
77 #ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
78 # ifdef HAVE_SYS_STATVFS_H
79 # include <sys/statvfs.h>
81 # ifdef HAVE_SYS_VFS_H
84 # ifdef HAVE_SYS_PARAM_H
85 # include <sys/param.h>
87 # ifdef HAVE_SYS_MOUNT_H
88 # include <sys/mount.h>
92 #ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE
93 # ifdef HAVE_SYS_TYPES_H
94 # include <sys/types.h>
96 # ifdef HAVE_SYS_STAT_H
97 # include <sys/stat.h>
101 /* ADIO_FileSysType_parentdir is only used if one of these is defined.
102 By including this test, we avoid warnings about unused static functions
104 #if defined(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE) || \
105 defined(HAVE_STRUCT_STATFS) || \
106 defined(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE)
108 #define ROMIO_NEEDS_ADIOPARENTDIR
109 static void ADIO_FileSysType_parentdir(char *filename
, char **dirnamep
);
112 static void ADIO_FileSysType_prefix(char *filename
, int *fstype
,
114 static void ADIO_FileSysType_fncall(char *filename
, int *fstype
,
118 ADIO_FileSysType_parentdir - determines a string pathname for the
119 parent directory of a given filename.
122 . filename - pointer to file name character array
125 . dirnamep - pointer to location in which to store a pointer to a string
127 Note that the caller should free the memory located at the pointer returned
128 after the string is no longer needed.
130 #ifdef ROMIO_NEEDS_ADIOPARENTDIR
133 #define PATH_MAX 65535
136 /* In a strict ANSI environment, S_ISLNK may not be defined. Fix that
137 here. We assume that S_ISLNK is *always* defined as a macro. If
138 that is not universally true, then add a test to the romio
139 configure that trys to link a program that references S_ISLNK */
140 #if !defined(S_ISLNK)
141 # if defined(S_IFLNK)
142 /* Check for the link bit */
143 # define S_ISLNK(mode) ((mode) & S_IFLNK)
145 /* no way to check if it is a link, so say false */
146 # define S_ISLNK(mode) 0
148 #endif /* !(S_ISLNK) */
150 /* ADIO_FileSysType_parentdir
152 * Returns pointer to string in dirnamep; that string is allocated with
153 * strdup and must be free()'d.
155 static void ADIO_FileSysType_parentdir(char *filename
, char **dirnamep
)
158 char *dir
= NULL
, *slash
;
161 err
= lstat(filename
, &statbuf
);
163 if (err
|| (!S_ISLNK(statbuf
.st_mode
))) {
164 /* no such file, or file is not a link; these are the "normal"
165 * cases where we can just return the parent directory.
167 dir
= ADIOI_Strdup(filename
);
170 /* filename is a symlink. we've presumably already tried
171 * to stat it and found it to be missing (dangling link),
172 * but this code doesn't care if the target is really there
178 linkbuf
= ADIOI_Malloc(PATH_MAX
+1);
179 namelen
= readlink(filename
, linkbuf
, PATH_MAX
+1);
181 /* something strange has happened between the time that
182 * we determined that this was a link and the time that
183 * we attempted to read it; punt and use the old name.
185 dir
= ADIOI_Strdup(filename
);
188 /* successfully read the link */
189 linkbuf
[namelen
] = '\0'; /* readlink doesn't null terminate */
190 dir
= ADIOI_Strdup(linkbuf
);
195 slash
= strrchr(dir
, '/');
196 if (!slash
) ADIOI_Strncpy(dir
, ".", 2);
198 if (slash
== dir
) *(dir
+ 1) = '\0';
205 #endif /* ROMIO_NTFS */
207 #ifdef ROMIO_BGL /* BlueGene support for lockless i/o (necessary for PVFS.
208 possibly beneficial for others, unless data sieving
211 /* BlueGene environment variables can override lockless selection.*/
212 extern void ad_bgl_get_env_vars();
213 extern long bglocklessmpio_f_type
;
215 static void check_for_lockless_exceptions(long stat_type
, int *fstype
)
217 /* exception for lockless file systems. (PVFS2 is the default in ad_bgl_tuning.)
218 * The BGLOCKLESS_F_TYPE environment variable will override it by specifying
219 * the appropriate file system magic number here.
221 if (stat_type
== bglocklessmpio_f_type
)
222 /* use lock-free driver on bluegene to support specified fs (defaults to pvfs2) */
223 *fstype
= ADIO_BGLOCKLESS
;
227 ADIO_FileSysType_fncall - determines the file system type for a given file
228 using a system-dependent function call
231 . filename - pointer to file name character array
234 . fstype - location in which to store file system type (ADIO_XXX)
235 . error_code - location in which to store error code
237 MPI_SUCCESS is stored in the location pointed to by error_code on success.
239 This function is used by MPI_File_open() and MPI_File_delete() to determine
240 file system type. Most other functions use the type which is stored when the
243 static void ADIO_FileSysType_fncall(char *filename
, int *fstype
, int *error_code
)
250 #ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
251 struct statvfs vfsbuf
;
253 #ifdef HAVE_STRUCT_STATFS
256 #ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE
259 static char myname
[] = "ADIO_RESOLVEFILETYPE_FNCALL";
261 *error_code
= MPI_SUCCESS
;
263 #ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
265 err
= statvfs(filename
, &vfsbuf
);
266 } while (err
&& (errno
== ESTALE
));
268 if (err
&& (errno
== ENOENT
)) {
269 /* ENOENT may be returned in two cases:
270 * 1) no directory entry for "filename"
271 * 2) "filename" is a dangling symbolic link
273 * ADIO_FileSysType_parentdir tries to deal with both cases.
275 ADIO_FileSysType_parentdir(filename
, &dir
);
276 err
= statvfs(dir
, &vfsbuf
);
281 /* --BEGIN ERROR HANDLING-- */
283 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
284 myname
, __LINE__
, MPI_ERR_NO_SUCH_FILE
,
285 "**filename", "**filename %s", filename
);
288 /* --END ERROR HANDLING-- */
290 /* FPRINTF(stderr, "%s\n", vfsbuf.f_basetype); */
291 if (!strncmp(vfsbuf
.f_basetype
, "nfs", 3)) {
295 if (!strncmp(vfsbuf
.f_basetype
, "xfs", 3)) {
301 /* if UFS support is enabled, default to that */
306 /* --BEGIN ERROR HANDLING-- */
307 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
308 myname
, __LINE__
, MPI_ERR_NO_SUCH_FILE
,
309 "**filename", "**filename %s", filename
);
310 /* --END ERROR HANDLING-- */
311 #endif /* STATVFS APPROACH */
313 #ifdef HAVE_STRUCT_STATFS
315 err
= statfs(filename
, &fsbuf
);
316 } while (err
&& (errno
== ESTALE
));
318 if (err
&& (errno
== ENOENT
)) {
319 ADIO_FileSysType_parentdir(filename
, &dir
);
320 err
= statfs(dir
, &fsbuf
);
324 /* --BEGIN ERROR HANDLING-- */
326 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
327 myname
, __LINE__
, MPI_ERR_NO_SUCH_FILE
,
328 "**filename", "**filename %s", filename
);
331 /* --END ERROR HANDLING-- */
333 # ifdef ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME
334 if ( !strncmp("nfs",fsbuf
.f_fstypename
,3) ) {
341 /* BlueGene is a special case: all file systems are AD_BGL, except for
342 * certain exceptions */
344 /* Bluegene needs to read enviroment variables before selecting the file system*/
345 ad_bgl_get_env_vars();
348 check_for_lockless_exceptions(fsbuf
.f_type
, fstype
);
349 *error_code
= MPI_SUCCESS
;
353 /* FPRINTF(stderr, "%d\n", fsbuf.f_type);*/
354 # ifdef NFS_SUPER_MAGIC
355 if (fsbuf
.f_type
== NFS_SUPER_MAGIC
) {
362 # ifndef LL_SUPER_MAGIC
363 # define LL_SUPER_MAGIC 0x0BD00BD0
365 if (fsbuf
.f_type
== LL_SUPER_MAGIC
) {
366 *fstype
= ADIO_LUSTRE
;
371 # ifdef PAN_KERNEL_FS_CLIENT_SUPER_MAGIC
372 if (fsbuf
.f_type
== PAN_KERNEL_FS_CLIENT_SUPER_MAGIC
) {
373 *fstype
= ADIO_PANFS
;
379 if (fsbuf
.f_type
== MOUNT_NFS
) {
386 if (fsbuf
.f_type
== MOUNT_PFS
) {
392 # ifdef PVFS_SUPER_MAGIC
393 if (fsbuf
.f_type
== PVFS_SUPER_MAGIC
) {
399 # ifdef PVFS2_SUPER_MAGIC
400 if (fsbuf
.f_type
== PVFS2_SUPER_MAGIC
) {
401 *fstype
= ADIO_PVFS2
;
406 # ifdef XFS_SUPER_MAGIC
407 if (fsbuf
.f_type
== XFS_SUPER_MAGIC
) {
414 /* if UFS support is enabled, default to that */
418 /* --BEGIN ERROR HANDLING-- */
419 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
420 myname
, __LINE__
, MPI_ERR_NO_SUCH_FILE
,
421 "**filename", "**filename %s", filename
);
422 /* --END ERROR HANDLING-- */
423 #endif /* STATFS APPROACH */
425 #ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE
427 err
= stat(filename
, &sbuf
);
428 } while (err
&& (errno
== ESTALE
));
430 if (err
&& (errno
== ENOENT
)) {
431 ADIO_FileSysType_parentdir(filename
, &dir
);
432 err
= stat(dir
, &sbuf
);
437 /* --BEGIN ERROR HANDLING-- */
438 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
439 myname
, __LINE__
, MPI_ERR_NO_SUCH_FILE
,
440 "**filename", "**filename %s", filename
);
441 /* --END ERROR HANDLING-- */
445 if (!strcmp(sbuf
.st_fstype
, "nfs")) *fstype
= ADIO_NFS
;
446 else *fstype
= ADIO_SFS
; /* assuming SX4 for now */
448 #endif /* STAT APPROACH */
451 ADIOI_UNREFERENCED_ARG(filename
);
452 ADIOI_UNREFERENCED_ARG(error_code
);
453 *fstype
= ADIO_NTFS
; /* only supported FS on Windows */
454 #elif defined(ROMIO_NFS)
456 #elif defined(ROMIO_UFS)
459 /* --BEGIN ERROR HANDLING-- */
460 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
461 myname
, __LINE__
, MPI_ERR_NO_SUCH_FILE
,
462 "**filename", "**filename %s", filename
);
463 /* --END ERROR HANDLING-- */
467 /* all proceeses opening, creating, or deleting a file end up invoking several
468 * stat system calls (unless a fs prefix is given). Cary out this file system
469 * detection in a more scalable way by having rank 0 stat the file and broadcast the result (fs type and error code) to the other mpi processes */
471 static void ADIO_FileSysType_fncall_scalable(MPI_Comm comm
, char *filename
, int * file_system
, int * error_code
)
475 MPI_Comm_rank(comm
, &rank
);
478 ADIO_FileSysType_fncall(filename
, file_system
, error_code
);
479 buf
[0] = *file_system
;
480 buf
[1] = *error_code
;
482 MPI_Bcast(buf
, 2, MPI_INT
, 0, comm
);
483 *file_system
= buf
[0];
484 *error_code
= buf
[1];
490 ADIO_FileSysType_prefix - determines file system type for a file using
491 a prefix on the file name. upper layer should have already determined
492 that a prefix is present.
495 . filename - path to file, including prefix (xxx:)
498 . fstype - pointer to integer in which to store file system type (ADIO_XXX)
499 . error_code - pointer to integer in which to store error code
501 Returns MPI_SUCCESS in error_code on success. Filename not having a prefix
502 is considered an error. Except for on Windows systems where the default is NTFS.
505 static void ADIO_FileSysType_prefix(char *filename
, int *fstype
, int *error_code
)
507 static char myname
[] = "ADIO_RESOLVEFILETYPE_PREFIX";
508 *error_code
= MPI_SUCCESS
;
510 if (!strncmp(filename
, "pfs:", 4) || !strncmp(filename
, "PFS:", 4)) {
513 else if (!strncmp(filename
, "piofs:", 6) || !strncmp(filename
, "PIOFS:", 6)) {
514 *fstype
= ADIO_PIOFS
;
516 else if (!strncmp(filename
, "ufs:", 4) || !strncmp(filename
, "UFS:", 4)) {
519 else if (!strncmp(filename
, "nfs:", 4) || !strncmp(filename
, "NFS:", 4)) {
522 else if (!strncmp(filename
, "panfs:", 6) || !strncmp(filename
, "PANFS:", 6)) {
523 *fstype
= ADIO_PANFS
;
525 else if (!strncmp(filename
, "hfs:", 4) || !strncmp(filename
, "HFS:", 4)) {
528 else if (!strncmp(filename
, "xfs:", 4) || !strncmp(filename
, "XFS:", 4)) {
531 else if (!strncmp(filename
, "sfs:", 4) || !strncmp(filename
, "SFS:", 4)) {
534 else if (!strncmp(filename
, "pvfs:", 5) || !strncmp(filename
, "PVFS:", 5)) {
537 else if (!strncmp(filename
, "pvfs2:", 6)||!strncmp(filename
, "PVFS2:", 6)) {
538 *fstype
= ADIO_PVFS2
;
540 else if (!strncmp(filename
, "zoidfs:", 7)||
541 !strncmp(filename
, "ZOIDFS:", 7)) {
542 *fstype
= ADIO_ZOIDFS
;
544 else if (!strncmp(filename
, "testfs:", 7)
545 || !strncmp(filename
, "TESTFS:", 7))
547 *fstype
= ADIO_TESTFS
;
549 else if (!strncmp(filename
, "ftp:", 4)
550 || !strncmp(filename
, "gsiftp:", 7))
552 *fstype
= ADIO_GRIDFTP
;
554 else if (!strncmp(filename
, "lustre:", 7)
555 || !strncmp(filename
, "LUSTRE:", 7))
557 *fstype
= ADIO_LUSTRE
;
559 else if (!strncmp(filename
, "bgl:", 4) || !strncmp(filename
, "BGL:", 4)) {
562 else if (!strncmp(filename
, "bglockless:", 11) ||
563 !strncmp(filename
, "BGLOCKLESS:", 11)) {
564 *fstype
= ADIO_BGLOCKLESS
;
571 /* --BEGIN ERROR HANDLING-- */
572 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
573 myname
, __LINE__
, MPI_ERR_NO_SUCH_FILE
,
574 "**filename", "**filename %s", filename
);
575 /* --END ERROR HANDLING-- */
581 ADIO_ResolveFileType - determines file system type and operations from
582 file name string; this is a collective call
585 . comm - communicator across which collective open is performed
586 . filename - name of file (string)
589 . fstype - (pointer to) int holding file system type
590 . ops - (address of) pointer to table of valid file operations
591 . error_code - (pointer to) int holding error code
594 This code used to be in MPI_File_open(), but it has been moved into here in
595 order to clean things up. The goal is to separate all this "did we compile
596 for this fs type" code from the MPI layer and also to introduce the ADIOI_Fns
597 tables in a reasonable way. -- Rob, 06/06/2001
599 void ADIO_ResolveFileType(MPI_Comm comm
, char *filename
, int *fstype
,
600 ADIOI_Fns
**ops
, int *error_code
)
602 int myerrcode
, file_system
, min_code
, max_code
;
604 static char myname
[] = "ADIO_RESOLVEFILETYPE";
607 tmp
= strchr(filename
, ':');
609 int have_nfs_enabled
=0;
610 *error_code
= MPI_SUCCESS
;
611 /* no prefix; use system-dependent function call to determine type */
612 /* Optimization: we can reduce the 'storm of stats' that result from
613 * thousands of mpi processes determinig file type this way. Let us
614 * have just one process stat the file and broadcast the result to
616 * - Note that we will not catch cases like
617 * http://www.mcs.anl.gov/web-mail-archive/lists/mpich-discuss/2007/08/msg00042.html
618 * (edit: now http://lists.mcs.anl.gov/pipermail/mpich-discuss/2007-August/002648.html)
620 * where file systems are not mounted or available on other processes,
621 * but we'll catch those a few functions later in ADIO_Open
622 * - Note that if we have NFS enabled, we might have a situation where,
623 * for example, /home/user/data.out is UFS on one process but NFS on
624 * others, so we won't perform this optimization if NFS is enabled.
625 * - Another point: error codes and file system types are broadcast to
626 * all members of the communicator, so we get to skip the allreduce
632 if (!have_nfs_enabled
) {
633 ADIO_FileSysType_fncall_scalable(comm
, filename
, &file_system
, &myerrcode
);
634 if (myerrcode
!= MPI_SUCCESS
) {
635 *error_code
= myerrcode
;
639 ADIO_FileSysType_fncall(filename
, &file_system
, &myerrcode
);
640 if (myerrcode
!= MPI_SUCCESS
) {
641 *error_code
= myerrcode
;
643 /* the check for file system type will hang if any process got
644 * an error in ADIO_FileSysType_fncall. Processes encountering
645 * an error will return early, before the collective file
646 * system type check below. This case could happen if a full
647 * path exists on one node but not on others, and no prefix
648 * like ufs: was provided. see discussion at
649 * http://www.mcs.anl.gov/web-mail-archive/lists/mpich-discuss/2007/08/msg00042.html
651 * http://lists.mcs.anl.gov/pipermail/mpich-discuss/2007-August/002648.html)
654 MPI_Allreduce(error_code
, &max_code
, 1, MPI_INT
, MPI_MAX
, comm
);
655 if (max_code
!= MPI_SUCCESS
) {
656 *error_code
= max_code
;
659 /* ensure everyone came up with the same file system type */
660 MPI_Allreduce(&file_system
, &min_code
, 1, MPI_INT
,
662 if (min_code
== ADIO_NFS
) file_system
= ADIO_NFS
;
668 /* prefix specified; just match via prefix and assume everyone got
671 * perhaps we should have this code go through the allreduce as well?
673 ADIO_FileSysType_prefix(filename
, &file_system
, &myerrcode
);
674 if (myerrcode
!= MPI_SUCCESS
) {
675 *error_code
= myerrcode
;
680 /* verify that we support this file system type and set ops pointer */
681 if (file_system
== ADIO_PFS
) {
683 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
684 myname
, __LINE__
, MPI_ERR_IO
,
685 "**iofstypeunsupported", 0);
688 *ops
= &ADIO_PFS_operations
;
691 if (file_system
== ADIO_PIOFS
) {
693 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
694 myname
, __LINE__
, MPI_ERR_IO
,
695 "**iofstypeunsupported", 0);
698 *ops
= &ADIO_PIOFS_operations
;
701 if (file_system
== ADIO_UFS
) {
703 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
704 myname
, __LINE__
, MPI_ERR_IO
,
705 "**iofstypeunsupported", 0);
708 *ops
= &ADIO_UFS_operations
;
711 if (file_system
== ADIO_NFS
) {
713 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
714 myname
, __LINE__
, MPI_ERR_IO
,
715 "**iofstypeunsupported", 0);
718 *ops
= &ADIO_NFS_operations
;
721 if (file_system
== ADIO_PANFS
) {
723 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
724 myname
, __LINE__
, MPI_ERR_IO
,
725 "**iofstypeunsupported", 0);
728 *ops
= &ADIO_PANFS_operations
;
731 if (file_system
== ADIO_HFS
) {
733 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
734 myname
, __LINE__
, MPI_ERR_IO
,
735 "**iofstypeunsupported", 0);
738 *ops
= &ADIO_HFS_operations
;
741 if (file_system
== ADIO_XFS
) {
743 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
744 myname
, __LINE__
, MPI_ERR_IO
,
745 "**iofstypeunsupported", 0);
748 *ops
= &ADIO_XFS_operations
;
751 if (file_system
== ADIO_SFS
) {
753 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
754 myname
, __LINE__
, MPI_ERR_IO
,
755 "**iofstypeunsupported", 0);
758 *ops
= &ADIO_SFS_operations
;
761 if (file_system
== ADIO_PVFS
) {
763 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
764 myname
, __LINE__
, MPI_ERR_IO
,
765 "**iofstypeunsupported", 0);
768 *ops
= &ADIO_PVFS_operations
;
771 if (file_system
== ADIO_PVFS2
) {
773 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
774 myname
, __LINE__
, MPI_ERR_IO
,
775 "**iofstypeunsupported", 0);
778 *ops
= &ADIO_PVFS2_operations
;
781 if (file_system
== ADIO_NTFS
) {
783 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
784 myname
, __LINE__
, MPI_ERR_IO
,
785 "**iofstypeunsupported", 0);
788 *ops
= &ADIO_NTFS_operations
;
791 if (file_system
== ADIO_TESTFS
) {
793 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
794 myname
, __LINE__
, MPI_ERR_IO
,
795 "**iofstypeunsupported", 0);
798 *ops
= &ADIO_TESTFS_operations
;
801 if (file_system
== ADIO_BGL
) {
803 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
804 myname
, __LINE__
, MPI_ERR_IO
,
805 "**iofstypeunsupported", 0);
808 *ops
= &ADIO_BGL_operations
;
811 if (file_system
== ADIO_BGLOCKLESS
) {
812 #ifndef ROMIO_BGLOCKLESS
813 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
814 myname
, __LINE__
, MPI_ERR_IO
,
815 "**iofstypeunsupported", 0);
818 *ops
= &ADIO_BGLOCKLESS_operations
;
822 if (file_system
== ADIO_GRIDFTP
) {
823 #ifndef ROMIO_GRIDFTP
824 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
825 myname
, __LINE__
, MPI_ERR_IO
,
826 "**iofstypeunsupported", 0);
829 *ops
= &ADIO_GRIDFTP_operations
;
832 if (file_system
== ADIO_LUSTRE
) {
834 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
, myname
, __LINE__
, MPI_ERR_IO
, "**iofstypeunsupported", 0);
837 *ops
= &ADIO_LUSTRE_operations
;
840 if (file_system
== ADIO_ZOIDFS
) {
842 *error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
843 myname
, __LINE__
, MPI_ERR_IO
,
844 "**iofstypeunsupported", 0);
847 *ops
= &ADIO_ZOIDFS_operations
;
850 *error_code
= MPI_SUCCESS
;
851 *fstype
= file_system
;
855 * vim: ts=8 sts=4 sw=4 noexpandtab