Changes between Version 16 and Version 17 of MessagePassing
- Timestamp:
- 09/13/13 08:52:39 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MessagePassing
v16 v17 21 21 * `$comm` 22 22 * an abstract datatype representing a communicator, or set of message channels between every pair of processes in a set of processes 23 * `$comm $comm_create(int nprocs, $proc [] procs)`23 * `$comm $comm_create(int nprocs, $proc procs[])` 24 24 * creates a new comm from the given sequence of processes, by allocating memory and copying the process sequence; the new comm has no messages 25 25 * `int $comm_nprocs($comm comm)` 26 26 * returns the number of processes associated to the comm 27 * `$proc [] $comm_procs($comm comm)`27 * `$proc $comm_getProc($comm comm, int pid)` 28 28 * returns a pointer to the procs array in comm 29 29 * `$comm $comm_enqueue($comm comm, $message message)` … … 64 64 typedef $comm *MPI_Comm; 65 65 $comm MPI_Comm_world_comm; 66 MPI_Comm *MPI_COMM_WORLD = & _MPI_COMM_WORLD;66 MPI_Comm *MPI_COMM_WORLD = &MPI_Comm_world_comm; 67 67 boolean initialized = $false; 68 68 … … 94 94 $message m = $message_pack(pid, dest, tag, buf, sizeofDatatype(type)*count); 95 95 96 $comm_enqueue(comm, &m);96 *comm = $comm_enqueue(*comm, m); 97 97 } 98 98 … … 100 100 int size = sizeofDatatype(type)*count; 101 101 // the following is a system function with built-in guard: 102 $message m = $comm_dequeue( comm, source, pid, tag);102 $message m = $comm_dequeue(*comm, source, pid, tag); 103 103 104 status->size = $message_size( &m);105 status->source = $message_source( &m);106 status->dest = $message_dest( &m);107 $message_unpack( &m, buf, size); // will throw exception if message too big104 status->size = $message_size(m); 105 status->source = $message_source(m); 106 status->dest = $message_dest(m); 107 $message_unpack(m, buf, size); // will throw exception if message too big 108 108 } 109 109 … … 121 121 } 122 122 }}} 123
