lis_vector_set_size(3f)

πŸ“¦ version 2.1.11, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– lis_vector_set_size(3f) πŸ’–

okay bestie, so this one lives in the Lis Library Functions manual and it's literally just about telling a vector how big it's gonna be. it's giving ✨glow-up✨ but for memory. let's get into it 🫢


🌸 NAME 🌸

lis_vector_set_size β€” assign the size of the vector

like. you're setting the size. that's the whole job. icon behavior honestly πŸ’…


✨ SYNOPSIS ✨

subroutine lis_vector_set_size(LIS_VECTOR v, LIS_INTEGER local_n,
LIS_INTEGER global_n, LIS_INTEGER ierr);

four arguments, no cap, and one of them is just there to tell you if it worked πŸ™ˆ


πŸ¦‹ DESCRIPTION πŸ¦‹

Assign the size of vector v. that's it, that's the tea πŸ“ you hand it a vector and you tell it how big it should be, and it becomes that big. main character energy fr fr.


πŸŽ€ INPUT πŸŽ€

  • v β€” The vector πŸ’œ the actual little guy you're resizing. she's getting a whole new dimension.
  • local_n β€” The size of the partial vector 🌸 this is the slice that this particular processing element is holding. her local moment.
  • global_n β€” The size of the global vector 🌈 the whole entire thing, everybody's slices added up. the big picture.

πŸ’€ NOTE πŸ’€

okay this is the part where you actually have to pay attention, bestie, because there's a rule:

Either local_n or global_n must be provided. not neither. pick one. the function is not gonna guess for you 😭

In the case of the serial and multithreaded environments, local_n is equal to global_n. so they're the same number, the vibes are unified, nobody's splitting anything. Therefore, both

lis_vector_set_size(v,n,0)

and

lis_vector_set_size(v,0,n)

create a vector of size n. so in serial/multithreaded land you can pass it either way and you still get a vector of size n. slay ✨

For the multiprocessing environment though, it's a different story and the two calls are not interchangeable:

  • lis_vector_set_size(v,n,0) creates a partial vector of size n on each processing element. so every PE gets exactly n. equal distribution, everyone eats 🍽️
  • lis_vector_set_size(v,0,n) creates a partial vector of size m_p on the processing element p. so PE p gets m_p, and the values of m_p are determined by the library. you don't pick them, the library picks them, and you just trust the process 🧚

πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, periodt πŸ’… go forth and size your vectors correctly, i believe in you 🫢

this has been lis_vector_set_size(3f) from the Lis Library Functions manual, dated 6 Sep 2012, served fresh off the Man Page πŸ’– byeeee ✨

πŸ“¦ where this page comes from