2

Compiling and Running TOUGHREACT v3.32 using Ubuntu/Linux

Hey everyone,

I've been able to get the newest version of TOUGHREACT working with my workstation, which has Linux/Ubuntu (v 17.04) as its OS.  Setting things up didn't go without hitches, though, so I thought I'd point out a few things, in case anyone else is trying to do the same.  There was also one issue I've yet to resolve, and I'd love to hear feedback about it, if possible.  It's written at the bottom of the post.

I compiled all executables using gfortran with up to 1e6 elements and 3e6 connections.  In order to do so, I used the following compiler/linker options:

"FFLAGS = -O2 -mcmodel=large -fstack-arrays -fdefault-integer-8 -fdefault-real-8 -fdefault-double-8 -malign-double -fopenmp"

You may notice there's no mention of declaring the stack size here.  For Ubuntu, you declare this separately in the terminal using the command: "ulimit -s unlimited" or "ulimit -s <hard_stack_limit>", where <hard_stack_limit> is the size (in MB) you wish to dedicate to your stack.  Ultimately, you're limited on how large of a problem you can simulate by the amount of memory you have.

I also had some issues running the executables that were provided in the installation, which were created using the ifort (Intel Fotran) compiler.  When I attempted to run it at first, it shot back an error stating that it couldn't find the library file "libifport.so.5".  After digging into the documentation provided with TOUGHREACT, I came across the following link, listed at the bottom of the file "TOUGHREACT_V332_InstallationUsage.pdf":

https://software.intel.com/en-us/articles/intelr-composer-redistributable-libraries-by-version

From this link, you choose the version of ifort whose libraries you'd like to download.  I ended up choosing "Parallel Studio XE 2017 (All Editions)" in the Linux column and choosing Update 4 under the column titled "Intel Fotran Compiler for Linux."

This link provides a .tgz file, which can be unpacked and installed using the directions provided by Intel.  From there, I only needed to perform one more step before I could use some of the provided executables.  This was to tell Ubuntu where to find the library files when running the executable.  To do this, you need to find where the appropriate library files are located (call it <ifort_library_filepath>).  Once you do, run the following command in the terminal:

"export LD_LIBRARY_PATH=<ifort_library_filepath>".

Once this was done, I was able to run through all of the example problems using the executables with the suffix "_linux", which where created for smaller problems.  I wasn't able to run all of the example problems with the executables with suffix "_linux_1m", which were created for problems up to 999999 elements and 3e6 connections.  In particular, when I ran problem P3, the file runlog.out issued a bunch of warnings that looked like this:

"Warning: chemistry did not converge at node Fza18 (routine NEWTONEQ), Non-convergence type:   relative  Node temperature (C):     27.827  Liq.sat.: 1.9614E-01
  Species: cl-        Relative error =  1.130+172  Tolerance=  1.000E-06  Program execution was not aborted.  Check results!"

So it appears there are some numerical errors for this case.  Any help on figuring out the root of this problem would be much appreciated.

Thanks!

10 replies

