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

Generate and return a string containing a comprehensive report of the operating system and platform specifications. More...

Detailed Description

Generate and return a string containing a comprehensive report of the operating system and platform specifications.

The system information is obtained by first identifying the operating system and the runtime shell and then calling one of the following platform/shell-specific commands:

  1. The commands uname -a + sysctl -a | grep machdep.cpu + system_profiler SPHardwareDataType on Darwin (macOS) platforms.
  2. The commands uname -a + lscpu + cat /proc/cpuinfo on Linux or other Unix-like platforms.
  3. The commands systeminfo on Windows platforms.
Parameters
[out]failed: The output scalar of type logical of default kind LK, that is .true. if and only if the process of fetching system information fails.
(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 the input argument failed is also present.)
Returns
sysInfo : The output allocatable scalar character of default kind SK containing the system information.


Possible calling interfaces

use pm_kind, only: SK
use test_pm_sys, only: getSysInfo
character(:, SK), allocatable :: sysInfo
sysInfo = getSysInfo()
sysInfo = getSysInfo(failed)
sysInfo = getSysInfo(failed, errmsg)
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
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
Remarks
The procedures under discussion are impure.
See also
getSysInfo
isKernelLinux
isKernelDarwin
isKernelWindows
kernelis_type
kernel_type


Example usage

