qutil_double_min(3)

πŸ“¦ version 1.22^20251007gitcedb1fc, in fedora 43, fedora 44

✨ qutil_double_min ✨

okay bestie, welcome to the libqthread section 3 club πŸŽ€ this little trio of cuties lives in the manual page qutil_double_min(3) and honestly? they're the friend group that finds the smallest number in the room and does it in parallel, which is iconic behavior πŸ’…


🌸 NAME 🌸

qutil_double_min, qutil_uint_min, qutil_int_min β€” find the minimum value within an array in parallel

no cap, that's literally the whole job description 🫢


✨ SYNOPSIS ✨

#include <qthread.h>
#include <qthread/qutil.h>

double
qutil_double_min (double *array, size_t length, int checkfeb);

unsigned int
qutil_uint_min (unsigned int *array, size_t length, int checkfeb);

int
qutil_int_min (int *array, size_t length, int checkfeb);

three functions, three flavors, same vibe πŸ“


πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• these functions take an array of length numbers and hand you back the minimum value hiding in there. not the max, not the sum, the min β€” the smallest one, the underdog, the main character of lowkey-ness 😭

and the way they do it? in parallel ✨ using a lagging-loop structure. yes queen, multithreaded minimum-finding, we love to see it πŸ‘‘

now about that checkfeb argument, listen up because this part matters:

  • if checkfeb is non-zero, these functions will wait for the entries in the array to be full before comparing them 🫢
  • they DO NOT check whether the array entries are properly aligned. not even a little. not even a glance πŸ‘€
  • if the datatype is too small to do a FEB operation on, they will abort β€” but only if sanity checks are turned on 🚨
bestie pls read that again. alignment is YOUR problem, not theirs. they are not checking. they said what they said πŸ’€

🌈 RETURN VALUE 🌈

the minimum value of the first length entries of array πŸ’–

that's it. that's the whole return. a single tiny value, served fresh, computed in parallel, no notes ⭐


πŸ¦‹ SEE ALSO πŸ¦‹

go read the rest of the squad, they're all slaying in their own ways πŸ§šπŸ’œ


and that's a wrap on this page from libqthread, dated APRIL 2011 πŸ“… β€” yeah she's an elder but she still eats, fr fr. stay aligned, stay parallel, and never forget to pass a non-zero checkfeb if you actually want the full-wait behavior πŸ˜ŒπŸ’…βœ¨

πŸ“¦ where this page comes from