null
    • TOUGHREACT Developer
    • Eric_Sonnenthal
    • 7 yrs ago
    • Reported - view

    Mikey, thanks for giving detailed info on Linux installation from the user's perspective! That information is in the new User's Manual I am working on now, but some was not in the InstallationUsage document that came with the distribution. I'll update that document, too, since it is easier to find than reading through a long User's Manual.

    Regarding the lack of convergence, that happens at specific grid blocks in some problems. Usually, the transport at the next time step changes the water composition enough to allow convergence. These convergence problems can often be avoided with very small time steps, however, then the problems take much longer to run, and usually the end results are nearly the same. There is always a trade-off between getting things to run relatively fast and maintaining accuracy vs. trying to get the most accurate solution by taking very small time steps. Setting the Courant number (RCOUR in solute.inp) to ~0.5  is the safest way to maintain accuracy for advection-dominated problems. However, if many elements undergo non-convergence, and the time step is decreasing as a result, then likely the maximum time step is too large. If the time step is too large, then errors in mineral abundances and porosity/permeability changes can be in error because they are cumulative.

    Good luck!

    Eric

      • Lang
      • 7 yrs ago
      • Reported - view

      Eric Sonnenthal

      Dear Dr. Sonnenthal,

      You said:
      Setting the Courant number (RCOUR in solute.inp) to ~0.5 is the safest way to maintain accuracy for advection-dominated problems.

      I was wondering how to set the RCOUR in order to maintain accuracy for the diffusion-dominated problems. Thank you!

      • Mouadh
      • 2 yrs ago
      • Reported - view

      Eric Sonnenthal I'm using TR v3.32 on windows. I want to run a larger system, is Linux/mac the only option? if yes, can you please share the updated document for Linux installation? I'm facing the same issues described by  (Mikey Hannoncouldn't find the library file "libifport.so.5")

      Thank you

    • TOUGHREACT Developer
    • Eric_Sonnenthal
    • 7 yrs ago
    • Reported - view

    Hi Lang,

    There are no options in TOUGHREACT to limit the time step for chemical diffusion. One must find a time step large enough that the results stay about the same as a smaller time step. The timestep cannot be too small or else the chemical changes may be too small and numerical cutoffs can take place if the mineral changes are extremely small. I always suggest one runs multiple simulations with differing time stepping to make sure the results are reasonable. TOUGH2 will allow the time step to keep increasing, which may be reasonable for flow simulations, but completely erroneous reactive transport results or nonconvergence will occur. So limit the maximum time step in flow.inp and invoke the Courant condition for all simulations. Then check the results by plotting the chemical profiles and mineral abundance profiles.

    Eric

      • Lang
      • 7 yrs ago
      • Reported - view

      Eric Sonnenthal 

      Dear Dr. Sonnenthal,

      Thank you for your helpful reply.

      Best regards,

      Lang

    • Daniel_Carbajal
    • 3 yrs ago
    • Reported - view

    Mikey Hannon

    I am trying to run an EOS 1 executable on Linux using ubuntu on windows. Due to the higher resolution of the maximum number of cells. In ubuntu I got this error: error while loading shared libraries: libifport.so.5: cannot open shared object file: No such file or directory. However, reviewing this post I realized that I had to install "ifortran" which solved the problem and now I can start the simulation in Ubuntu. However, I get the following error message:

     

    OMP: Info # 274: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.
        -> reading multiphase flow input data
    forrtl: severe (174): SIGSEGV, segmentation fault occurred
    Image PC Routine Line Source
    libifcoremt.so.5 00007F363B99F3E9 for__signal_handl Unknown Unknown
    libpthread-2.31.s 00007F3638F723C0 Unknown Unknown Unknown
    treactv332omp_eos 0000000000510CCA Unknown Unknown Unknown
    treactv332omp_eos 00000000005102FF Unknown Unknown Unknown
    treactv332omp_eos 000000000040208E Unknown Unknown Unknown
    libc-2.31.so 00007F3638D870B3 __libc_start_main Unknown Unknown
    treactv332omp_eos 0000000000401F99 Unknown Unknown Unknown

    Do you have any recommendations to solve this problem or some way to run TOUGH on Windows?

    I'm new to using this program and I could use some tips.

    Best regards
    Daniel

    carbadanmartinez@hotmail.com

    • Mikey_Hannon
    • 3 yrs ago
    • Reported - view

    Daniel Carbajal, I received your latest message in an e-mail, but I'm failing to see it pop up on the Forum thread here.  Could you try re-posting? 

    • Daniel_Carbajal.1
    • 3 yrs ago
    • Reported - view

    Mikey Hannon 

    I am trying to run an EOS 1 executable (Linux; TOUGHTREACT V3) using ubuntu on windows. Due to the higher resolution of the maximum number of cells.

    In ubuntu I got this: error while loading shared libraries: libifport.so.5: cannot open shared object file: No such file or directory. Reviewing this post I realized that I had to install "ifortran" which solved the problem and now I can start the simulation in Ubuntu. However, I get the following error message:

     

    OMP: Info # 274: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.
        -> reading multiphase flow input data
    forrtl: severe (174): SIGSEGV, segmentation fault occurred
    Image PC Routine Line Source
    libifcoremt.so.5 00007F363B99F3E9 for__signal_handl Unknown Unknown
    libpthread-2.31.s 00007F3638F723C0 Unknown Unknown Unknown
    treactv332omp_eos 0000000000510CCA Unknown Unknown Unknown
    treactv332omp_eos 00000000005102FF Unknown Unknown Unknown
    treactv332omp_eos 000000000040208E Unknown Unknown Unknown
    libc-2.31.so 00007F3638D870B3 __libc_start_main Unknown Unknown
    treactv332omp_eos 0000000000401F99 Unknown Unknown Unknown

    Do you have any recommendations to solve this problem or some way to run TOUGH on Windows?

    I am new to TOUGH so any advice will be helpful.

    Best regards
    Daniel

    carbadanmartinez@gmail.com

    • Mikey_Hannon
    • 3 yrs ago
    • Reported - view

    Daniel Carbajal, did you compile and build this executable yourself, or are you using the one provided by LBL?  Also, how many flow elements and connections does your problem contain?

    I do know that running larger problems on a Windows OS limits the size of the problems you can run.  I haven't tried it with the Ubuntu app on there, but I suspect it may still be an issue.  Do you happen to have access to a machine operating a Linux/Unix environment?  The issues I brought up at the beginning of this thread were ultimately resolved when I dual-booted my machine with Ubuntu and ran the larger problems on it.

    • TOUGHREACT Developer
    • Eric_Sonnenthal
    • 2 yrs ago
    • Reported - view

    Hi,

    Installation of redistributable libraries seems to change every few years. Here is the link for Mac versions:

    https://www.intel.com/content/www/us/en/developer/articles/tool/redistributable-libraries-for-intel-c-and-fortran-2020-compilers-for-macos.html

    Once they are installed, also copy the libraries into /usr/local/lib and set the path in your .bash_profile file. I don't know why they need to be in /usr/local/lib now.

    For Linux, the command ulimit -s unlimited must also be used on the command line, or in the .bashrc file.

    I've attached the latest document on code installation (for the upcoming V4 release, but it applies to older versions).

    Unfortunately, problems with more than about 60,000 grid blocks are too memory-intensive to run on Windows, because of the inherent 2GB limit. It is possible to run larger problems if the number of species, minerals, solid solutions, etc., in chempar_v3.inc are reduced to the bare minimum needed. By default the arrays are large to run large chemical problems.

    regards,

    Eric

Content aside

  • 2 Likes
  • 2 yrs agoLast active
  • 10Replies
  • 1036Views
  • 7 Following