receive_incoming_walkers   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/mpi/random-walk.xtm

Implementation

(bind-func receive_incoming_walkers
  (lambda (incoming_walkers:WalkerArray* world_rank:i32 world_size:i32)
    ;; Probe for new incoming walkers
    (let ((status:MPI_Status* (salloc))
          ;; Receive from the process before you. If you are process zero,
          ;; receive from the last process
          (incoming_rank (if (= world_rank 0)
                             (- world_size 1)
                             (- world_rank 1)))
          (incoming_walkers_size_ptr:i32* (salloc)))
      (MPI_Probe incoming_rank 0 MPI_COMM_WORLD status)
      ;; Resize your incoming walker buffer based on how much data is
      ;; being received
      (MPI_Get_count status MPI_BYTE incoming_walkers_size_ptr)
      ;; incoming_walkers->resize(incoming_walkers_size / sizeof(Walker));
      (MPI_Recv (convert (tref incoming_walkers 1) i8*)
                (pref incoming_walkers_size_ptr 0)
                MPI_BYTE incoming_rank 0 MPI_COMM_WORLD
                MPI_STATUS_IGNORE)
      (tset! incoming_walkers 0 (/ (pref incoming_walkers_size_ptr 0) 8)))))


Back to Index

Similar Entries

  • clock-client-receive    scheme
  • clock-server-receive    scheme
  • initialize_walkers    xtlang
  • io:osc:receive    scheme
  • ipc:sync-receive    scheme
  • on_process_message_received    xtlang
  • osc-receive-7009    scheme
  • osc-receive-7019    scheme
  • osc_receive_7020    xtlang
  • receiver    xtlang
  • receiver_loop    xtlang
  • send_outgoing_walkers    xtlang
  • sync-server-receive    scheme
  • topclock-receive    scheme