Skip to content

Week 02 (January 15)

Donna Calhoun edited this page Jan 19, 2018 · 3 revisions

Tuesday

  • Using the Python multiprocessing module

    • (demo0) Spawning a single process, starting a process, terminating a process, pid,is_alive,start,terminate
    • (demo1) Getting the process to do something
      • target= function
      • track process in Activity monitor (use time.sleep())
      • mp.current_process().name
    • (demo2) Passing arguments to a spawned process
      • args= list of arguments to each process
    • (demo3) Spawning multiple processes
      • Processes could be doing different things
      • join command to process data in order.
      • mp.Value, mp.Array, join
    • (demo4) Computing a mean
      • Compute the mean for vector of length N?
      • Show scaling for multiple processors

Thursday

  • (demo0) Further discussion of the join command.

  • (demo1) Using shared variables with mp.Value, mp.Array (continued from Tuesday)

  • (demo2) Using Queues to return value from processes.

  • (demo3) Computing the mean of an array of numbers.

Clone this wiki locally