libadc-cxx 1.0.0
Structured logging for scientific computing
Loading...
Searching...
No Matches
utility.ipp
Go to the documentation of this file.
1/* Copyright 2025 NTESS. See the top-level LICENSE.txt file for details.
2 *
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef adc_utility_ipp
6#define adc_utility_ipp
7#include <string>
8#include <string_view>
9#include <map>
10#include <set>
11
12namespace adc {
13
14/*! Utility to merge parallel outputs from multifile publisher.
15 * Consolidation should only happen after the multifile publisher is finalized;
16 * If a multi_publisher is in use, consolidation should only happen after
17 * terminate has been called on the multi_publisher (which calls finalize).
18 * On slow nfs-based file systems, some delay may be needed to ensure all
19 * files are seen on the aggregating client.
20 *
21 * \return the list of consolidated logs from reduction of a multifile publisher tree.
22 *
23 * /FS/adc/$user/$adc_wfid/$app/$host-$pid_$start-$publisherptr.log
24 * /FS/adc/$user/no_wfid/$app/$host-$pid_$start-$publisherptr.log
25 * /FS/adc/$user/$cluster/$jobidraw/$task/$rank/$app/$host-$pid_$start-$publisherptr.log
26 * /FS/adc/ is multiuser; $user is owned/writable by $user
27 */
28
29ADC_VISIBLE std::vector<std::string> consolidate_multifile_logs(
30 const std::string& match, std::vector< std::string>& old_paths, bool debug=false)
31{
32 return adc::multifile_plugin::consolidate_multifile_logs(match, old_paths, debug);
33}
34
35/*! Utility to get output directory from the multifile_publisher.
36 */
37ADC_VISIBLE std::string get_multifile_log_path(string_view dir, string_view wfid)
38{
40}
41
42ADC_VISIBLE std::vector<size_t> validate_multifile_log(string_view filename, bool check_json, size_t & record_count)
43{
44 return adc::multifile_plugin::validate_multifile_log(filename, check_json, record_count);
45}
46
47} // namespace adc
48#endif // adc_utility_ipp
static std::vector< size_t > validate_multifile_log(string_view, bool, size_t &record_count)
static std::vector< std::string > consolidate_multifile_logs(const string &pattern, std::vector< std::string > &old_paths, int debug=0)
static std::string get_multifile_log_path(string_view dir, string_view wfid)
ADC_VISIBLE std::vector< size_t > validate_multifile_log(string_view filename, bool check_json, size_t &record_count)
Definition utility.ipp:42
ADC_VISIBLE std::string get_multifile_log_path(string_view dir, string_view wfid)
Definition utility.ipp:37
ADC_VISIBLE std::vector< std::string > consolidate_multifile_logs(const std::string &match, std::vector< std::string > &old_paths, bool debug=false)
Definition utility.ipp:29
Definition adc.hpp:82
std::string_view string_view
Definition curl.ipp:18