Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/upc-ghs/modpath-omp

MODPATH-v7 plus parallel particles processing with OpenMP
https://github.com/upc-ghs/modpath-omp

fortran hydrogeology modflow modpath particle-tracking

Last synced: 2 days ago
JSON representation

MODPATH-v7 plus parallel particles processing with OpenMP

Awesome Lists containing this project

README

        

# modpath-omp
MODPATH version 7 with parallel processing of particles implemented with the OpenMP library.

Configuration input files are the same that for a normal ``modpath-v7`` simulation, so integration of the parallel version is straightforward.

## Compilation
Download source code and access the `make` folder. Here execute one of the makefiles with

```
make -f makefile-gfortran-pc
```

This will compile source files and will output a binary, by default with name `mpath7omp.exe`.
Compilation has been verified with ``[email protected]`` and with ``ifort`` from Intel ``[email protected]``.

### Note
Compiled binaries in the folder `msvs/bin_PROVISIONAL` are the ones provided by the upstream `modpath-v7` repository, not the parallel version from this repository.

## Running parallel simulations
``modpath`` interface has been extended to simplify execution of parallel runs via the command line.
Some alternatives are:

- Use the ``-np`` argument to specify the number of processes:
```
mpath7omp example.mpsim -np 4
```

- Use the ``-parallel`` argument to run in parallel employing the maximum number of available processors:

```
mpath7omp example.mpsim -parallel
```

- Specify the ``OMP_NUM_THREADS`` environment variable:
```
OMP_NUM_THREADS=4 mpath7omp example.mpsim
```
In this last case, if the variable is defined at a system level, it will be employed when submitting a normal run instruction ``mpath7omp example.mpsim``

## Parallel output for timeseries
Three different output protocols for timeseries running in parallel have been implemented. The protocol can be selected via the command line argument ``-tsoutput``:

- ``-tsoutput 1``: is the default format, output is performed into a single output unit with OpenMP thread exclusive clause (critical). Only difference versus a serial run is that the output file contains non-sorted particle indexes.
- ``-tsoutput 2``: timeseries records are written into thread specific binary units and then consolidated into a single file after each timeseries output time. Timeseries file generated with this format does not contains a file header.
- ``-tsoutput 3``: timeseries records are written into thread specific output units. Timeseries file header is only written to output unit related to the first thread ``1_example.timeseries``. Initial particle positions are also written to the file of the first thread.

## License
MIT License

## Resources

* [MODPATH](https://www.usgs.gov/software/modpath-particle-tracking-model-modflow)
* [Central modpath-v7 repository](https://github.com/MODFLOW-USGS/modpath-v7)
* [gfortran](https://gcc.gnu.org/wiki/GFortran)
* [OpenMP](https://www.openmp.org/)
* [Intel oneApi HPC toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit.html)
* [MIT License](https://mit-license.org/)

## References
[Pérez-Illanes R., Fernàndez-Garcia, D., 2022, Multiprocessing for the Particle Tracking Model MODPATH, Groundwater, doi:10.1111/gwat.13279](https://doi.org/10.1111/gwat.13279)