# Parallelism

- [Introduction](intro.md)

  - [Approaches to Parallelism](intro.md#approaches-to-parallelism)

- [Magma Kernel Distributed Parallelism](kernel-distributed-parallelism.md)

  - [Introduction](kernel-distributed-parallelism.md#introduction)

  - [POSIX Threads](kernel-distributed-parallelism.md#posix-threads)

    - [`SetNthreads(n): RngIntElt`](kernel-distributed-parallelism.md#function-par-setnthreads)

    - [`GetNthreads() → RngIntElt`](kernel-distributed-parallelism.md#function-getnthreads)

    - [`magma -t N`](kernel-distributed-parallelism.md#literal-literal-t-magma-t-n)

- [GPUs](GPUs.md)

  - [`SetGPU(b): BoolElt`](GPUs.md#function-par-setgpu)

  - [`GetGPU() → BoolElt`](GPUs.md#function-getgpu)

  - [`SetNGPUs(n): RngIntElt`](GPUs.md#function-setngpus-rngintelt)

  - [`GetNGPUs() → RngIntElt`](GPUs.md#function-getngpus)

  - [`SetGPUDevices(S): SeqEnum`](GPUs.md#function-setgpudevices-seqenum)

  - [`SetGPUDevice(k): RngIntElt`](GPUs.md#function-setgpudevice-rngintelt)

- [Linear Algebra](linear-algebra.md)

  - [Multi-threaded Linear Algebra](linear-algebra.md#multi-threaded-linear-algebra)

  - [GPU-based Linear Algebra](linear-algebra.md#gpu-based-linear-algebra)

  - [Hybrid Linear Algebra](linear-algebra.md#hybrid-linear-algebra)

    - [`Example: Linear Algebra Threaded`](linear-algebra.md#example-ex-e8f312)

    - [`Example: Linear Algebra GPU`](linear-algebra.md#example-ex-f549f7)

    - [`Example: Linear Algebra Dual GPU`](linear-algebra.md#example-ex-9775af)

    - [`Example: representations`](linear-algebra.md#example-ex-c94a83)

- [Gröbner Bases](groebner-bases.md)

  - [`Example: minrank`](groebner-bases.md#example-ex-cdcd67)

  - [`Example: randsys`](groebner-bases.md#example-ex-eea1ea)

  - [`Example: hfe`](groebner-bases.md#example-ex-dcdb69)

- [Polynomial System Solving](polynomial-system-solving.md)

  - [`Variety(I): RngMPol → [ ModTupFldElt ]`](polynomial-system-solving.md#function-variety-rngmpol)

  - [`VarietySize(I): RngMPol → RngIntElt`](polynomial-system-solving.md#function-varietysize-rngmpol)

- [Polynomial Rings](poly.md)

  - [`SetParallelFFT(b): BoolElt`](poly.md#function-setparallelfft-boolelt)

  - [`Example: Polynomial Multiplication`](poly.md#example-ex-0a7349)

- [Distributed Computation for Internal Algorithms](distributed.md)

  - [Automatic Worker Startup](distributed.md#automatic-worker-startup)

    - [`StartWorkers(H, T): MonStgElt, RngIntElt`](distributed.md#function-par-startworkers)

    - [`SetWorkerPort(P): RngIntElt`](distributed.md#function-setworkerport-rngintelt)

    - [`Example: Start Workers`](distributed.md#example-ex-16fbfc)

  - [Manual Worker Startup](distributed.md#manual-worker-startup)

    - [`Example: Set Worker Port`](distributed.md#example-ex-91843e)

- [Integer Factorisation](integer-factorisation.md)

  - [`Example: Integer Factorisation`](integer-factorisation.md#example-ex-1169a4)

- [Ideal Class Group of Algebraic Number Fields](classgroup.md)

- [Integral Lattices](lattices.md)

  - [Lattice Vector Enumeration](lattices.md#lattice-vector-enumeration)

    - [Introduction](lattices.md#introduction)

    - [Enumeration of Short Vectors](lattices.md#enumeration-of-short-vectors)

      - [`ShortVectors(L, B): Lat, RngIntElt → SeqEnum`](lattices.md#function-shortvectors-lat-rngintelt)

      - [`ShortVectors(L, A, B): Lat, RngIntElt, RngIntElt → LatElt`](lattices.md#function-shortvectors-lat-rngintelt-rngintelt)

      - [`ShortestVectors(L): Lat → SeqEnum`](lattices.md#function-shortestvectors-lat)

      - [`Example: Vector Enum`](lattices.md#example-ex-25bf05)

    - [A Single Shortest Vector](lattices.md#a-single-shortest-vector)

      - [`ShortVector(L, B): Lat, RngIntElt → LatElt`](lattices.md#function-shortvector-lat-rngintelt)

      - [`ShortVector(L, A, B): Lat, RngIntElt, RngIntElt → LatElt`](lattices.md#function-shortvector-lat-rngintelt-rngintelt)

      - [`ShortestVector(L): Lat → LatElt`](lattices.md#function-shortestvector-lat)

      - [`Example: Short Vector1`](lattices.md#example-ex-236335)

    - [Enumeration of Close Vectors](lattices.md#enumeration-of-close-vectors)

      - [`CloseVectors(L, w, B): Lat, ModTupRngElt, RngElt → SeqEnum`](lattices.md#function-closevectors-lat-modtuprngelt-rngelt)

      - [`CloseVectors(L, w, A, B): Lat, ModTupRngElt, RngElt, RngElt → SeqEnum`](lattices.md#function-closevectors-lat-modtuprngelt-rngelt-rngelt)

      - [`ClosestVectors(L, w): Lat, ModTupRngElt → SeqEnum`](lattices.md#function-closestvectors-lat-modtuprngelt)

      - [`Example: Close Vector1`](lattices.md#example-ex-8c952d)

      - [`Example: Close Vector2`](lattices.md#example-ex-4b7a6d)

    - [A Single Closest Vector](lattices.md#a-single-closest-vector)

      - [`CloseVector(L, w, B): Lat, ModTupRngElt, RngElt → LatElt`](lattices.md#function-closevector-lat-modtuprngelt-rngelt)

      - [`CloseVector(L, w, A, B): Lat, ModTupRngElt, RngElt, RngElt → LatElt`](lattices.md#function-closevector-lat-modtuprngelt-rngelt-rngelt)

      - [`ClosestVector(L, w): Lat, ModTupRngElt → LatElt`](lattices.md#function-closestvector-lat-modtuprngelt)

      - [`Example: Close Vector`](lattices.md#example-ex-0606a0)

    - [Intrinsics that Use Enumeration](lattices.md#intrinsics-that-use-enumeration)

      - [`Example: Lattice Minimum1`](lattices.md#example-ex-2c4b94)

      - [`Example: Lattice Minimum2`](lattices.md#example-ex-e3d7d1)

      - [`Example: Kissing Number`](lattices.md#example-ex-c126c1)

    - [Theta Series](lattices.md#theta-series)

      - [`Example: Theta Ex`](lattices.md#example-ex-f705e4)

      - [`Example: Theta Ex 2`](lattices.md#example-ex-31137d)

      - [`Example: Lat 72`](lattices.md#example-ex-e70551)

- [Linear Codes](codes.md)

  - [Minimum Weight](codes.md#minimum-weight)

    - [`Example: QR Code Minimum`](codes.md#example-ex-79c75f)

    - [`Example: BKLC256Minimum`](codes.md#example-ex-02eba6)

  - [Weight Distribution](codes.md#weight-distribution)

    - [`Example: Code Weight Distribution`](codes.md#example-ex-92e5c9)

- [User-Implemented Distributed Parallelism](par-user.md)

  - [Introduction](par-user.md#introduction)

  - [The Manager/Worker Model](par-user.md#the-manager-worker-model)

  - [Basic Usage](par-user.md#basic-usage)

    - [`DistributedManager(socket, items : parameters): IO, SeqEnum`](par-user.md#function-par-distributedmanager)

    - [`DistributedManager(socket, items : parameters): IO, List`](par-user.md#function-par-distributedmanager-2)

    - [`DistributedManager(socket, items : parameters): IO, Process`](par-user.md#function-par-distributedmanager-3)

    - [`DistributedWorker({host, port, }{work_function}): MonStgElt, RngIntElt, UserProgram`](par-user.md#function-par-distributedworker)

  - [Basic Example](par-user.md#basic-example)

    - [`Example: Basic Worker`](par-user.md#example-ex-8a18c1)

  - [Verbose Output](par-user.md#verbose-output)

    - [`SetVerbose("ManagerWorker", v): MonStgElt, RngIntElt`](par-user.md#function-setverbose-monstgelt-rngintelt)

    - [`SetVerbose("ManagerWorkerTime", v): MonStgElt, RngIntElt`](par-user.md#function-setverbose-monstgelt-rngintelt-2)

    - [`Example: Verbose`](par-user.md#example-ex-40e491)

  - [Alternative Results Handling](par-user.md#alternative-results-handling)

    - [`Example: List Results`](par-user.md#example-ex-67d2bd)

    - [`Example: Variation One`](par-user.md#example-ex-022c8d)

    - [`Example: Variation Two`](par-user.md#example-ex-96e14f)

  - [Task Groups](par-user.md#task-groups)

  - [Task Group Management](par-user.md#task-group-management)

    - [`Example: Advanced`](par-user.md#example-ex-844942)

    - [`Example: Advanced Variation One`](par-user.md#example-ex-a19be5)

  - [Monitoring and Respawning Workers](par-user.md#monitoring-and-respawning-workers)

    - [`MonitoredDistributedWorker({host, }{port, work_function}): MonStgElt, RngIntElt, UserProgram`](par-user.md#function-par-monitoreddistributedworker)

    - [`Example: Advanced Variation Two`](par-user.md#example-ex-82a4ef)

  - [Implementing Distributed Parallelism](par-user.md#implementing-distributed-parallelism)

    - [`ExchangeVersions(I): IO`](par-user.md#function-exchangeversions-io)

    - [`ReadObject(I): IO → Any`](par-user.md#function-readobject-io)

    - [`WriteObject(I, x): IO, Any`](par-user.md#function-writeobject-io-any)

    - [`AsyncReadObject(I): IO`](par-user.md#function-asyncreadobject-io)

    - [`AsyncWriteObject(I, x): IO, Any`](par-user.md#function-asyncwriteobject-io-any)

    - [`WaitForIO(R : parameters): SeqEnum → SeqEnum`](par-user.md#function-waitforio-seqenum)

    - [`WaitForIO(R, W : parameters): SeqEnum, SeqEnum → SeqEnum, SeqEnum`](par-user.md#function-waitforio-seqenum-seqenum)

    - [`Example: Mw Trans`](par-user.md#example-ex-aa2ecb)

  - [A Note on Security](par-user.md#a-note-on-security)

- [Timing](timing.md)

  - [`Example: Time1`](timing.md#example-ex-0cea74)
