ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_err::stop_type Type Reference

Generate and return an object of type warn_type with the user-specified input attributes. More...

Inheritance diagram for pm_err::stop_type:
Collaboration diagram for pm_err::stop_type:

Public Member Functions

 excluded
 

Public Attributes

character(:, SK), allocatable, public help
 See the corresponding definition in the documentation of the default constructor of the derived type stop_type.
More...
 
integer(IK), allocatable, public stat
 See the corresponding definition in the documentation of the default constructor of the derived type stop_type.
More...
 
logical(LK), allocatable, public renabled
 See the corresponding definition in the documentation of the default constructor of the derived type stop_type.
More...
 
- Public Attributes inherited from pm_err::message_type
character(:, SK), allocatable, public prefix
 See the corresponding definition in the documentation of getStrWrapped.
More...
 
character(:, SK), allocatable, public indent
 See the corresponding definition in the documentation of getStrWrapped.
More...
 
character(:, SK), allocatable, public break
 See the corresponding definition in the documentation of getStrWrapped.
More...
 
character(:, SK), allocatable, public newline
 See the corresponding definition in the documentation of getStrWrapped.
More...
 
integer(IK), allocatable, public width
 See the corresponding definition in the documentation of getStrWrapped.
More...
 
integer(IK), allocatable, public maxwidth
 See the corresponding definition in the documentation of getStrWrapped.
More...
 
integer(IK), allocatable, public tmsize
 See the corresponding definition in the documentation of getStrWrapped.
More...
 
integer(IK), allocatable, public bmsize
 See the corresponding definition in the documentation of getStrWrapped.
More...
 
integer(IK), allocatable, public unit
 See the corresponding definition in the documentation of message_type.
More...
 
logical(LK), public sticky = .false._LK
 See the corresponding argument in the documentation of message_type.
More...
 

Detailed Description

Generate and return an object of type warn_type with the user-specified input attributes.

This generic interface serves as the custom constructor for objects of type warn_type.
See the documentation of warn_type for the documentation of the input arguments.
This custom constructor exists because of a GNU Fortran Compiler gfortran bug in the implementation of the default constructor.
See the bug description below.

See also
warn_type
Test:
test_pm_err
Bug:

Status: Unresolved
Source: GNU Fortran Compiler gfortran version 11-13
Description: GNU Fortran Compiler gfortran cannot properly construct the allocatable scalar non-character components of objects of type warn_type using the default constructor.
For example, when unit is set via the default constructor, the program behaves as if the unit component of the object is allocated but unset, yielding a segmentation fault error.

Remedy (as of ParaMonte Library version 2.0.0): For now, the custom constructor bypasses GNU Fortran Compiler gfortran bug.
Todo:
Low Priority: A test should be implemented for arrays of size that can be represented only by an IKD integer.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, Tuesday March 7, 2017, 3:50 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

This is the derived type for constructing objects that contain the specifications of the generic interface setAborted along with a dynamic method show that acts as a convenience wrapper around the generic interface setAborted.

See the documentation of the parent type message_type for more details and inherited derived type components.

Parameters
[in]help: The input scalar of type character of default kind SK of arbitrary length type parameter.
For details, see the description of the corresponding argument of the setAborted dynamic method of the derived type.
(optional. The default value is set as described in the documentation of the corresponding argument of setAborted.)
[in]stat: The input scalar integer of default kind IK.
For details, see the description of the corresponding argument of the setAborted dynamic method of the derived type.
(optional. The default value is set as described in the documentation of the corresponding argument of setAborted.)
[in]renabled: The input scalar logical of default kind LK.
For details, see the description of the corresponding argument of the setAborted dynamic method of the derived type.
(optional. The default value is set as described in the documentation of the corresponding argument of setAborted.)
Returns
stop : An object of type stop_type containing the attributes and wrapper method for aborting a program with an abortion message.


Possible calling interfaces

