Integrate the UnifyFS API¶
This section describes how to use the UnifyFS API in an application.
Transparent Mount Caveat
MPI applications that take advantage of the transparent mounting feature (through configuring with
+auto-mount through Spack) do not need to be modified in any way in
order to use UnifyFS. Move on to the Link with the UnifyFS library section next as this step can
unifyfs_unmount are usable with GFortran.
There is a known ifort_issue with the Intel Fortran compiler as well as an
xlf_issue with the IBM Fortran compiler. Other Fortran compilers are
If using fortran, when installing UnifyFS with Spack,
+fortran variant, or configure UnifyFS with the
--enable-fortran option if building manually.
Include the UnifyFS Header¶
In C or C++ applications, include
unifyfs.h. See writeread.c for a full
In Fortran applications, include
unifyfsf.h. See writeread.f90 for a
UnifyFS implements a file system in user space, which the system has no knowledge about. The UnifyFS library intecepts and handles I/O calls whose path matches a prefix that is defined by the user. Calls corresponding to matching paths are handled by UnifyFS and all other calls are forwarded to the original I/O routine.
To use UnifyFS, the application must register the path that the UnifyFS library should intercept
by making a call to
This must be done once on each client process,
and it must be done before the client process attempts to access any UnifyFS files.
For instance, to use UnifyFS on all path prefixes that begin with
/unifyfs this would require a:
unifyfs_mount('/unifyfs', rank, rank_num);
call UNIFYFS_MOUNT('/unifyfs', rank, size, ierr);
/unifyfs is the path prefix for UnifyFS to intercept.
rank parameter specifies the MPI rank of the calling process.
size parameter specifies the number of MPI ranks in the user job.
When the application is done using UnifyFS, it should call