sc::ShmMessageGrp(3)
π sc::ShmMessageGrp(3) β the MPQC manual page, bestie π
okay so this is the MPQC manual page for sc::ShmMessageGrp, and it is lowkey giving βshared-memory communication but make it a class.β Buckle up, weβre doing this with facts intact and vibes immaculate. π
β¨ NAME β¨
sc::ShmMessageGrp β the ShmMessageGrp class is an implementation of MessageGrp that allows multiple process to be started that communicate with shared memory. π«Ά
πΈ SYNOPSIS πΈ
#include <messshm.h>
Inherits sc::intMessageGrp.
πΌ Public Member Functions πΌ
ShmMessageGrp ()β reads the number of processors from the environmental variableNUMPROC. π§ShmMessageGrp (const Ref< KeyVal > &)β theShmMessageGrpKeyVal constructor takes a single keyword that specifies the number of processors.ShmMessageGrp (int nprocs)β initializeShmMessageGrpto usenprocsprocessors.void sync ()β synchronize all of the processors. β¨Ref< MessageGrp > clone (void)β returns a copy of thisMessageGrpspecialization that provides an independent communication context. π¦
π Protected Member Functions π
void basic_send (int target, int type, const void *data, int nbyte)β must be implemented by specializations.void basic_recv (int type, void *data, int nbyte)β must be implemented by specializations.int basic_probe (int type)β must be implemented by specializations.void initialize (int nprocs)void initialize ()msgbuf_t * NEXT_MESSAGE (msgbuf_t *m)void get_change (int node)void put_change (int node)void wait_for_write (int node)void release_write (int node)void print_buffer (int node, int me)
π§Έ Protected Attributes π§Έ
commbuf_t * commbuf [MAXPROCS]int shmidint semidint change_semidvoid * sharedmemstruct sembuf semdecstruct sembuf seminc
π«Ά Additional Inherited Members π«Ά
There are additional inherited members, but this page doesnβt list them out β it just drops the section heading and moves on. No extra deets here, bestie. π
π Detailed Description π
okay so hereβs the full vibe again, because Doxygen loves a callback:
The ShmMessageGrp class is an implementation of MessageGrp that allows multiple process to be started that communicate with shared memory. π
Real talk: this only provides improved performance if you have multiple CPU's in a symmetric multiprocessor configuration. Nonetheless, it is quite useful on a single CPU for tracking down bugs. No cap. π₯
π Constructor & Destructor Documentation π
sc::ShmMessageGrp::ShmMessageGrp (const Ref< KeyVal > &)
The ShmMessageGrp KeyVal constructor takes a single keyword that specifies the number of processors. Here is an example of a ParsedKeyVal input that creates a ShmMessageGrp that runs on four processors:
message<ShmMessageGrp>: n = 4
π Author π
Generated automatically by Doxygen for MPQC from the source code. π€π
cute sign-off time π this page is from MPQC, version 2.3.1, dated Sun Oct 4 2020, and yes itβs still the sc::ShmMessageGrp(3) manual page. bye bestie, go communicate through shared memory responsibly ππ¦
π¦ where this page comes from
- ubuntu jammy: libsc-doc 2.3.1-21
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms