Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about GFortran usability to docs #302

Merged
merged 1 commit into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/api-mount.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,47 @@ Mounting UnifyCR

In this section, we describe how to use the UnifyCR API in an application.

.. Attention:: **Fortran Compatibility**

``unifycr_mount`` and ``unifycr_unmount`` are now usable with GFortran.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CamStan . Just because this looks strange to me, let's use the name in all lower case as "gfortran". That's how I see it most of the time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, seems to use lots of variants out on the web: "GFortran", "Gfortran", "gfortran", so I take that back. Good how you have it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, we should mention that a Fortran application needs to link with:

-lunifycrf -lunifycr_gotcha

There is a known issue_ with the Intel Fortran compiler. Other Fortran
compilers are currently unknown.

---------------------------
Mounting
---------------------------

In ``C`` applications, include *unifycr.h*. See writeread.c_ for a full
example.

.. code-block:: C
:caption: C

#include <unifycr.h>

In ``Fortran`` applications, include *unifycrf.h*. See writeread.f90_ for a
full example.

.. code-block:: Fortran
:caption: Fortran

include 'unifycrf.h'

To use the UnifyCR filesystem a user will have to provide a path prefix. All
file operations under the path prefix will be intercepted by the UnifyCR
filesystem. For instance, to use UnifyCR on all path prefixes that begin with
/tmp this would require a:

.. code-block:: C
:caption: C

unifycr_mount('/tmp', rank, rank_num, 0);

.. code-block:: Fortran
:caption: Fortran

call UNIFYCR_MOUNT('/tmp', rank, size, 0, ierr);

Where /tmp is the path prefix you want UnifyCR to intercept. The rank and rank
number is the rank you are currently on, and the number of tasks you have
running in your job. Lastly, the zero corresponds to the app id.
Expand All @@ -28,9 +56,21 @@ Unmounting
When you are finished using UnifyCR in your application, you should unmount.

.. code-block:: C
:caption: C

if (rank == 0) {
unifycr_unmount();
}

.. code-block:: Fortran
:caption: Fortran

UNIFYCR_UNMOUNT(ierr);

It is only necessary to call unmount once on rank zero.

.. explicit external hyperlink targets

.. _issue: https://github.com/LLNL/UnifyCR/issues/300
.. _writeread.c: https://github.com/LLNL/UnifyCR/blob/dev/examples/src/writeread.c
.. _writeread.f90: https://github.com/LLNL/UnifyCR/blob/dev/examples/src/writeread.f90
11 changes: 11 additions & 0 deletions docs/build-intercept.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,19 @@ Steps for dynamic linking using gotcha:
To intercept I/O calls using gotcha, use the following syntax to link an
application.

C
^^^^^^^^^^^^^^

.. code-block:: Bash

$ mpicc -o test_write test_write.c \
-I<unifycr>/include -L<unifycy>/lib -lunifycr_gotcha \
-L<gotcha>/lib64 -lgotcha

Fortran
^^^^^^^^^^^^^^

.. code-block:: Bash

$ mpif90 -o test_write test_write.F \
-I<unifycr>/include -L<unifycy>/lib -lunifycrf -lunifycr_gotcha