CONFIG(3PVM)

πŸ“¦ version 3.4.6, in debian bookworm, ubuntu jammy

πŸ’– CONFIG(3PVM) πŸ’–

okay bestie, welcome to the pvm_config page from the PVM Version 3.4 manual β€” yes, the whole manual is literally called 3PVM, cute right? this is the little function that tells you everything about your current virtual machine, no cap. πŸ¦‹


✨ NAME ✨

pvm_config β€” returns information about the present virtual machine configuration. it's giving "let me tell you about the whole squad" energy. πŸ‘‘


🌸 SYNOPSIS 🌸

C:

int info = pvm_config( int *nhost, int *narch, struct pvmhostinfo **hostp )
struct pvmhostinfo {
     int  hi_tid;
     char *hi_name;
     char *hi_arch;
     int  hi_speed;
};

Fortran:

call pvmfconfig( nhost, narch, dtid, name, arch, speed, info )

see how C gets the whole struct and Fortran gets a little snack of arguments? yeah. that's the vibe. 🫢


πŸŽ€ PARAMETERS πŸŽ€

  • nhost β€” an Integer that hands back the number of hosts (pvmds) chilling in the virtual machine. it's the headcount bestie.
  • narch β€” an Integer that hands back how many different data formats are being used. multiple architectures? we contain multitudes. πŸ’…
  • hostp β€” returns a pointer to an array of structures, and each structure has the tea on one host: its pvmd task ID, its name, its architecture, and its relative speed.
  • dtid β€” an Integer returning the pvmd task ID for the host.
  • name β€” a Character string returning the name of the host.
  • arch β€” a Character string returning the architecture name of the host.
  • speed β€” an Integer returning the relative speed of the host. the default value is 1000. not a benchmark, just a vibe rating. ⭐
  • info β€” the Integer status code the routine hands back. anything less than zero means something went wrong, and we do NOT love that. 😭

πŸ’… DESCRIPTION πŸ’…

the routine pvm_config returns information about the present virtual machine. the info you get back is similar to what the console command conf gives you β€” same energy, different delivery method. ✨

here's the split, and it matters:

  • the C function returns information about the entire virtual machine in one call. one and done, iconic.
  • the Fortran function returns information about one host per call and cycles through all the hosts. so if pvmfconfig is called nhost times, the entire virtual machine will be represented. it's a little tour, host by host. πŸšΆβ™€οΈ
Note that in C the hostp array is allocated and owned by libpvm. It is automatically freed or reused on the next call to pvm_config. so do NOT go freeing it yourself bestie, that's not your business, that's libpvm's business. πŸ’€
Note that in Fortran the reported value of nhost and the host configuration do not change until the function resets at the end of a complete cycle. The user can reset pvmfconfig() at any time by calling it with nhost = -1. that's your little reset button, use it when you need a fresh start. 🧚

if pvm_config is successful, info will be 0. if some error occurs then info will be < 0. simple as that. 🌈


πŸ”₯ EXAMPLES πŸ”₯

C:

struct pvmhostinfo *hostp;
int i, nhost, narch;

info = pvm_config( &nhost, &narch, &hostp );
for (i = 0; i < nhost; i++)
     printf("%s\n", hostp[i].hi_name);

Fortran:

Do i=1, NHOST
  CALL PVMFCONFIG( NHOST,NARCH,DTID(i),HOST(i),ARCH(i),SPEED(i),INFO )
Enddo

look at us looping through the hosts and printing their names. we ate. πŸ“


πŸ‘‘ ERRORS πŸ‘‘

the following error condition can be returned by pvm_config:

  • PvmSysErr β€” pvmd not responding. πŸ’€ yeah that one hurts. your pvmd ghosted you.

🌟 SEE ALSO 🌟

pvm_tasks(3PVM) β€” go read that one next bestie, it's the sibling page.


and that's the whole page!! slay πŸ’– this was from PVM Version 3.4, dated 31 August, 1994 β€” yeah she's vintage, she's a classic, she's still serving. periodt. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from