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

This is the kernelis_type class for generating objects with logical components to determine the operating system (OS) kernel. More...

Public Attributes

logical(LK) windows = .false._LK
 The scalar logical value indicating whether the OS is Windows. More...
 
logical(LK) cygwin = .false._LK
 The scalar logical value indicating whether the OS is Cygwin. More...
 
logical(LK) mingw = .false._LK
 The scalar logical value indicating whether the OS is MinGW. More...
 
logical(LK) msys = .false._LK
 The scalar logical value indicating whether the OS is MSYS. More...
 
logical(LK) linux = .false._LK
 The scalar logical value indicating whether the OS is Linux. More...
 
logical(LK) darwin = .false._LK
 The scalar logical value indicating whether the OS is Darwin. More...
 
logical(LK) freebsd = .false._LK
 The scalar logical value indicating whether the OS is FreeBSD. More...
 

Detailed Description

This is the kernelis_type class for generating objects with logical components to determine the operating system (OS) kernel.

When an object of this type is generated, a single object component corresponding to OS kernel is set to .true..
The OS kernel is inferred either through compile-time preprocessing OS macros if they are defined or otherwise through runtime shell.

Warning
Beware that the environments "msys", "MinGW", "Cygwin" are not really standalone Operating Systems, rather Linux compatibility environments within Windows platforms.
As such, when such environments are detected, the windows component of the object of type kernelis_type is always set to .true..
Parameters
[out]failed: The output scalar logical of default kind LK that is .true. if and only if an error occurs while inferring the operating system kernel.
(optional. If missing and a runtime error occurs, the program will halt by calling error stop.)
[in,out]errmsg: The input/output scalar character of default kind SK of arbitrary length type parameter.
If an error occurs, errmsg will be set to a descriptive message about the nature of the runtime error.
A length of LEN_IOMSG characters is likely sufficient to capture most error messages in full.
(optional. It can be present only if failed is also present. If missing, no error message will be output.)
Returns
kernelis : The output scalar object of type kernelis_type containing the specifics of the runtime operating system kernel.


Possible calling interfaces

use pm_kind, only: LK
character(255, SK) :: errmsg
type(kernelis_type) :: kernelis
logical(LK) :: failed
kernelis = kernelis_type()
kernelis = kernelis_type(failed)
kernelis = kernelis_type(failed, errmsg)
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
This module contains procedures and generic interfaces for inferring the operating system kernel type...
Definition: pm_sysInfo.F90:37
This is the kernelis_type class for generating objects with logical components to determine the opera...
Definition: pm_sysInfo.F90:117
See also
getSysInfo
kernel_type
kernelis_type
shell_type
shellis_type
isShellWindows
isShellPosix
isKernelLinux
isKernelDarwin
isKernelWindows


Example usage

1program example
2
3 use pm_kind, only: LK, IK, SK
4 use pm_io, only: display_type
6
7 implicit none
8
9 logical(LK) :: failed
10 character(255, SK) :: errmsg
11 type(kernelis_type) :: kernelis
12
13 type(display_type) :: disp
14 disp = display_type(file = "main.out.F90")
15
16 call disp%skip()
17 call disp%show("kernelis = kernelis_type()")
18 kernelis = kernelis_type()
19 call dispShellIs()
20 call disp%skip()
21
22 call disp%skip()
23 call disp%show("kernelis = kernelis_type(failed)")
24 kernelis = kernelis_type(failed)
25 call disp%show("failed ! Check if any error has occurred.")
26 call disp%show( failed )
27 if (failed) then
28 call disp%show("SK_'error occurred.'")
29 call disp%show( SK_'error occurred.' , deliml = SK_"""" )
30 else
31 call dispShellIs()
32 end if
33 call disp%skip()
34
35 call disp%skip()
36 call disp%show("kernelis = kernelis_type(failed, errmsg)")
37 kernelis = kernelis_type(failed, errmsg)
38 call disp%show("failed ! Check if any error has occurred.")
39 call disp%show( failed )
40 if (failed) then
41 call disp%show("errmsg")
42 call disp%show( errmsg , deliml = SK_"""" )
43 else
44 call dispShellIs()
45 end if
46 call disp%skip()
47
48contains
49
50 subroutine dispShellIs()
51#if __INTEL_COMPILER
52#undef linux
53#endif
54 call disp%show("kernelis%windows")
55 call disp%show( kernelis%windows )
56 call disp%show("kernelis%cygwin")
57 call disp%show( kernelis%cygwin )
58 call disp%show("kernelis%mingw")
59 call disp%show( kernelis%mingw )
60 call disp%show("kernelis%msys")
61 call disp%show( kernelis%msys )
62 call disp%show("kernelis%linux")
63 call disp%show( kernelis%linux )
64 call disp%show("kernelis%darwin")
65 call disp%show( kernelis%darwin )
66 call disp%show("kernelis%freebsd")
67 call disp%show( kernelis%freebsd )
68 end subroutine
69
70end program example
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
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
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
2kernelis = kernelis_type()
3kernelis%windows
4F
5kernelis%cygwin
6F
7kernelis%mingw
8F
9kernelis%msys
10F
11kernelis%linux
12F
13kernelis%darwin
14F
15kernelis%freebsd
16F
17
18
19kernelis = kernelis_type(failed)
20failed ! Check if any error has occurred.
21F
22kernelis%windows
23F
24kernelis%cygwin
25F
26kernelis%mingw
27F
28kernelis%msys
29F
30kernelis%linux
31F
32kernelis%darwin
33F
34kernelis%freebsd
35F
36
37
38kernelis = kernelis_type(failed, errmsg)
39failed ! Check if any error has occurred.
40F
41kernelis%windows
42F
43kernelis%cygwin
44F
45kernelis%mingw
46F
47kernelis%msys
48F
49kernelis%linux
50F
51kernelis%darwin
52F
53kernelis%freebsd
54F
55
56


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 Austin

Definition at line 117 of file pm_sysInfo.F90.

Member Data Documentation

◆ cygwin

logical(LK) pm_sysInfo::kernelis_type::cygwin = .false._LK

The scalar logical value indicating whether the OS is Cygwin.

Definition at line 119 of file pm_sysInfo.F90.

◆ darwin

logical(LK) pm_sysInfo::kernelis_type::darwin = .false._LK

The scalar logical value indicating whether the OS is Darwin.

Definition at line 123 of file pm_sysInfo.F90.

◆ freebsd

logical(LK) pm_sysInfo::kernelis_type::freebsd = .false._LK

The scalar logical value indicating whether the OS is FreeBSD.

Definition at line 124 of file pm_sysInfo.F90.

◆ linux

logical(LK) pm_sysInfo::kernelis_type::linux = .false._LK

The scalar logical value indicating whether the OS is Linux.

Definition at line 122 of file pm_sysInfo.F90.

◆ mingw

logical(LK) pm_sysInfo::kernelis_type::mingw = .false._LK

The scalar logical value indicating whether the OS is MinGW.

Definition at line 120 of file pm_sysInfo.F90.

◆ msys

logical(LK) pm_sysInfo::kernelis_type::msys = .false._LK

The scalar logical value indicating whether the OS is MSYS.

Definition at line 121 of file pm_sysInfo.F90.

◆ windows

logical(LK) pm_sysInfo::kernelis_type::windows = .false._LK

The scalar logical value indicating whether the OS is Windows.

Definition at line 118 of file pm_sysInfo.F90.


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