1program example
2
3 use pm_kind, only: LK, IK, SK
4 use pm_io, only: display_type
5 use pm_sysInfo, only: getSysInfo
6
7 implicit none
8
9 logical(LK) :: failed
10 character(255, SK) :: errmsg
11 character(:, SK), allocatable :: sysinfo
12
13 type(display_type) :: disp
14 disp = display_type(file = "main.out.F90")
15
16 call disp%skip()
17 call disp%show("sysinfo = getSysInfo()")
18 sysinfo = getSysInfo()
19 call disp%show( sysinfo, deliml = SK_"""" )
20 call disp%skip()
21
22 call disp%skip()
23 call disp%show("sysinfo = getSysInfo(failed)")
24 sysinfo = getSysInfo(failed)
25 call disp%show( sysinfo, deliml = SK_"""" )
26 call disp%show("failed ! Check if any error has occurred.")
27 call disp%show( failed )
28 if (failed) then
29 call disp%show("SK_'error occurred.'")
30 call disp%show( SK_'error occurred.' , deliml = SK_"""" )
31 end if
32 call disp%skip()
33
34 call disp%skip()
35 call disp%show("sysinfo = getSysInfo(failed, errmsg)")
36 sysinfo = getSysInfo(failed, errmsg)
37 call disp%show( sysinfo, deliml = SK_"""" )
38 call disp%show("failed ! Check if any error has occurred.")
39 call disp%show( failed )
40 if (failed) then
41 call disp%show("SK_'error occurred: '//trim(errmsg)")
42 call disp%show( SK_'error occurred: '//trim(errmsg) , deliml = SK_"""" )
43 end if
44 call disp%skip()
45
46end 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
Generate and return a string containing a comprehensive report of the operating system and platform s...
Definition: pm_sysInfo.F90:346
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 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
This module contains procedures and generic interfaces for inferring the operating system kernel type...
Definition: pm_sysInfo.F90:37
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
2sysinfo = getSysInfo()
3"
4Linux amir 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
5
6Architecture: x86_64
7CPU op-mode(s): 32-bit, 64-bit
8Address sizes: 46 bits physical, 48 bits virtual
9Byte Order: Little Endian
10CPU(s): 24
11On-line CPU(s) list: 0-23
12Vendor ID: GenuineIntel
13Model name: 12th Gen Intel(R) Core(TM) i9-12950HX
14CPU family: 6
15Model: 151
16Thread(s) per core: 2
17Core(s) per socket: 12
18Socket(s): 1
19Stepping: 2
20BogoMIPS: 4991.99
21Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves avx_vnni umip waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize flush_l1d arch_capabilities
22Virtualization: VT-x
23Hypervisor vendor: Microsoft
24Virtualization type: full
25L1d cache: 576 KiB (12 instances)
26L1i cache: 384 KiB (12 instances)
27L2 cache: 15 MiB (12 instances)
28L3 cache: 30 MiB (1 instance)
29Vulnerability Gather data sampling: Not affected
30Vulnerability Itlb multihit: Not affected
31Vulnerability L1tf: Not affected
32Vulnerability Mds: Not affected
33Vulnerability Meltdown: Not affected
34Vulnerability Mmio stale data: Not affected
35Vulnerability Retbleed: Mitigation; Enhanced IBRS
36Vulnerability Spec rstack overflow: Not affected
37Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
38Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
39Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
40Vulnerability Srbds: Not affected
41Vulnerability Tsx async abort: Not affected
42"
43
44
45sysinfo = getSysInfo(failed)
46"
47Linux amir 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
48
49Architecture: x86_64
50CPU op-mode(s): 32-bit, 64-bit
51Address sizes: 46 bits physical, 48 bits virtual
52Byte Order: Little Endian
53CPU(s): 24
54On-line CPU(s) list: 0-23
55Vendor ID: GenuineIntel
56Model name: 12th Gen Intel(R) Core(TM) i9-12950HX
57CPU family: 6
58Model: 151
59Thread(s) per core: 2
60Core(s) per socket: 12
61Socket(s): 1
62Stepping: 2
63BogoMIPS: 4991.99
64Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves avx_vnni umip waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize flush_l1d arch_capabilities
65Virtualization: VT-x
66Hypervisor vendor: Microsoft
67Virtualization type: full
68L1d cache: 576 KiB (12 instances)
69L1i cache: 384 KiB (12 instances)
70L2 cache: 15 MiB (12 instances)
71L3 cache: 30 MiB (1 instance)
72Vulnerability Gather data sampling: Not affected
73Vulnerability Itlb multihit: Not affected
74Vulnerability L1tf: Not affected
75Vulnerability Mds: Not affected
76Vulnerability Meltdown: Not affected
77Vulnerability Mmio stale data: Not affected
78Vulnerability Retbleed: Mitigation; Enhanced IBRS
79Vulnerability Spec rstack overflow: Not affected
80Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
81Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
82Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
83Vulnerability Srbds: Not affected
84Vulnerability Tsx async abort: Not affected
85"
86failed ! Check if any error has occurred.
87F
88
89
90sysinfo = getSysInfo(failed, errmsg)
91"
92Linux amir 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
93
94Architecture: x86_64
95CPU op-mode(s): 32-bit, 64-bit
96Address sizes: 46 bits physical, 48 bits virtual
97Byte Order: Little Endian
98CPU(s): 24
99On-line CPU(s) list: 0-23
100Vendor ID: GenuineIntel
101Model name: 12th Gen Intel(R) Core(TM) i9-12950HX
102CPU family: 6
103Model: 151
104Thread(s) per core: 2
105Core(s) per socket: 12
106Socket(s): 1
107Stepping: 2
108BogoMIPS: 4991.99
109Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves avx_vnni umip waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize flush_l1d arch_capabilities
110Virtualization: VT-x
111Hypervisor vendor: Microsoft
112Virtualization type: full
113L1d cache: 576 KiB (12 instances)
114L1i cache: 384 KiB (12 instances)
115L2 cache: 15 MiB (12 instances)
116L3 cache: 30 MiB (1 instance)
117Vulnerability Gather data sampling: Not affected
118Vulnerability Itlb multihit: Not affected
119Vulnerability L1tf: Not affected
120Vulnerability Mds: Not affected
121Vulnerability Meltdown: Not affected
122Vulnerability Mmio stale data: Not affected
123Vulnerability Retbleed: Mitigation; Enhanced IBRS
124Vulnerability Spec rstack overflow: Not affected
125Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
126Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
127Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
128Vulnerability Srbds: Not affected
129Vulnerability Tsx async abort: Not affected
130"
131failed ! Check if any error has occurred.
132F
133
134
Test:
test_pm_sys


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:09 AM, ICES, The University of Texas at Austin

Definition at line 346 of file pm_sysInfo.F90.


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