use pm_err, only: stop_type
type(stop_type) :: stop
stop = stop_type( prefix = prefix &
, indent = indent &
, break = break &
, newline = newline &
, width = width &
, maxwidth = maxwidth &
, tmsize = tmsize &
, bmsize = bmsize &
, unit = unit &
, sticky = sticky &
, stat = stat &
, help = help &
, renabled = renabled &
)
This module contains classes and procedures for reporting and handling errors.
Definition: pm_err.F90:52
Generate and return an object of type warn_type with the user-specified input attributes.
Definition: pm_err.F90:1442
See also
mark_type
note_type
warn_type
stop_type
display_type
message_type
getStrWrapped
getCentered
setCentered


Example usage

1program example
2
3 use pm_kind, only: IK, LK
4 use pm_io, only: display_type
5 use pm_err, only: stop_type
6 use pm_kind, only: SK ! All kinds are supported.
7 use iso_fortran_env, only: output_unit
8
9 implicit none
10
11 character(:, SK), allocatable :: str, strWrapped
12
13 type(display_type) :: disp
14
15 disp = display_type(file = SK_"main.out.F90")
16
17 str = "ParaMonte is a serial/parallel library of Monte Carlo routines for \n&
18 & + optimization, \n&
19 & + sampling, and \n&
20 & + integration \n&
21 &of mathematical objective functions of arbitrary-dimensions, &
22 &in particular, the posterior distributions of Bayesian models in \n&
23 & + data science, \n&
24 & + Machine Learning, and \n&
25 & + scientific inference, \n&
26 &with the design goal of unifying the \n&
27 & + automation (of Monte Carlo simulations), \n&
28 & + user-friendliness (of the library), \n&
29 & + accessibility (from multiple programming environments), \n&
30 & + high-performance (at runtime), and \n&
31 & + scalability (across many parallel processors)."
32
33 call disp%skip()
34 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
35 call disp%show("! Notify the user about an important message.")
36 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
37 call disp%skip()
38
39 block
40 type(stop_type) :: stop
41 call disp%show("stop = stop_type(unit = disp%unit, newline = SK_'\n', prefix = SK_' ParaMonte', renabled = .true._LK)")
42 stop = stop_type(unit = disp%unit, newline = SK_'\n', prefix = SK_' ParaMonte', renabled = .true._LK)
43 call disp%show("str")
44 call disp%show( str, deliml = SK_"""" )
45 call disp%skip()
46 call disp%show("call stop%show(str)")
47 call stop%show(str)
48 call disp%skip()
49 call disp%show("call stop%show(str, width = 72_IK, sticky = .true._LK)")
50 call stop%show(str, width = 72_IK, sticky = .true._LK)
51 call disp%skip()
52 call disp%show("call stop%show(str) ! same width as before.")
53 call stop%show(str) ! same width as before.
54 call disp%skip()
55 end block
56
57end program example
Generate and return an object of type stop_type with the user-specified input attributes.
Definition: pm_err.F90:1618
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3! Notify the user about an important message.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6stop = stop_type(unit = disp%unit, newline = SK_'\n', prefix = SK_' ParaMonte', renabled = .true._LK)
7str
8"ParaMonte is a serial/parallel library of Monte Carlo routines for \n + optimization, \n + sampling, and \n + integration \nof mathematical objective functions of arbitrary-dimensions, in particular, the posterior distributions of Bayesian models in \n + data science, \n + Machine Learning, and \n + scientific inference, \nwith the design goal of unifying the \n + automation (of Monte Carlo simulations), \n + user-friendliness (of the library), \n + accessibility (from multiple programming environments), \n + high-performance (at runtime), and \n + scalability (across many parallel processors)."
9
10call stop%show(str)
11
12 ParaMonte - FATAL: ParaMonte is a serial/parallel library of Monte Carlo routines for
13 ParaMonte - FATAL: + optimization,
14 ParaMonte - FATAL: + sampling, and
15 ParaMonte - FATAL: + integration
16 ParaMonte - FATAL: of mathematical objective functions of arbitrary-dimensions, in particular, the posterior distributions of Bayesian models in
17 ParaMonte - FATAL: + data science,
18 ParaMonte - FATAL: + Machine Learning, and
19 ParaMonte - FATAL: + scientific inference,
20 ParaMonte - FATAL: with the design goal of unifying the
21 ParaMonte - FATAL: + automation(of Monte Carlo simulations),
22 ParaMonte - FATAL: + user-friendliness(of the library),
23 ParaMonte - FATAL: + accessibility(from multiple programming environments),
24 ParaMonte - FATAL: + high-performance(at runtime), and
25 ParaMonte - FATAL: + scalability(across many parallel processors).
26
27call stop%show(str, width = 72_IK, sticky = .true._LK)
28
29 ParaMonte - FATAL: ParaMonte is a serial/parallel library of Monte Carlo routines for
30 ParaMonte - FATAL: + optimization,
31 ParaMonte - FATAL: + sampling, and
32 ParaMonte - FATAL: + integration
33 ParaMonte - FATAL: of mathematical objective functions of arbitrary-dimensions, in particular,
34 ParaMonte - FATAL: the posterior distributions of Bayesian models in
35 ParaMonte - FATAL: + data science,
36 ParaMonte - FATAL: + Machine Learning, and
37 ParaMonte - FATAL: + scientific inference,
38 ParaMonte - FATAL: with the design goal of unifying the
39 ParaMonte - FATAL: + automation(of Monte Carlo simulations),
40 ParaMonte - FATAL: + user-friendliness(of the library),
41 ParaMonte - FATAL: + accessibility(from multiple programming environments),
42 ParaMonte - FATAL: + high-performance(at runtime), and
43 ParaMonte - FATAL: + scalability(across many parallel processors).
44
45call stop%show(str) ! same width as before.
46
47 ParaMonte - FATAL: ParaMonte is a serial/parallel library of Monte Carlo routines for
48 ParaMonte - FATAL: + optimization,
49 ParaMonte - FATAL: + sampling, and
50 ParaMonte - FATAL: + integration
51 ParaMonte - FATAL: of mathematical objective functions of arbitrary-dimensions, in particular,
52 ParaMonte - FATAL: the posterior distributions of Bayesian models in
53 ParaMonte - FATAL: + data science,
54 ParaMonte - FATAL: + Machine Learning, and
55 ParaMonte - FATAL: + scientific inference,
56 ParaMonte - FATAL: with the design goal of unifying the
57 ParaMonte - FATAL: + automation(of Monte Carlo simulations),
58 ParaMonte - FATAL: + user-friendliness(of the library),
59 ParaMonte - FATAL: + accessibility(from multiple programming environments),
60 ParaMonte - FATAL: + high-performance(at runtime), and
61 ParaMonte - FATAL: + scalability(across many parallel processors).
62
63
Test:
test_pm_err
Bug:

Status: Unresolved
Source: GNU Fortran Compiler gfortran version 11-13
Description: GNU Fortran Compiler gfortran cannot properly construct the allocatable scalar non-character components of objects of type stop_type using the default constructor.
For example, when unit is set via the default constructor, the program behaves as if the unit component of the object is allocated but unset, yielding a segmentation fault error.

Remedy (as of ParaMonte Library version 2.0.0): For now, the custom constructor bypasses GNU Fortran Compiler gfortran bug.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, Tuesday March 7, 2017, 3:50 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 1442 of file pm_err.F90.

Member Function/Subroutine Documentation

◆ excluded()

pm_err::stop_type::excluded

Definition at line 1468 of file pm_err.F90.

Member Data Documentation

◆ help

character(:, SK), allocatable, public pm_err::stop_type::help

See the corresponding definition in the documentation of the default constructor of the derived type stop_type.

Definition at line 1443 of file pm_err.F90.

◆ renabled

logical(LK), allocatable, public pm_err::stop_type::renabled

See the corresponding definition in the documentation of the default constructor of the derived type stop_type.

Definition at line 1445 of file pm_err.F90.

◆ stat

integer(IK), allocatable, public pm_err::stop_type::stat

See the corresponding definition in the documentation of the default constructor of the derived type stop_type.

Definition at line 1444 of file pm_err.F90.


The documentation for this type was generated from the following file: