ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_sysInfo.F90
Go to the documentation of this file.
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3!!!! !!!!
4!!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5!!!! !!!!
6!!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7!!!! !!!!
8!!!! This file is part of the ParaMonte library. !!!!
9!!!! !!!!
10!!!! LICENSE !!!!
11!!!! !!!!
12!!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13!!!! !!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
34
35!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36
38
40! The Intel FPP defines `linux=1` which conflicts with the `linux` component of `kernelis_type` below.
41#if __INTEL_COMPILER
42#undef linux
43#endif
44
45
46 use pm_kind, only: IK, LK, RK, CK, SK
47
48 implicit none
49
50 character(*, SK), parameter :: MODULE_NAME = SK_"@pm_sysInfo"
51
52!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53
118 logical(LK) :: windows = .false._LK
119 logical(LK) :: cygwin = .false._LK
120 logical(LK) :: mingw = .false._LK
121 logical(LK) :: msys = .false._LK
122 logical(LK) :: linux = .false._LK
123 logical(LK) :: darwin = .false._LK
124 logical(LK) :: freebsd = .false._LK
125 end type
126
127 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
128
130 interface kernelis_type
131
132 impure module function kernelis_typer() result(kernelis)
133#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
134 !DEC$ ATTRIBUTES DLLEXPORT :: kernelis_typer
135#endif
136 type(kernelis_type) :: kernelis
137 end function
138
139 impure module function kernelis_typerFailed(failed) result(kernelis)
140#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
141 !DEC$ ATTRIBUTES DLLEXPORT :: kernelis_typerFailed
142#endif
143 use pm_kind, only: SKG => SK
144 logical(LK) , intent(out) :: failed
145 type(kernelis_type) :: kernelis
146 end function
147
148 impure module function kernelis_typerFailedMsg(failed, errmsg) result(kernelis)
149#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
150 !DEC$ ATTRIBUTES DLLEXPORT :: kernelis_typerFailedMsg
151#endif
152 use pm_kind, only: SKG => SK
153 logical(LK) , intent(out) :: failed
154 character(*,SKG), intent(inout) :: errmsg
155 type(kernelis_type) :: kernelis
156 end function
157
158 end interface
160
161!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
162
245 character(:, SK), allocatable :: name
246 type(kernelis_type) :: is
247 end type
248
249 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
250
252 interface kernel_type
253
254 impure module function kernel_typer() result(kernel)
255#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
256 !DEC$ ATTRIBUTES DLLEXPORT :: kernel_typer
257#endif
258 type(kernel_type) :: kernel
259 end function
260
261 impure module function kernel_typerFailed(failed) result(kernel)
262#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
263 !DEC$ ATTRIBUTES DLLEXPORT :: kernel_typerFailed
264#endif
265 use pm_kind, only: SKG => SK
266 logical(LK) , intent(out) :: failed
267 type(kernel_type) :: kernel
268 end function
269
270 impure module function kernel_typerFailedMsg(failed, errmsg) result(kernel)
271#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
272 !DEC$ ATTRIBUTES DLLEXPORT :: kernel_typerFailedMsg
273#endif
274 use pm_kind, only: SKG => SK
275 logical(LK) , intent(out) :: failed
276 character(*,SKG), intent(inout) :: errmsg
277 type(kernel_type) :: kernel
278 end function
279
280 end interface
282
283!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
284
424
425 interface getSysInfo
426
427 module function getSysInfo() result(sysInfo)
428#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
429 !DEC$ ATTRIBUTES DLLEXPORT :: getSysInfo
430#endif
431 use pm_kind, only: SKG => SK
432 character(:,SKG) , allocatable :: sysInfo
433 end function
434
435 module function getSysInfoFailed(failed) result(sysInfo)
436#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
437 !DEC$ ATTRIBUTES DLLEXPORT :: getSysInfoFailed
438#endif
439 use pm_kind, only: SKG => SK
440 logical(LK) , intent(out) :: failed
441 character(:,SKG) , allocatable :: sysInfo
442 end function
443
444 module function getSysInfoFailedMsg(failed, errmsg) result(sysInfo)
445#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
446 !DEC$ ATTRIBUTES DLLEXPORT :: getSysInfoFailedMsg
447#endif
448 use pm_kind, only: SKG => SK
449 logical(LK) , intent(out) :: failed
450 character(*,SKG), intent(inout) :: errmsg
451 character(:,SKG) , allocatable :: sysInfo
452 end function
453
454 end interface
455
456!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
457
516
517 module function isKernelWindows() result(itis)
518#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
519 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelWindows
520#endif
521 logical(LK) :: itis
522 end function
523
524 module function isKernelWindowsFailed(failed) result(itis)
525#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
526 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelWindowsFailed
527#endif
528 use pm_kind, only: SKG => SK
529 logical(LK) , intent(out) :: failed
530 logical(LK) :: itis
531 end function
532
533 module function isKernelWindowsFailedMsg(failed, errmsg) result(itis)
534#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
535 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelWindowsFailedMsg
536#endif
537 logical(LK) , intent(out) :: failed
538 character(*, SK), intent(inout) :: errmsg
539 logical(LK) :: itis
540 end function
541
542 end interface
543
544!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
545
604
605 module function isKernelDarwin() result(itis)
606#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
607 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelDarwin
608#endif
609 logical(LK) :: itis
610 end function
611
612 module function isKernelDarwinFailed(failed) result(itis)
613#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
614 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelDarwinFailed
615#endif
616 use pm_kind, only: SKG => SK
617 logical(LK) , intent(out) :: failed
618 logical(LK) :: itis
619 end function
620
621 module function isKernelDarwinFailedMsg(failed, errmsg) result(itis)
622#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
623 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelDarwinFailedMsg
624#endif
625 logical(LK) , intent(out) :: failed
626 character(*, SK), intent(inout) :: errmsg
627 logical(LK) :: itis
628 end function
629
630 end interface
631
632!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
633
692
693 module function isKernelLinux() result(itis)
694#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
695 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelLinux
696#endif
697 logical(LK) :: itis
698 end function
699
700 module function isKernelLinuxFailed(failed) result(itis)
701#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
702 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelLinuxFailed
703#endif
704 use pm_kind, only: SKG => SK
705 logical(LK) , intent(out) :: failed
706 logical(LK) :: itis
707 end function
708
709 module function isKernelLinuxFailedMsg(failed, errmsg) result(itis)
710#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
711 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelLinuxFailedMsg
712#endif
713 logical(LK) , intent(out) :: failed
714 character(*, SK), intent(inout) :: errmsg
715 logical(LK) :: itis
716 end function
717
718 end interface
719
720!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
721
723#undef PURITY
724
725
726end module pm_sysInfo ! LCOV_EXCL_LINE
Generate and return a string containing a comprehensive report of the operating system and platform s...
Definition: pm_sysInfo.F90:425
Generate and return .true. if the Operating System kernel is the macOS Darwin.
Definition: pm_sysInfo.F90:603
Generate and return .true. if the Operating System kernel is Linux.
Definition: pm_sysInfo.F90:691
Generate and return .true. if the Operating System kernel is the Windows.
Definition: pm_sysInfo.F90:515
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
Definition: pm_kind.F90:543
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter CK
The default complex kind in the ParaMonte library: real64 in Fortran, c_double_complex in C-Fortran I...
Definition: pm_kind.F90:542
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
This module contains procedures and generic interfaces for inferring the operating system kernel type...
Definition: pm_sysInfo.F90:37
character(*, SK), parameter MODULE_NAME
Definition: pm_sysInfo.F90:50
This is the kernel_type class for generating objects with logical components to determine the operati...
Definition: pm_sysInfo.F90:244
This is the kernelis_type class for generating objects with logical components to determine the opera...
Definition: pm_sysInfo.F90:117