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
345
346 interface getSysInfo
347
348 module function getSysInfo() result(sysInfo)
349#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
350 !DEC$ ATTRIBUTES DLLEXPORT :: getSysInfo
351#endif
352 use pm_kind, only: SKG => SK
353 character(:,SKG) , allocatable :: sysInfo
354 end function
355
356 module function getSysInfoFailed(failed) result(sysInfo)
357#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
358 !DEC$ ATTRIBUTES DLLEXPORT :: getSysInfoFailed
359#endif
360 use pm_kind, only: SKG => SK
361 logical(LK) , intent(out) :: failed
362 character(:,SKG) , allocatable :: sysInfo
363 end function
364
365 module function getSysInfoFailedMsg(failed, errmsg) result(sysInfo)
366#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
367 !DEC$ ATTRIBUTES DLLEXPORT :: getSysInfoFailedMsg
368#endif
369 use pm_kind, only: SKG => SK
370 logical(LK) , intent(out) :: failed
371 character(*,SKG), intent(inout) :: errmsg
372 character(:,SKG) , allocatable :: sysInfo
373 end function
374
375 end interface
376
377!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
378
437
438 module function isKernelWindows() result(itis)
439#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
440 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelWindows
441#endif
442 logical(LK) :: itis
443 end function
444
445 module function isKernelWindowsFailed(failed) result(itis)
446#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
447 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelWindowsFailed
448#endif
449 use pm_kind, only: SKG => SK
450 logical(LK) , intent(out) :: failed
451 logical(LK) :: itis
452 end function
453
454 module function isKernelWindowsFailedMsg(failed, errmsg) result(itis)
455#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
456 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelWindowsFailedMsg
457#endif
458 logical(LK) , intent(out) :: failed
459 character(*, SK), intent(inout) :: errmsg
460 logical(LK) :: itis
461 end function
462
463 end interface
464
465!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
466
525
526 module function isKernelDarwin() result(itis)
527#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
528 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelDarwin
529#endif
530 logical(LK) :: itis
531 end function
532
533 module function isKernelDarwinFailed(failed) result(itis)
534#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
535 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelDarwinFailed
536#endif
537 use pm_kind, only: SKG => SK
538 logical(LK) , intent(out) :: failed
539 logical(LK) :: itis
540 end function
541
542 module function isKernelDarwinFailedMsg(failed, errmsg) result(itis)
543#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
544 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelDarwinFailedMsg
545#endif
546 logical(LK) , intent(out) :: failed
547 character(*, SK), intent(inout) :: errmsg
548 logical(LK) :: itis
549 end function
550
551 end interface
552
553!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
554
613
614 module function isKernelLinux() result(itis)
615#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
616 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelLinux
617#endif
618 logical(LK) :: itis
619 end function
620
621 module function isKernelLinuxFailed(failed) result(itis)
622#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
623 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelLinuxFailed
624#endif
625 use pm_kind, only: SKG => SK
626 logical(LK) , intent(out) :: failed
627 logical(LK) :: itis
628 end function
629
630 module function isKernelLinuxFailedMsg(failed, errmsg) result(itis)
631#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
632 !DEC$ ATTRIBUTES DLLEXPORT :: isKernelLinuxFailedMsg
633#endif
634 logical(LK) , intent(out) :: failed
635 character(*, SK), intent(inout) :: errmsg
636 logical(LK) :: itis
637 end function
638
639 end interface
640
641!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
642
644#undef PURITY
645
646
647end 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:346
Generate and return .true. if the Operating System kernel is the macOS Darwin.
Definition: pm_sysInfo.F90:524
Generate and return .true. if the Operating System kernel is Linux.
Definition: pm_sysInfo.F90:612
Generate and return .true. if the Operating System kernel is the Windows.
Definition: pm_sysInfo.F90:436
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