QMCSOURCE(3)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– QMCSOURCE(3) πŸ’– β€” like, the manual page, bestie

Library Functions Manual ✨ welcome to the QmcSource glow-up, we're doing this together, it's giving "group chat study session" and honestly? obsessed.


🌸 NAME 🌸

QmcSource β€” manages contexts created by all groups 🫢


🌈 C++ SYNOPSIS 🌈

okay so first you gotta pull it in, no cap:

#include <QmcSource.h>

c++ ... -lpcp_qmc -lpcp

like, that's the whole vibe check. link those libs and you're in. πŸ’…


✨ DESCRIPTION ✨

So QmcSource is that one friend who keeps the receipts πŸ“ β€” it maintains a unique list of all metric sources in use, and the whole point is to minimize the creation of new contexts (peep pmNewContext(3)) when the context could have been duplicated (peep pmDupContext(3)). It also reduces the duplication of descriptions of each source, which is lowkey just good housekeeping. 🧚

And generally? QMC users should only need to access QmcSource methods to obtain source descriptions for a QmcContext(3) object. All context creation by the user should be handled through QmcGroup(3). That's it. That's the assignment. periodt. πŸ‘‘


πŸ’€ DESTRUCTOR πŸ’€

  • ~QmcSource(); β€” Destructor. It says goodbye. It's iconic, it's brief, it's literally just that. πŸŽ€

πŸ¦‹ CONSTRUCTORS πŸ¦‹

static QmcSource* getSource(int type, const char* source, bool matchHosts)

This method will return a QmcSource object that represents a context of type to source. 🫧

The QmcSource object may be a new object if the source has not been previously requested. Memory management of the QmcSource objects is handled by QmcSource. And if all QmcContext(3)s to the QmcSource have been deleted, the QmcSource object will also be deleted. it cleans up after itself, we love a self-sufficient queen ✨

The matchHosts flag controls the algorithm that is used to match hosts to archives. okay so listen up because this part matters:

  • If matchHosts is equal to false then no attempt will be made by this method to match a host context to an existing source context. A QmcSource object will always be returned in this case, although the QmcSource::status method may indicate that a context to source failed. 😭 (yes, you still get an object, no, it might not be happy about it)
  • If matchHosts is equal to true, host contexts will be matched to a predefined archive source collected from that source. And here's the tea: if no archive sources for the source have been previously specified, getSource will return a NULL pointer. 🚨 like, nothing. nadda. handle it.

πŸ”₯ DIAGNOSTICS πŸ”₯

Error messages are generated using pmprintf(3) but are not flushed. It is the responsibility of the user to call pmflush(3) to output any messages. so like... it wrote the message but nobody sent it? that's on you bestie, call the flush πŸ’…

Additional diagnostics may be activated by adding the option pmc to the global debugging specification, as described in pmSetDebug(3). sprinkle that in and the tea gets detailed. πŸ“


πŸ‘‘ SEE ALSO πŸ‘‘

PMAPI(3), QMC(3), QmcContext(3), QmcGroup(3), pmDupContext(3), pmflush(3), pmNewContext(3) and pmprintf(3).

go read them, they're all in the friend group 🌈


Performance Co-Pilot πŸŽ€ SGI πŸŽ€ and yes, this whole thing is QMCSOURCE(3) β€” mwah, that's the sign-off, go be the main character of your own context management πŸ’œπŸ«Ά

πŸ“¦ where this page comes from