...
 
Commits (268)
spack-build*
tests/alaindelon/*/proc*
\ No newline at end of file
tests/alaindelon/*/proc*
GTAGS
GRTAGS
GPATH
\ No newline at end of file
# Pastix
source $PASTIX_DIR/bin/pastix_env.sh
......@@ -5,11 +5,11 @@ cmake:
- cmake
script:
- echo "Installing with CMake"
- source .gitlab-ci-env.sh
- git submodule init
- git submodule update
- mkdir build
- cd build
- export MPH_PASTIXDIR=/builds/install/pastix5
- cmake .. -DMAPHYS_BUILD_TESTS=ON -DPASTIX_DIR=$MPH_PASTIXDIR
- cmake .. -DMAPHYS_BUILD_TESTS=ON -DPASTIX_VER_6=ON
- make
- ctest
This diff is collapsed.
Read the INSTALL paragrph of the README file.
\ No newline at end of file
Read the INSTALL paragraph of the README file.
\ No newline at end of file
This diff is collapsed.
......@@ -18,16 +18,25 @@ thanks to the ANR-CIS Solstice funding. This parallel linear solver couples dire
approaches. The underlying idea is to apply to general unstructured linear systems domain decomposition
ideas developed for the solution of linear systems arising from PDEs. The interface problem,
associated with the so called Schur complement system, is solved using a block preconditioner
with overlap between the blocks that is referred to as Algebraic Additive Schwarz. To cope with
the possible lack of coarse grid mechanism that enables one to keep constant the number of iterations
when the number of blocks is increased, the solver exploits two levels of parallelism
with overlap between the blocks that is referred to as Algebraic Additive Schwarz. To better exploit the architecture of
emerging parallel platforms the solver exploits two levels of parallelism
(between the blocks and within the treatment of the blocks). This enables us to exploit a large number
of processors with a moderate number of blocks which ensures a reasonable convergence behaviour.
The current prototype code will be further consolidated to end-up with a high performance software package
to be made freely available to the scientific community.
(extracted from HiePaCS' Proposal, a joint Project-Team with University of Bordeaux and CNRS (LaBRI UMR 5800) and Research Action between INRIA and CERFACS)
of cores with a moderate number of blocks which ensures a reasonable convergence behaviour especially for non SPD linear systems.
For these latter problems a two-level preconditionner, based on Geneo ideas for the coarse grid construction, is available through
various implementations.
* Acknowlegements
In addition to the Inria financial support, this software effort has been partially supported by different research initiatives and contracts, namely:
- Industrial
- Total SA
- National research projects
- [[http://www-sop.inria.fr/nachos/projects/tecser/pmwiki-2.2.40/pmwiki.php/Main/HomePage][DGA-Rapid project TECSER]] (partners: Inria (PI), Airbus IW, Nucletude)
- [[http://dedales.gforge.inria.fr/doku.php?id=start][ANR Dedales project]] (Dedales (ANR‐14‐CE23‐0005) (partners: Inria (PI), Andra, Laga Univ. Paris 13, Mds)
- European collaborative projects
- PRACE project funded in part by the EU’s Horizon 2020 research and innovation programme (2014-2020) under grant agreement 653838.
- H2020 Energy oriented Centre of Excellence ([[http://www.eocoe.eu/][EoCoE]]), grant agreement number 676629, funded within the Horizon2020 framework of the European Union
- H2020 -EUB-2-2015 : [[https://hpc4e.eu/][HPC4E]] aims to apply the new exascale HPC techniques to energy industry simulations, customizing them, and going beyond the state-of-the-art in the required HPC exascale simulations for different energy sources
* Installation
To use last development state of MaPHyS, please clone the master
......@@ -37,10 +46,10 @@ to be made freely available to the scientific community.
#+BEGIN_SRC sh
# if git version >= 1.9
git clone --recursive git@gitlab.inria.fr:solverstack/maphys.git
git clone --recursive git@gitlab.inria.fr:solverstack/maphys/maphys.git
cd maphys
# else
git clone git@gitlab.inria.fr:solverstack/maphys.git
git clone git@gitlab.inria.fr:solverstack/maphys/maphys.git
cd maphys
git submodule init
git submodule update
......@@ -58,7 +67,11 @@ to be made freely available to the scientific community.
| Version | Tarball | Documentation | Refcard | Date |
|-------------------------+---------+---------------------+---------------+----------------|
| *0.9.6.0 (recommended)* | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.6.0.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.6_users_guide.pdf][Documentation-0.9.6]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.6_refcard.pdf][Refcard-0.9.6]] | September 2017 |
| *0.9.8.2 (recommended)* | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.8.2.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.8_users_guide.pdf][Documentation-0.9.8]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.8_refcard.pdf][Refcard-0.9.8]] | Octobre 2019 |
| 0.9.8.1 | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.8.1.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.8_users_guide.pdf][Documentation-0.9.8]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.8_refcard.pdf][Refcard-0.9.8]] | July 2019 |
| 0.9.8.0 | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.8.0.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.8_users_guide.pdf][Documentation-0.9.8]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.8_refcard.pdf][Refcard-0.9.8]] | September 2018 |
| 0.9.7.0 | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.7.0.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.7_users_guide.pdf][Documentation-0.9.7]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.7_refcard.pdf][Refcard-0.9.7]] | March 2018 |
| 0.9.6.0 | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.6.0.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.6_users_guide.pdf][Documentation-0.9.6]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.6_refcard.pdf][Refcard-0.9.6]] | September 2017 |
| 0.9.5.1 | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.5.1.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.5_users_guide.pdf][Documentation-0.9.5]] | | May 2017 |
| 0.9.5.0 | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.5.0.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.5_users_guide.pdf][Documentation-0.9.5]] | | March 2017 |
| 0.9.4.2 | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.4.2.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.4_users_guide.pdf][Documentation-0.9.4]] | | November 2016 |
......@@ -66,12 +79,9 @@ to be made freely available to the scientific community.
| 0.9.4.0 | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.4.0.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_0.9.4_users_guide.pdf][Documentation-0.9.4]] | | October 2016 |
| 0.9.3 | [[http://morse.gforge.inria.fr/maphys/maphys-0.9.3.tar.gz][Tarball]] | [[http://morse.gforge.inria.fr/misc/maphys_users_guide.pdf][Documentation-0.9.3]] | | 2015 |
|-------------------------+---------+---------------------+---------------+----------------|
Also check the new [[http://morse.gforge.inria.fr/misc/maphys_0.9.6_refcard.pdf][refcard]] for control parameters and info outputs.
* Links
- [[http://morse.gforge.inria.fr/misc/maphys_0.9.5_users_guide.pdf][Documentation (0.9.6)]]
- [[http://gforge.inria.fr/scm/?group_id=2485][Old repository]]
- [[http://morse.gforge.inria.fr/spack/spack.html][Install MaPHyS with spack]]
- [[http://morse.gforge.inria.fr/maphys/install-maphys-cluster.html][Install MaPHyS on a cluster]]
......
This diff is collapsed.
......@@ -16,7 +16,7 @@
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
......@@ -32,7 +32,7 @@
# GENERATE_PKGCONFIG_FILE: generate a file .pc according to the options
#
###
macro(GENERATE_PKGCONFIG_FILE _file)
macro(GENERATE_PKGCONFIG_FILE)
# The link flags specific to this package and any required libraries
# that don't support PkgConfig
......@@ -53,22 +53,23 @@ macro(GENERATE_PKGCONFIG_FILE _file)
list(APPEND MAPHYS_PKGCONFIG_LIBS_PRIVATE ${MAPHYS_EXTRA_LIBRARIES})
list(REMOVE_ITEM MAPHYS_PKGCONFIG_LIBS_PRIVATE "hwloc")
list(REMOVE_DUPLICATES MAPHYS_PKGCONFIG_LIBS)
list(REMOVE_DUPLICATES MAPHYS_PKGCONFIG_LIBS_PRIVATE)
list(REMOVE_DUPLICATES MAPHYS_PKGCONFIG_REQUIRED)
list(REMOVE_DUPLICATES MAPHYS_PKGCONFIG_REQUIRED_PRIVATE)
string(REPLACE ";" " " MAPHYS_PKGCONFIG_LIBS "${MAPHYS_PKGCONFIG_LIBS}")
string(REPLACE ";" " " MAPHYS_PKGCONFIG_LIBS_PRIVATE "${MAPHYS_PKGCONFIG_LIBS_PRIVATE}")
string(REPLACE ";" " " MAPHYS_PKGCONFIG_REQUIRED "${MAPHYS_PKGCONFIG_REQUIRED}")
string(REPLACE ";" " " MAPHYS_PKGCONFIG_REQUIRED_PRIVATE "${MAPHYS_PKGCONFIG_REQUIRED_PRIVATE}")
# Create .pc file
# ---------------
set(_output_file "${CMAKE_BINARY_DIR}/maphys.pc")
set(_input_file "${CMAKE_CURRENT_SOURCE_DIR}/lib/pkgconfig/maphys.pc.in")
# TODO: add url of MORSE releases in .pc file
configure_file("${_file}" "${_output_file}" @ONLY)
configure_file("${_input_file}" "${_output_file}" @ONLY)
# installation
# ------------
......@@ -86,9 +87,29 @@ macro(GENERATE_PKGCONFIG_FILE _file)
${CMAKE_BINARY_DIR}/lib/zmph_maphys_type_c.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
)
endmacro(GENERATE_PKGCONFIG_FILE)
###
#
# generate_env_file: generate files maphys.pc
#
###
macro(generate_env_file)
# Create .sh file
# ---------------
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/maphys_env.sh.in"
"${CMAKE_CURRENT_BINARY_DIR}/bin/maphys_env.sh" @ONLY)
# installation
# ------------
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/bin/maphys_env.sh"
DESTINATION bin)
endmacro(generate_env_file)
##
## @end file GenPkgConfig.cmake
##
Subproject commit e4b604a8208195ba2895ffb5986cacd1173651b7
Subproject commit dfb60ed9fc7d0813e41fbde05115d6d2360b5989
! module
! module
Module mph_common
Use mph_log_mod
Use MPH_log_mod
Use mph_dbg_mod
Use mph_error_mod
Use mph_env_mod
......
......@@ -13,7 +13,7 @@
!! - routines to manipulate the debuging file (modify prefix, etc.)
!!
!! With debugging file in the form of
!! "dbg_file_prefix","file"
!! "dbg_file_prefix","file"
!! by default
!! "dbg_file_prefix" = procXXX (where XXX is the dbg_rank+1 )
!!
......@@ -55,7 +55,7 @@ Contains
!****
Subroutine MPH_dbg_init()
subroutine MPH_dbg_init()
Include "mpif.h"
......@@ -66,7 +66,7 @@ Contains
init_counter = init_counter + 1
If ( init_counter == 1 ) Then
Call MPI_Comm_size(MPI_COMM_WORLD, dbg_np , iinfo )
Call MPI_Comm_rank(MPI_COMM_WORLD, dbg_rank, iinfo )
......@@ -77,18 +77,18 @@ Contains
Write(dbg_file_prefix,'("proc"I3.3".")') dbg_rank+1
dbg_unit = 11 + dbg_rank
End Subroutine MPH_dbg_init
End subroutine MPH_dbg_init
!****
Subroutine MPH_dbg_exit
subroutine MPH_dbg_exit
Include "mpif.h"
Integer :: iinfo
! Exit debuging module
! Exit debuging module
init_counter = init_counter - 1
Close(UNIT=dbg_unit,IOSTAT=iinfo)
......@@ -101,13 +101,13 @@ Contains
dbg_file_prefix = ""
End If
End Subroutine MPH_dbg_exit
End subroutine MPH_dbg_exit
!****
Subroutine MPH_dbg_set_file(file)
subroutine MPH_dbg_set_file(file)
Character(len=*), intent(in) :: file
......@@ -117,11 +117,11 @@ Contains
Open (UNIT=dbg_unit, FILE=Trim(dbg_file_prefix)//Trim(file),&
ACTION="WRITE", STATUS="REPLACE")
End Subroutine MPH_dbg_set_file
End subroutine MPH_dbg_set_file
!****
Subroutine MPH_dbg_get_prefix (string)
subroutine MPH_dbg_get_prefix (string)
Character(len=*), Intent(out) :: string
......@@ -129,53 +129,53 @@ Contains
string = Trim(dbg_file_prefix)
End Subroutine MPH_dbg_get_prefix
End subroutine MPH_dbg_get_prefix
!****
!****
Subroutine MPH_dbg_prefix_prepend (string)
subroutine MPH_dbg_prefix_prepend (string)
Character(len=*), intent(in) :: string
! Preprend "string" to the debuging prefix file
! Preprend "string" to the debuging prefix file
dbg_file_prefix = Trim(string) // Trim(dbg_file_prefix)
End Subroutine MPH_dbg_prefix_prepend
End subroutine MPH_dbg_prefix_prepend
!****
Subroutine MPH_dbg_prefix_append(string)
subroutine MPH_dbg_prefix_append(string)
Character(len=*), intent(in) :: string
! Append "string" to the debuging prefix file
! Append "string" to the debuging prefix file
dbg_file_prefix = Trim(dbg_file_prefix) // Trim(string)
End Subroutine MPH_dbg_prefix_append
End subroutine MPH_dbg_prefix_append
!****
Subroutine MPH_dbg_prefix_clear()
subroutine MPH_dbg_prefix_clear()
! Delete the debuging prefix file
! Delete the debuging prefix file
dbg_file_prefix = ""
End Subroutine MPH_dbg_prefix_clear
End subroutine MPH_dbg_prefix_clear
!****
Subroutine MPH_dbg_barrier()
subroutine MPH_dbg_barrier()
include "mpif.h"
Integer :: ierror
! Barrier on MPI_COMM_WORLD
Call MPI_Barrier(MPI_COMM_WORLD, ierror )
End Subroutine MPH_dbg_barrier
End subroutine MPH_dbg_barrier
!****
......
......@@ -4,17 +4,17 @@
! [+] module : mph_env_mod ---------------------------------------------------
!
!> MaPHyS Environement module
!!
!!
!! Provides environment detection/manipulation for maphys.
!!
Module mph_env_mod
!* No implicit typing *!
Implicit None
!* Defined type(s) *!
Include "mph_env_type_f.inc"
!* Private constants *!
......@@ -26,9 +26,9 @@ Module mph_env_mod
Public :: mph_env_init
Public :: mph_env_exit
Public :: mph_env_setMPIComm
Public :: mph_env_getNodeId
Public :: mph_env_getNodeComm
Public :: mph_env_getNbNodes
Public :: mph_env_getnodeid
Public :: mph_env_getnodecomm
Public :: mph_env_getnbnodes
Private :: comm_splitbynode
......@@ -37,25 +37,25 @@ Module mph_env_mod
Contains
!
! constructors
!
!
Subroutine mph_env_init(menv)
subroutine mph_env_init(menv)
Implicit None
Type(mph_env_t), Intent(inout) :: menv
menv%comm = -1
menv%nodecomm = -1
menv%nodeid = -1
End Subroutine mph_env_init
End subroutine mph_env_init
Subroutine mph_env_exit(menv)
subroutine mph_env_exit(menv)
Use mph_error_mod
Implicit None
Include "mpif.h"
Type(mph_env_t), Intent(inout) :: menv
Logical :: MPICommIsSet
Logical :: MPICommIsSet
Integer :: info
MPICommIsSet = ( menv%nodeid /= -1 )
If ( MPICommIsSet )Then
Call MPI_Comm_free(menv%comm,info)
......@@ -68,20 +68,20 @@ Module mph_env_mod
menv%comm = -1
menv%nodecomm = -1
menv%nodeid = -1
End Subroutine mph_env_exit
End subroutine mph_env_exit
!
! setters
!
Subroutine mph_env_setMPIComm(menv, comm)
subroutine mph_env_setMPIComm(menv, comm)
!* Module(s) *!
Use mph_error_mod
Implicit None
Include "mpif.h"
!* Argument(s) *!
Type(mph_env_t), Intent(inout) :: menv
......@@ -89,7 +89,7 @@ Module mph_env_mod
!* Local variable(s) *!
Integer :: rank
Integer :: rank
Integer :: info
Integer :: np
......@@ -114,24 +114,24 @@ Module mph_env_mod
#endif
End Subroutine mph_env_setMPIComm
End subroutine mph_env_setMPIComm
!
! getters
!
Integer Function mph_env_getNodeId(menv)
Integer Function mph_env_getnodeid(menv)
Type(mph_env_t), Intent(in) :: menv
mph_env_getnodeid=menv%nodeid
End Function mph_env_getnodeid
Integer Function mph_env_getNodeComm(menv)
Integer Function mph_env_getnodecomm(menv)
Type(mph_env_t), Intent(in) :: menv
mph_env_getnodecomm=menv%nodecomm
End Function mph_env_getnodecomm
Integer Function mph_env_getNbNodes(menv)
Integer Function mph_env_getnbnodes(menv)
Use mph_error_mod
Implicit None
Include "mpif.h"
......@@ -144,18 +144,18 @@ Module mph_env_mod
mph_env_getnbnodes = res
End Function mph_env_getnbnodes
!
! Methods
!
Subroutine comm_splitbynode(comm, commnp, subcomm, subcommid, info )
subroutine comm_splitbynode(comm, commnp, subcomm, subcommid, info )
!* Module(s) *!
Use mph_error_mod
Implicit None
Include "mpif.h"
!* Argument(s) *!
Integer, Intent(in ) :: comm
......@@ -163,7 +163,7 @@ Module mph_env_mod
Integer, Intent(out) :: subcomm
Integer, Intent(out) :: subcommid
Integer, Intent(out) :: info
!* Local variable(s) *!
! Scalars
......@@ -216,6 +216,6 @@ Module mph_env_mod
Call MPI_COMM_SPLIT( comm, subcommid, hkey, subcomm, info)
ASSRT( info == MPI_SUCCESS )
End Subroutine comm_splitbynode
End subroutine comm_splitbynode
End Module mph_env_mod
#include "mph_defs_f.h"
!> Module to print maphys messages & handle errors
!> Module to print maphys messages & handle errors
!!
!! @note
!! The routines MPH_err_init() and MPH_err_exit() are not thread-safe.
!! The routines mph_err_init() and mph_err_exit() are not thread-safe.
Module mph_error_mod
!* No Implicit Typing *!
......@@ -28,57 +28,57 @@ Contains
!! Set the communicator to use for errors.
!!
!! @param[in] comm MPI communicator used for errors (MPI_Abort)
!!
!! @note
!!
!! @note
!! This routine would be called at the begining of maphys_driver.
!! (ie, each time the user call maphys)
Subroutine mph_err_init ( comm )
subroutine mph_err_init ( comm )
Integer, Intent(in) :: comm
errcomm = comm
End Subroutine mph_err_init
End subroutine mph_err_init
!> Exit the module.
!!
!! Reset private variables to their default values.
!!
Subroutine mph_err_exit
!!
subroutine mph_err_exit
errcomm = -1
End Subroutine mph_err_exit
End subroutine mph_err_exit
!> Abort a maphys instance
Subroutine mph_abort
subroutine mph_abort
!* Module(s) & co. *!
Implicit None
Include "mpif.h"
Include "mpif.h"
!* Local variables.
Integer :: iinfo
Call MPI_Abort(errcomm, -1, iinfo)
End Subroutine mph_abort
End subroutine mph_abort
!> Check the return of MPI.
!!
!! @param [in,out] iinfo
!! @param [in,out] iinfo
!! - On input , holds the return call to an MPI routine
!! - On output, holds 0 if MPI routine succeeded, -1, if not.
!!
Subroutine mph_error_CheckMPI(iinfo)
!!
subroutine mph_error_CheckMPI(iinfo)
!* Module(s) & co. *!
Implicit None
Include "mpif.h"
Include "mpif.h"
!* Local variables.
Integer, Intent(out) :: iinfo
......@@ -90,15 +90,15 @@ Contains
iinfo = 0
End If
End Subroutine mph_error_CheckMPI
End subroutine mph_error_CheckMPI
!> Assert a statement
Subroutine mph_assert(assertion, line, flname )
!> assert a statement
subroutine mph_assert(assertion, line, flname )
!* Module(s) *!
Use mph_log_mod
Use MPH_log_mod
Implicit None
!* Arguments *!
......@@ -111,30 +111,30 @@ Contains
Character(len=MAPHYS_STRL) :: msg
!- End of header -----------------------------------------------------------
If ( assertion .eqv. .False. ) Then
Write(msg,'(2A,I6,A)') Trim(flname),":line",line,". Assertion Failed"
Call mph_log(MSG_ERROR,msg)
Write(msg,'(2A,I6,A)') Trim(flname),":line",line,". assertion Failed"
Call MPH_log(MSG_ERROR,msg)
Call mph_abort
End If
End Subroutine mph_assert
!> Check that a statement is True
End subroutine mph_assert
!> Check that a statement is True
!!
!! if the "statement" is false print useful message.
!! and set "info" to "-line"
!!
!!
!! @param [in] assertion the assertion to check
!! @param [in] line the line number (should be __LINE__)
!! @param [inout] info on success, do nothing,
!! on failure it is set to -line
!! @param [in] flname the filename
Subroutine mph_check(statement, line, info, flname )
subroutine mph_check(statement, line, info, flname )
!* Module(s) *!
Use mph_log_mod
Use MPH_log_mod
Implicit None
!* Arguments *!
......@@ -146,15 +146,59 @@ Contains
!* Local variables *!
! strings
Character(len=MAPHYS_STRL) :: msg
!- End of header -----------------------------------------------------------
If ( .Not. statement ) Then
Write(msg,'(2A,I6,A)') Trim(flname),":line",line,". Check Failed"
Call mph_log(MSG_ERROR,msg)
Call MPH_log(MSG_ERROR,msg)
info = - line
End If
End Subroutine mph_check
End subroutine mph_check
subroutine mph_assert_mess(assertion, line, flname, message)
Use MPH_log_mod
!* Arguments *!
Logical, Intent(in ) :: assertion
Integer, Intent(in ) :: line
Character(len=*), Intent(in) :: flname
Character(len=*), Intent(in) :: message
!* Local variables *!
Character(len=MAPHYS_STRL) :: msg
If ( assertion .eqv. .False. ) Then
Write(msg,'(2A,I6,A)') Trim(flname),":line",line,". assertion Failed"
Call MPH_log(MSG_ERROR,msg)
Call MPH_log(MSG_ERROR,message)
Call mph_abort
End If
End subroutine mph_assert_mess
subroutine mph_assert_mpi(assertion, line, flname, ierr)
Use MPH_log_mod
!* Arguments *!
Logical, Intent(in ) :: assertion
Integer, Intent(in ) :: line
Character(len=*), Intent(in) :: flname
Integer, Intent(in) :: ierr
!* Local variables *!
Character(len=MAPHYS_STRL) :: msg
Character(len=MAPHYS_STRL) :: msg2
If ( assertion .eqv. .False. ) Then
Write(msg,'(2A,I6,A)') Trim(flname),":line",line,". assertion Failed"
Write(msg2, *) 'ierr: ', ierr
Call MPH_log(MSG_ERROR,msg)
Call MPH_log(MSG_ERROR,msg2)
Call mph_abort
End If
End subroutine mph_assert_mpi
End Module mph_error_mod
!> Module to log maphys messages
Module mph_log_mod
Module MPH_log_mod
!* No Implicit Typing *!
Implicit None
......@@ -21,13 +21,13 @@ Module mph_log_mod
!* Access specifiers to routines *!
Public :: mph_log_init
Public :: mph_log_exit
Public :: mph_log
Public :: mph_logWithInfo
Public :: MPH_log_init
Public :: MPH_log_exit
Public :: MPH_log
Public :: MPH_logWithInfo
Public :: mph_log_GetVerbosity
Public :: mph_log_GetUnit
Public :: MPH_log_GetVerbosity
Public :: MPH_log_GetUnit
!* Routines *!
......@@ -38,19 +38,19 @@ Contains
!! Set the different unit used to log usual, error and warning messages.
!! To deactivate an output, give a negative value to the unit.
!!
!! @param[in] stdunit Fortran Unit used to log maphys messages
!! @param[in] errunit Fortran Unit used to log maphys errors
!! @param[in] stdunit Fortran Unit used to log maphys messages
!! @param[in] errunit Fortran Unit used to log maphys errors
!! @param[in] warnunit Fortran Unit used to log maphys warnings
!! @param[in] verblvl wanted level of verbosity
!! @param[in] verblvl wanted level of verbosity
!! @param[in] rank MPI rank (prefixing all messages)
!!
!! @note
!!
!! @note
!! This routine would be called at the begining of maphys_driver.
!! (ie, each time the user call maphys)
Subroutine mph_log_init ( errunit, warnunit, stdunit, verblvl, logrank )
subroutine MPH_log_init ( errunit, warnunit, stdunit, verblvl, logrank )
!* Arguments *!
Integer, Intent(in) :: errunit
Integer, Intent(in) :: warnunit
Integer, Intent(in) :: stdunit
......@@ -64,35 +64,34 @@ Contains
verbosity = verblvl
rank = logrank
End Subroutine mph_log_init
End subroutine MPH_log_init
!> Exit the module.
!!
!! Reset the unit used to log usual, error and warning messages
!! to their default values.
!!
Subroutine mph_log_exit
!!
subroutine MPH_log_exit
unit_err = 0
unit_warn = 0
unit_std = 6
verbosity = -1
End Subroutine mph_log_exit
End subroutine MPH_log_exit
!> Log a message.
!!
!! @param[in] msg_class The class of the message
!! @param[in] msg The message to be logged
!!
Subroutine mph_log(msg_class, msg)
!!
subroutine MPH_log(msg_class, msg)
!* Arguments *!
Integer, Intent(in) :: msg_class
Character(len=*), Intent(in) :: msg
!- End of header -----------------------------------------------------------
If ( verbosity >= msg_class ) Then
......@@ -112,22 +111,22 @@ Contains
End If
End Subroutine mph_log
End subroutine MPH_log
!> Log a message with a status as additional information.
!!
!! @param[in] msg_class The class of the message
!! @param[in] msg_stat Integer specifying the status of the message
!! @param[in] msg The message to be logged
!!
Subroutine mph_logWithInfo(msg_class,msg_stat, msg)
!!
subroutine MPH_logWithInfo(msg_class,msg_stat, msg)
!* Arguments *!
Integer, Intent(in) :: msg_class
Integer, Intent(in) :: msg_stat
Character(len=*), Intent(in) :: msg
!- End of header -----------------------------------------------------------
If ( verbosity >= msg_class ) Then
......@@ -156,35 +155,35 @@ Contains
End If
End Subroutine mph_logWithInfo
End subroutine MPH_logWithInfo
! [+] routine : mph_log_GetVerbosity ---------------------------------------
! [+] routine : MPH_log_GetVerbosity ---------------------------------------
!
!> Provide to the user the verbosity level
!!
!! @param[out] verblvl The verbosity
!!
Subroutine mph_log_GetVerbosity(verblvl)
!!
subroutine MPH_log_GetVerbosity(verblvl)
!* Arguments *!
Integer, Intent(out) :: verblvl
!- End of header -----------------------------------------------------------
verblvl = verbosity
End Subroutine mph_log_GetVerbosity
End subroutine MPH_log_GetVerbosity
! [+] routine : mph_log_GetUnit -------------------------------------------
! [+] routine : MPH_log_GetUnit -------------------------------------------
!
!> Provide to the user the unit associated to a class of messages.
!!
!! @param[in ] msg_class the class of messages
!! @param[out] unit the unit associated to the class.
!!
Subroutine mph_log_GetUnit(msg_class, unit )
!!
subroutine MPH_log_GetUnit(msg_class, unit )
!* Arguments *!
......@@ -200,10 +199,10 @@ Contains
Case (MSG_VERBOSE); unit = unit_std
Case (MSG_VERBOSE2); unit = unit_std
Case (MSG_DEBUG ); unit = unit_err
Case Default ; unit = unit_std
Case Default ; unit = unit_std
End Select
End Subroutine mph_log_GetUnit
End subroutine MPH_log_GetUnit
End Module mph_log_mod
End Module MPH_log_mod
......@@ -5,9 +5,9 @@
! [+] module : MPH_mem_mod ---------------------------------------------------
!
!> MaPHyS memory module
!!
!!
Module MPH_mem_mod
!* No implicit typing *!
Implicit None
......@@ -15,28 +15,28 @@ Module MPH_mem_mod
Character(len=MAPHYS_STRL), Private, Parameter ::&
FLNAME = "MPH_mem_mod.F90"
!* Type definition *!
!* Type definition *!
Type MPH_mem_t; sequence
! memory usage related to the instance (in Bytes)
Integer(Kind=8) :: memusage
Integer(Kind=8) :: memusage
! memory peak related to the instance (in Bytes)
Integer(Kind=8) :: mempeak
! memory usage of a package related to the instance (in Bytes).
! It is process dependent.
Integer(Kind=8) :: pidmemusage
! It is process dependent.
Integer(Kind=8) :: pidmemusage
! memory peak of a package related to the instance (in Bytes).
! It is process dependent.
! It is process dependent.
Integer(Kind=8) :: pidmempeak
End type MPH_mem_t
!* Access specifiers *!
Public :: byte2Mbyte
Public :: Mbyte2byte
Public :: Byte2MByte
Public :: MByte2Byte
Public :: MPH_mem_init
Public :: MPH_mem_exit
......@@ -60,100 +60,100 @@ Module MPH_mem_mod
Public :: MPH_mem_add2peak
Public :: MPH_mem_add2pidpeak
Public :: MPH_mem_sub2usage
!* routines *!
Contains
! [+] function : Byte2MByte ------------------------------------------------
!
!
!> convert a size in bytes into a size in Mega bytes
Integer(kind=4) Function Byte2MByte(bytes)
Implicit None
Integer(kind=8) :: bytes
Real (kind=8) :: conv
conv = 1_8/Real(1048576,KIND=8)
Byte2MByte = Ceiling( Real(bytes,KIND=8) * conv )
End Function Byte2MByte
! [+] function : MByte2Byte ------------------------------------------------
!
!
!> convert a size in Mega bytes into a size in bytes
Integer(kind=4) Function MByte2Byte(bytes)
Implicit None
Integer(kind=8) :: bytes
Real (kind=8) :: conv
conv = Real(1048576,KIND=8)
MByte2Byte = Ceiling( Real(bytes,KIND=8) * conv )
End Function MByte2Byte
!
! constructors & destructors
!
Subroutine MPH_mem_init( mem )
subroutine MPH_mem_init( mem )
Type(MPH_mem_t), Intent(out) :: mem
mem%memusage = 0
mem%mempeak = 0
mem%pidmempeak = 0
mem%pidmemusage = 0
End Subroutine MPH_mem_init
End subroutine MPH_mem_init
Subroutine MPH_mem_exit( mem )
subroutine MPH_mem_exit( mem )
Type(MPH_mem_t), Intent(out) :: mem
mem%memusage = 0
mem%mempeak = 0
mem%pidmempeak = 0
mem%pidmemusage = 0
End Subroutine MPH_mem_exit
End subroutine MPH_mem_exit
Subroutine MPH_mem_build( mem, memusage, mempeak, pidmemusage, pidmempeak )
subroutine MPH_mem_build( mem, memusage, mempeak, pidmemusage, pidmempeak )
Type(MPH_mem_t), Intent(out) :: mem
Integer(Kind=8) , Intent(in) :: memusage
Integer(Kind=8) , Intent(in) :: memusage
Integer(Kind=8) , Intent(in) :: mempeak
Integer(Kind=8) , Intent(in) :: pidmemusage
Integer(Kind=8) , Intent(in) :: pidmemusage
Integer(Kind=8) , Intent(in) :: pidmempeak
mem%memusage = memusage
mem%mempeak = mempeak
mem%pidmempeak = pidmemusage
mem%pidmemusage = pidmempeak
End Subroutine MPH_mem_build
End subroutine MPH_mem_build
!
! setters
!
Subroutine MPH_mem_setusage( mem, memset )
subroutine MPH_mem_setusage( mem, memset )
Type(MPH_mem_t), Intent(inout) :: mem
Integer(Kind=8) , Intent(in) :: memset
mem%memusage = memset
Call MPH_mem_update(mem)
End Subroutine MPH_mem_setusage
End subroutine MPH_mem_setusage
Subroutine MPH_mem_setpeak( mem, memset )
subroutine MPH_mem_setpeak( mem, memset )
Type(MPH_mem_t), Intent(inout) :: mem
Integer(Kind=8) , Intent(in) :: memset
mem%mempeak = memset
Call MPH_mem_update(mem)
End Subroutine MPH_mem_setpeak
End subroutine MPH_mem_setpeak
Subroutine MPH_mem_setpidusage( mem, memset )
subroutine MPH_mem_setpidusage( mem, memset )
Type(MPH_mem_t), Intent(inout) :: mem
Integer(Kind=8) , Intent(in) :: memset
mem%pidmemusage = memset
Call MPH_mem_update(mem)
End Subroutine MPH_mem_setpidusage
End subroutine MPH_mem_setpidusage
Subroutine MPH_mem_setpidpeak( mem, memset )
subroutine MPH_mem_setpidpeak( mem, memset )
Type(MPH_mem_t), Intent(inout) :: mem
Integer(Kind=8) , Intent(in) :: memset
mem%pidmempeak = memset
Call MPH_mem_update(mem)
End Subroutine MPH_mem_setpidpeak
End subroutine MPH_mem_setpidpeak
!
! getters
......@@ -201,11 +201,11 @@ Module MPH_mem_mod
Type(MPH_mem_t), Intent(in) :: mem
Type(mph_env_t), Intent(in) :: env
Integer :: nodcomm, ierr
Integer(Kind=8) :: pidmem, nodmem
nodcomm = mph_env_getNodeComm(env)
nodcomm = mph_env_getnodecomm(env)
pidmem=mem%memusage + mem%pidmemusage
Call MPI_AllReduce(pidmem,nodmem,1,&
MPI_INTEGER8,MPI_SUM,&
......@@ -223,13 +223,13 @@ Module MPH_mem_mod
Type(MPH_mem_t), Intent(in) :: mem
Type(mph_env_t), Intent(in) :: env
Integer :: nodcomm, ierr
Integer(Kind=8) :: pidmem, nodmem
! Return the memory peak of the node
nodcomm = mph_env_getNodeComm(env)
nodcomm = mph_env_getnodecomm(env)
pidmem=mem%mempeak + mem%pidmempeak
Call MPI_AllReduce(pidmem,nodmem,1,&
MPI_INTEGER8,MPI_SUM,&
......@@ -241,13 +241,13 @@ Module MPH_mem_mod
! methods
!
Subroutine MPH_mem_update(mem)
subroutine MPH_mem_update(mem)
Type(MPH_mem_t), Intent(inout) :: mem
mem%pidmempeak = Max(mem%pidmempeak, mem%pidmemusage)
mem%mempeak = Max(mem%mempeak, mem%memusage)
End Subroutine MPH_mem_update
End subroutine MPH_mem_update
Subroutine MPH_mem_add2mem( mem, memadded )
subroutine MPH_mem_add2mem( mem, memadded )
Type(MPH_mem_t), Intent(inout) :: mem
Type(MPH_mem_t), Intent(in ) :: memadded
......@@ -260,33 +260,33 @@ Module MPH_mem_mod
mem%pidmemusage = mem%pidmemusage + memadded%pidmemusage
Call MPH_mem_update(mem)
End Subroutine MPH_mem_add2mem
End subroutine MPH_mem_add2mem
Subroutine MPH_mem_add2usage( mem, memadded )
subroutine MPH_mem_add2usage( mem, memadded )
Type(MPH_mem_t), Intent(inout) :: mem
Integer(Kind=8) , Intent(in) :: memadded
Integer(Kind=8) , Intent(in) :: memadded
mem%memusage = mem%memusage + memadded
Call MPH_mem_update(mem)
End Subroutine MPH_mem_add2usage
End subroutine MPH_mem_add2usage
Subroutine MPH_mem_add2peak( mem, memadded )
subroutine MPH_mem_add2peak( mem, memadded )
Type(MPH_mem_t), Intent(inout) :: mem
Integer(Kind=8) , Intent(in) :: memadded
Call MPH_mem_update(mem)
mem%mempeak = mem%mempeak + memadded
End Subroutine MPH_mem_add2peak
End subroutine MPH_mem_add2peak
Subroutine MPH_mem_add2pidpeak( mem, memadded )
subroutine MPH_mem_add2pidpeak( mem, memadded )
Type(MPH_mem_t), Intent(inout) :: mem
Integer(Kind=8) , Intent(in) :: memadded
Call MPH_mem_update(mem)
mem%pidmempeak = mem%pidmempeak + memadded
End Subroutine MPH_mem_add2pidpeak
End subroutine MPH_mem_add2pidpeak
Subroutine MPH_mem_sub2usage( mem, memsubstracted )
subroutine MPH_mem_sub2usage( mem, memsubstracted )
Type(MPH_mem_t), Intent(inout) :: mem
Integer(Kind=8) , Intent(in) :: memsubstracted
mem%memusage = mem%memusage - memsubstracted
End Subroutine MPH_mem_sub2usage
End subroutine MPH_mem_sub2usage
End Module MPH_mem_mod
! handle timing
! handle timing
Module MPH_time_mod
Implicit None
Public :: MPH_time_start
Public :: MPH_time_stop
Public :: MPH_time_add
......@@ -9,31 +9,31 @@
Contains
Subroutine MPH_time_start(time)
subroutine MPH_time_start(time)
Implicit None
Real(Kind=8), Intent(out) :: time
Real(Kind=8), External :: MPI_Wtime
time = MPI_Wtime()
End Subroutine MPH_time_start
Real(Kind=8), External :: MPI_WTime
time = MPI_WTime()
End subroutine MPH_time_start
Subroutine MPH_time_stop(time)
subroutine MPH_time_stop(time)
Implicit None
Real(Kind=8), Intent(inout) :: time
Real(Kind=8), External :: MPI_Wtime
time = MPI_Wtime() - time
End Subroutine MPH_time_stop
Real(Kind=8), External :: MPI_WTime
time = MPI_WTime() - time
End subroutine MPH_time_stop
Subroutine MPH_time_add(time,timetoadd)
subroutine MPH_time_add(time,timetoadd)
Implicit None
Real(Kind=8), Intent(inout) :: time
Real(Kind=8), Intent(in ) :: timetoadd
time = time + timetoadd
End Subroutine MPH_time_add
End subroutine MPH_time_add
Subroutine MPH_time_reset(time)
subroutine MPH_time_reset(time)
Implicit None
Real(Kind=8), Intent(out) :: time
time = 0.d0
End Subroutine MPH_time_reset
End subroutine MPH_time_reset
End Module MPH_time_mod
!> enumerations for [CDSZ]MPH_dds_chameleon_mod modules
Module MPH_dds_chameleon_enum
!> sizes
Integer, parameter :: MAPHYS_CHAMELEON_STATE_SIZE = 6
Integer, parameter :: MAPHYS_CHAMELEON_OPTION_SIZE = 2
Integer, parameter :: MAPHYS_CHAMELEON_RINFO_SIZE = 2
!> States
Integer, Parameter :: CHAMELEON_STATE_isValid = 1
Integer, Parameter :: CHAMELEON_STATE_Factorized = 2
!> statistics
Integer, Parameter :: CHAMELEON_OPTION_CompStats = 2
Integer, Parameter :: CHAMELEON_RINFO_Norm1 = 1
Integer, Parameter :: CHAMELEON_RINFO_RCond1 = 2
Integer, Parameter :: CHAMELEON_OPTION_CompStats = 2
Integer, Parameter :: CHAMELEON_RINFO_Norm1 = 1
Integer, Parameter :: CHAMELEON_RINFO_RCond1 = 2
End Module MPH_dds_chameleon_enum
......@@ -2,11 +2,11 @@
Module MPH_dds_enum
!> enumerations
integer, parameter :: DDS_isUNAVAILABLE = -1
integer, parameter :: DDS_isUNAVAILABLE = -1
integer, parameter :: DDS_isLAPACK = 1
integer, parameter :: DDS_isCHAMELEON = 2
!> rinfo enumerations
Integer, Parameter :: DDS_RINFO_NORM1 = 1
Integer, Parameter :: DDS_RINFO_RCOND1 = 2
End Module MPH_dds_enum
!> enumerations for [CDSZ]MPH_dds_lapack_mod modules
Module MPH_dds_lapack_enum
!> sizes
Integer, parameter :: MAPHYS_LAPACK_STATE_SIZE = 6
Integer, parameter :: MAPHYS_LAPACK_OPTION_SIZE = 2
Integer, parameter :: MAPHYS_LAPACK_RINFO_SIZE = 2