TASKS(3PVM)

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

πŸ’– TASKS(3PVM) β€” pvm_tasks πŸ’–

okay bestie, so this one is pvm_tasks from PVM Version 3.4, and it's literally your backstage pass to the whole virtual machine. it hands you info about the tasks running on the VM β€” same tea the console command ps spills. no cap. πŸŽ€


✨ NAME ✨

pvm_tasks β€” returns information about the tasks running on the virtual machine.


πŸ¦‹ SYNOPSIS πŸ¦‹

C:

int info = pvm_tasks( int where, int *ntask, struct pvmtaskinfo **taskp )

struct pvmtaskinfo {
int ti_tid;
int ti_ptid;
int ti_host;
int ti_flag;
char *ti_a_out;
} taskp;

Fortran:

call pvmftasks( where, ntask, tid, ptid, dtid, flag, aout, info )

🌸 PARAMETERS 🌸

  • where β€” an Integer that says which tasks you want the receipts on. the options are, and i quote:
    • 0 β€” for all the tasks on the virtual machine
    • pvmd tid β€” for all tasks on a given host
    • tid β€” for a specific task
  • ntask β€” an Integer coming back at you with the number of tasks being reported on.
  • taskp β€” returns a pointer to an array of structures holding the deets about each task: its task ID, parent tid, pvmd task ID, status flag, and the name of this task's executable file. the status flag values are waiting for a message, waiting for the pvmd, and running. πŸ’…
  • tid β€” an Integer returning task ID of one task.
  • ptid β€” an Integer returning parent task ID.
  • dtid β€” an Integer returning pvmd task ID of host task is on.
  • flag β€” an Integer returning status of task.
  • aout β€” a Character string returning the name of spawned task. ngl, manually started tasks return blank. πŸ™ˆ
  • info β€” the Integer status code returned by the routine. values less than zero indicate an error. 😭

πŸ‘‘ DESCRIPTION πŸ‘‘

so pvm_tasks returns information about tasks presently running on the virtual machine. the information returned is the same as that available from the console command ps. iconic.

the C function returns information about the entire virtual machine in one single call. main character energy. meanwhile the Fortran function returns information about one task per call and cycles through all the tasks. so if where = 0, and pvmftasks is called ntask times, all tasks will be represented. slay. ✨

not me needing you to know this though: in Fortran the reported value of ntask and the set of tasks do not change until the function resets at the end of a complete cycle. the user can reset pvmftasks() at any time by calling it with ntask = -1. that's the cheat code, bestie. πŸ”‘

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


🌈 EXAMPLES 🌈

C:

struct pvmtaskinfo *taskp;
int i, ntask;

info = pvm_tasks( 0, &ntask, &taskp );
for (i = 0; i < ntask; i++)
          printf("t%x\n", taskp[i].ti_tid);

Fortran:

Do i=1, NTASK
    CALL PVMFTASKS( DTID, NTASK, TID(i), PTID(i), DTID(i),
&                  FLAG(i), AOUT(i), INFO )
EndDo

πŸ’€ ERRORS πŸ’€

the following error condition can be returned by pvm_tasks:

  • PvmBadParam β€” invalid value for where argument. bestie. read the options again. πŸ’…
  • PvmSysErr β€” pvmd not responding. it's giving ghosted. 😭
  • PvmNoHost β€” specified host not in virtual machine.

🫢 SEE ALSO 🫢

  • pvm_config(3PVM)
  • pvm_tidtohost(3PVM)

and that's the whole page, periodt. πŸ’œ this lil' number is dated 31 August, 1994 and comes to you from the PVM Version 3.4 era β€” so yeah, it's vintage, it's archival, and it still ate. stay curious, check your info codes, and never forget: ntask = -1 resets the cycle. mwah. πŸŽ€βœ¨

πŸ“¦ where this page comes from