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

Generate and return a list of directory paths matching a requested system application.
More...

Detailed Description

Generate and return a list of directory paths matching a requested system application.

This is a convenience wrapper for the lower-level generic interface setPathMatch.

Parameters
[in]key: The input scalar character of default kind SK of arbitrary length type parameter containing a list of search keywords separated by the specified input sep character.
If the input key is empty, the entire list of paths will be returned in the output list.
Similarly, an empty search keyword item in the input key evaluates to match all paths.
(optional. If missing, the entire list of paths will be returned in the output list.)
[in]inc: The input scalar character of the same type and kind as the input key of arbitrary length type parameter containing the (partial) name of a target file, subfolder, or application that should be present in the output directory paths.
If the input inc is missing or empty, the entire list of paths matching key will be returned in the output list.
(optional, default = "")
[in]sep: The input scalar non-blank character of the type and kind as key of length type parameter 1, containing the character to be used for separating search keywords provided in key.
The recommended value for sep is the returned value from getPathSep.
(optional, default = getPathSep)
[out]failed: The output scalar logical of default kind LK that is .true. if and only if the procedure accomplishes the task successfully, otherwise, it is .false..
(optional. If missing and the procedure fails, 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 present and an error occurs, it is assigned an explanatory message describing the nature of the error that has occurred.
A length of LEN_IOMSG characters is likely sufficient to capture most error messages in full.
(optional. Its presence is relevant only if failed is also present.)
Returns
list : The output allocatable vector of type css_type each element of which contains a system application path found to match the search keywords in the input key and to contain an application matching the specified inc, without case-sensitivity.
The output vector will have a size of 0 if no matching application path is found.


Possible calling interfaces

type(css_type), allocatable :: list(:)
list = getPathMatch(key = key, inc = inc, sep = sep, failed = failed, errmsg = errmsg)
Generate and return a list of directory paths matching a requested system application.
This module contains the derived types for generating allocatable containers of scalar,...
This module contains classes and procedures for manipulating system file/folder paths.
Definition: pm_sysPath.F90:274
This is the css_type type for generating instances of container of scalar of string objects.
Remarks
The procedures under discussion are impure.
Note
Dropping both optional input arguments in this generic interface is equivalent to retrieving a list of all application paths found in the environmental PATH variable of the processor.
See also
getPathMatch
setPathMatch


Example usage

1program example
2
3 use pm_kind, only: LK, IK, SK
4 use pm_io, only: display_type
5 use pm_sysPath, only: getPathMatch
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12#if __GFORTRAN__
13 ! \bug
14 call disp%warn%show("GNU gfortran compiler as of version 13.1, has a bug with the use of `spread()` for containers below, leading to content corruption.", width = 72_IK)
15#endif
16
17 call disp%skip()
18 call disp%show("spread(getPathMatch(), 2, 1)")
19 call disp%show( spread(getPathMatch(), 2, 1) , deliml = SK_"""" )
20 call disp%skip()
21
22 call disp%skip()
23 call disp%show("spread(getPathMatch(key = SK_''), 2, 1)")
24 call disp%show( spread(getPathMatch(key = SK_''), 2, 1) , deliml = SK_"""" )
25 call disp%skip()
26
27 call disp%skip()
28 call disp%show("spread(getPathMatch(key = SK_'intel:oneapi'), 2, 1)")
29 call disp%show( spread(getPathMatch(key = SK_'intel:oneapi'), 2, 1) , deliml = SK_"""" )
30 call disp%skip()
31
32 call disp%skip()
33 call disp%show("spread(getPathMatch(key = SK_'intel:oneapi', sep = SK_':'), 2, 1)")
34 call disp%show( spread(getPathMatch(key = SK_'intel:oneapi', sep = SK_':'), 2, 1) , deliml = SK_"""" )
35 call disp%skip()
36
37 call disp%skip()
38 call disp%show("spread(getPathMatch(key = SK_'intel:oneapi', inc = SK_'mpiexec', sep = SK_':'), 2, 1)")
39 call disp%show( spread(getPathMatch(key = SK_'intel:oneapi', inc = SK_'mpiexec', sep = SK_':'), 2, 1) , deliml = SK_"""" )
40 call disp%skip()
41
42 call disp%skip()
43 call disp%show("spread(getPathMatch(key = SK_'intel:oneapi', inc = SK_'vars.sh', sep = SK_':'), 2, 1)")
44 call disp%show( spread(getPathMatch(key = SK_'intel:oneapi', inc = SK_'vars.sh', sep = SK_':'), 2, 1) , deliml = SK_"""" )
45 call disp%skip()
46
47 call disp%skip()
48 call disp%show("spread(getPathMatch(key = SK_'open:mpi', sep = SK_':'), 2, 1)")
49 call disp%show( spread(getPathMatch(key = SK_'open:mpi', sep = SK_':'), 2, 1) , deliml = SK_"""" )
50 call disp%skip()
51
52 call disp%skip()
53 call disp%show("spread(getPathMatch(key = SK_'mpich', sep = SK_':'), 2, 1)")
54 call disp%show( spread(getPathMatch(key = SK_'mpich', sep = SK_':'), 2, 1) , deliml = SK_"""" )
55 call disp%skip()
56
57end 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
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 - WARNING: GNU gfortran compiler as of version 13.1, has a bug with the use of `spread()`
2 - WARNING: for containers below, leading to content corruption.
3
4spread(getPathMatch(), 2, 1)
5"[sU )bin"
6"OoW␅ )B/R2023b/bin"
7"␚[sU )"
8"␚[sU )"
9"[sU "
10"p4vU "
11"~R[s"
12"L["
13"+[sU )"
14"GoW␅ )"
15"+[sU )4vU "
16"P[sU )4/bin"
17"RoW␅ )iles (x86)/Intel/oneAPI/mpi/latest/bin/"
18"RoW␅ )iles (x86)/Intel/oneAPI/mpi/latest/bin/release/"
19"qZsU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin/"
20"ZsU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin/utils/"
21Ѽ"ZsU iles (x86)/Intel/oneAPI/tbb/latest/redist/intel64/vc_mt/"
22"ZsU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin/util"
23"U[sU iles (x86)/Intel/oneAPI/compiler/latest/windows/redist/intel64_win/compiler"
24"R[sU )iles (x86)/Intel/oneAPI/compiler/latest/windows/redist/ia32_win/compiler"
25"ZsU )ystem32"
26"␛[sU )"
27"O␚[sU )ystem32/Wbem"
28"ZsU )ystem32/WindowsPowerShell/v1.0/"
29"O␚[sU )ystem32/WbemSSH/"
30"OoW␅ )B/R2023b/bin"
31"qZsU )iles (x86)/Intel/oneAPI/mpi/latest/libfabr"
32";ZsU )iles/MATLAB/R2024a/runtime/win64"
33" ␝6␔ ␝6␔ iles/MATLAB/R2020 "
34"U iles/MATLAB/R2023b/runtime/win64"
35"Q[sU rogram Files/MATLAB/R202␙ "
36";ZsU )iles/MATLAB/R2024a/runtime/win64"
37"S[sU rogram Files/MATLAB/R202P␙ "
38"ZsU )ystem32/WindowsPowerShell/v"
39"RoW␅ )iles (x86)/Intel/oneAPI/mpi/latest/bin/re"
40ҋ"ZsU )iles/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/"
41"␛[sU ) iles/Git/cmd"
42"ZsU )ystem32/gs10.00.0 "
43"RoW␅ )iles (x86)/"
44"OoW␅ rogram Files/MATLAB/R2020b/runtime/win64"
45"ZsU )ystem32/gs10.00.0 "
46"RoW␅ )iles (x86)/Intel/oneAPI/A ZsU"
47"RoW␅ rogram Files (x86)/Intel/oneAPI/tbb/latest/redist/intel6p␄ "
48ҋ"ZsU )iles/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Bi"
49"RoW␅ )iles (x86)/Intel/oneAPI/A ZsUfaQ "
50"iles (x86)/Intel/oneAPI/tbb/latest/redist/intel6p␄ rQ "
51"iles/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Bi"
52"RoW␅ )iles (x86)/Intel/oneAPI/A ZsUfaQ P"
53"@4vU ␓ ␐4vU ␜ 4vU ␏ P4vU ␎ "
54"s4vU ␈ s4vU ␅ 4vU ␄ 4vU "
55"@4vU ␐ 4vU ␐ `u4vU ␕ ps4vU "
56"`4vU ? 4vU A ␐4vU G 0␟5vU H ␟5"
57"@4vU [ p 5vU X p4vU ␗ P4vU ␎ "
58"4vU / `4vU 4vU ␜ 5vU : "
59"R[sU )iles (x86)/Intel/oneAPI/compiler/latest/windows/redist/ia32"
60"Pq4vU & ␐I4vU 0 !5vU & 4vU 0 "
61"p!5vU + 5vU 9 (5vU I 4vU ␜ 5vU "
62" !5vU ␛ !5vU 0 0!5vU & "5vU 6 "
63""5vU F #5vU @ #5vU > $5vU"
64"@$5vU A $5vU > $5vU 7 %5vU 7 `%5v"
65"%5vU A &5vU ; P#5vU K P&5vU "
66"ystem32/gs10.00.0 Make/bin"
67"&5vU G &5vU > @'5vU 6 '5vU E "
68"4vU ␞ 4vU > "
69"4vU "
70
71
72spread(getPathMatch(key = SK_''), 2, 1)
73"␑Q[sU )bin"
74"S[sU )B/R2023b/bin"
75"ZsU )"
76"ZsU )"
77"␑Q[sU "
78"`t4vU "
79"w[s"
80"␝p["
81"[sU )"
82"`[sU )"
83"␌R[sU )"
84"U ) "
85"DoW␅ )iles (x86)/Intel/oneAPI/mpi/latest/bin/"
86"OoW␅ )iles (x86)/Intel/oneAPI/mpi/latest/bin/release/"
87"/R[sU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin/"
88"S[sU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin/utils/"
89"Ag[sU iles (x86)/Intel/oneAPI/tbb/latest/redist/intel64/vc_mt/"
90"S[sU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin/util"
91"U[sU iles (x86)/Intel/oneAPI/compiler/latest/windows/redist/intel64_win/compiler"
92ҋ"ZsU )iles (x86)/Intel/oneAPI/compiler/latest/windows/redist/ia32_win/compiler"
93"KoW␅ ) "
94"[sU )4vU"
95"u[sU )ystem32/Wbem"
96"[[sU )ystem32/WindowsPowerShell/v1.0/"
97"=v[sU ystem32/OpenSSH/"
98"u[sU )ystem32/Wbem"
99"/R[sU )iles (x86)/Intel/oneAPI/mpi/latest/libfabr"
100"U )iles/MATLAB/R2024a/runtime/win64"
101"S[sU )B/R2023b/binR2024a/bin"
102""ZsU iles/MATLAB/R2023b/runtime/win64"
103"MoW␅ rogram Files/MATLAB/R202␁ "
104"␛[sU )iles/MATLAB/R2024a/runtime/win64"
105"p[sU rogram Files/MATLAB/R202P␁ "
106"[[sU )ystem32/WindowsPowerShell/v"
107"OoW␅ )iles(x86)/Intel/oneAPI/mpi/latest/bin/re"
108""ZsU )iles/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/"
109"u[sU )iles/Git/cmd"
110"ZsU )iles/gs/gs10.00.0 "
111"␂[sU )iles/PuTTY/"
112"DoW␅ )iles (x86)/Intel/oneAPI/mpi/late"
113"GoW␅ )iles/MATLAB/R2020 "
114"RoW␅ rogram Files (x86)/Intel/oneAPI/vpl/latest/bin"
115"oZsU )iles (x86)/Intel/oneAPI/tbb/latest/redist/intel64/vc_mt"
116""ZsU )iles/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Bi"
117""ZsU )iles/Microsoft SQL Server/Client SDK/ODBC/170/To"
118"oZsU )iles (x86)/Intel/oneAPI/tbb/latest/redist/inte"
119"RoW␅ rogram Files (x86)/Intel/oneAPI/vpl/latest/bin"
120ҋ"ZsU )iles (x86)/Intel/oneAPI/compiler/latest/windows/r"
121""ZsU )iles/Microsoft SQL Server/Client SDK/ODBC/170/"
122"oZsU )iles(x86)/Intel/oneAPI/tbb/latest/redi"
123"P4vU ␓ 4vU ␜ ␐4vU ␏ `4vU "
124"5vU @4vU ␈ P4vU ␅ 4vU ␄ `u4"
125"4vU ␐ pt4vU ␐ s4vU ␕ 4vU 7 "
126"`4vU A ␟5vU G 05vU H ␐4vU E "
127"!5vU X 4vU ␗ @4vU ␎ 4vU ␜ 4vU / "
128"ZsU rogram Files (x86)/Intel/oneAPI/dev-utilities/latest/bin"
129֠"4vU 6␔ iles (x86)/Intel/oneAPI/debugger/latest/gdb/intel64/bin"
130֠"4vU 6␔ r/AppData/Local/quickstart_fortran/mingw64/bin"
131"P4vU ␐"5vU r/AppData/Local/quickstart_fortrp␖ "
132"P4vU ␐"5vU r/AppData/Local/quickstart_fortrp␖ GiQ 6"
133"r/AppData/Local/quickstart_fortrp␖ GiQ 6 "
134"u[sU )iles/Git/cmdin"
135"r/AppData/Local/quickstart_fortrp␖ GiQ 6 Q "
136" ␝6␔ ␝6␔ r/.dotnet/tools"
137"quickstar"
138
139
140spread(getPathMatch(key = SK_'intel:oneapi'), 2, 1)
141"rZsU )iles (x86)/Intel/oneAPI/mpi/latest/bin/"
142"MoW␅ )iles (x86)/Intel/oneAPI/mpi/latest/bin/release/"
143"w[sU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin/"
144"1w[sU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin/utils/"
145Ѽ"ZsU iles (x86)/Intel/oneAPI/tbb/latest/redist/intel64/vc_mt/"
146"1w[sU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin/util"
147"U[sU iles (x86)/Intel/oneAPI/compiler/latest/windows/redist/intel64_win/compiler"
148"=P[sU )iles (x86)/Intel/oneAPI/compiler/latest/windows/redist/ia32_win/compiler"
149";ZsU )iles (x86)/Intel/oneAPI/vpl/latest/bin"
150"w[sU )iles (x86)/Intel/oneAPI/mpi/latest/libfabric/bin//vc_mt"
151"MoW␅ )iles (x86)/Intel/oneAPI/mpi/latest/bin/release/n/utils"
152"MoW␅ rogram Files (x86)/Intel/oneAPI/mpi/latest/libfabric/bin"
153"ZsU iles (x86)/Intel/oneAPI/mpi/latest/bin/release"
154"U iles (x86)/Intel/oneAPI/mpi/latest/bin"
155"qZsU iles (x86)/Intel/oneAPI/mkl/latest/redist/intel64"
156""v[sU iles(x86)/Intel/oneAPI/mkl/latest/bin/intel64"
157";ZsU )iles(x86)/Intel/oneAPI/vpl/latest/binn"
158"rZsU )iles(x86)/Intel/oneAPI/mpi/latest/bin/"
159"v[sU iles(x86)/Intel/oneAPI/ippcp/latest/redist/intel64"
160"]R[sU iles(x86)/Intel/oneAPI/ipp/latest/redist/intel64"
161"/R[sU iles(x86)/Intel/oneAPI/dpcpp-ct/latest/bin"
162"=P[sU )iles(x86)/Intel/oneAPI/compiler/latest/windows/redist/ia32"
163"OoW␅ iles(x86)/Intel/oneAPI/dev-utilities/latest/bin"
164"MoW␅ rogram Files(x86)/Intel/oneAPI/mpi/latest/libfabric/binl64/bin"
165
166
167spread(getPathMatch(key = SK_'intel:oneapi', sep = SK_':'), 2, 1)
168"]v[sU )iles(x86)/Intel/oneAPI/mpi/latest/bin/"
169"RoW␅ )iles(x86)/Intel/oneAPI/mpi/latest/bin/release/"
170",ZsU )iles(x86)/Intel/oneAPI/mpi/latest/libfabric/bin/"
171"Ag[sU )iles(x86)/Intel/oneAPI/mpi/latest/libfabric/bin/utils/"
172"aZsU iles(x86)/Intel/oneAPI/tbb/latest/redist/intel64/vc_mt/"
173"Ag[sU )iles(x86)/Intel/oneAPI/mpi/latest/libfabric/bin/util"
174"U[sU iles(x86)/Intel/oneAPI/compiler/latest/windows/redist/intel64_win/compiler"
175"z[sU )iles(x86)/Intel/oneAPI/compiler/latest/windows/redist/ia32_win/compiler"
176"Dx[sU )iles(x86)/Intel/oneAPI/vpl/latest/bin"
177",ZsU )iles(x86)/Intel/oneAPI/mpi/latest/libfabric/bin//vc_mt"
178"RoW␅ )iles(x86)/Intel/oneAPI/mpi/latest/bin/release/n/utils"
179"z[sU )iles(x86)/Intel/oneAPI/compiler/latest/windows/"
180"MoW␅ rogram Files(x86)/Intel/oneAPI/mpi/latest/bin/release"
181"[[sU iles(x86)/Intel/oneAPI/mpi/latest/bin"
182"MoW␅ rogram Files(x86)/Intel/oneAPI/mpi/latest/bin/releasel64"
183"MoW␅ rogram Files(x86)/Intel/oneAPI/mpi/latest/bin/release"
184"Dx[sU )iles(x86)/Intel/oneAPI/vpl/latest/binn"
185"]v[sU )iles(x86)/Intel/oneAPI/mpi/latest/bin/"
186"MoW␅ rogram Files(x86)/Intel/oneAPI/mpi/latest/bin/releasetel64"
187"MoW␅ rogram Files(x86)/Intel/oneAPI/mpi/latest/bin/releasetel"
188"MoW␅ rogram Files(x86)/Intel/oneAPI/mpi/latest/bin/rele"
189"y[sU rogram Files(x86)/Intel/oneAPI/dnnl/latest/cpu_dpcpp_gpu_dpcpp/bin"
190"MoW␅ rogram Files(x86)/Intel/oneAPI/mpi/latest/bin/relet/bin"
191"z[sU )iles(x86)/Intel/oneAPI/compiler/latest/windows/l64/bin"
192
193
194spread(getPathMatch(key = SK_'intel:oneapi', inc = SK_'mpiexec', sep = SK_':'), 2, 1)
195"ZsU )iles(x86)/Intel/oneAPI/mpi/latest/bin/"
196"ZsU )iles(x86)/Intel/oneAPI/mpi/latest/bin"
197
198
199spread(getPathMatch(key = SK_'intel:oneapi', inc = SK_'vars.sh', sep = SK_':'), 2, 1)
200""
201
202
203spread(getPathMatch(key = SK_'open:mpi', sep = SK_':'), 2, 1)
204""
205
206
207spread(getPathMatch(key = SK_'mpich', sep = SK_':'), 2, 1)
208""
209
210
Test:
test_pm_sysPath
Todo:
High Priority: The current Fortran standard 202x does not allow passing characters of non-default kind to the intrinsic Fortran statements and procedures.
As such, the implementation of this procedure for non-default character kinds leads to compile-time kind mismatch errors.
This procedure should be converted back to a generic interface in the future when non-default character kinds are also fully supported by the intrinsic functions.


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, 7:03 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 6227 of file pm_sysPath.F90.


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