sc::ShmMessageGrp(3)

πŸ“¦
version 2.3.1 Β· 5 versions
, in ubuntu jammy

πŸ’– 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 variable NUMPROC. 🧚
  • ShmMessageGrp (const Ref< KeyVal > &) β€” the ShmMessageGrp KeyVal constructor takes a single keyword that specifies the number of processors.
  • ShmMessageGrp (int nprocs) β€” initialize ShmMessageGrp to use nprocs processors.
  • void sync () β€” synchronize all of the processors. ✨
  • Ref< MessageGrp > clone (void) β€” returns a copy of this MessageGrp specialization 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 shmid
  • int semid
  • int change_semid
  • void * sharedmem
  • struct sembuf semdec
  • struct 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