#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include "bsp.h"
#include "bsp_memreg.h"
#include "bsp_mesgqueue.h"
#include "bsp_delivtable.h"
#include "bsp_reqtable.h"
#include "bsp_private.h"
#include "bsp_alloc.h"
#include "bsp_abort.h"
#include <config.h>
Include dependency graph for bsp.c:
Go to the source code of this file.
Initialisation | |
void | bsp_init (void(*spmd_part)(void), int argc, char *argv[]) |
Initializes BSPonMPI. | |
void | bsp_begin (int maxprocs) |
Marks the start of the SPMD code. | |
void | bsp_end () |
Ends the SPMD code. | |
Halt | |
void | bsp_abort (const char *format,...) |
Aborts the program printing a message to the standard error output. | |
Enquiry | |
int | bsp_nprocs () |
Returns the number of processors available / allocated. | |
int | bsp_pid () |
Returns the rank of the processor. | |
double | bsp_time () |
The time in seconds since bsp_begin(). | |
Superstep | |
void | bsp_sync () |
Seperates two supersteps. | |
DRMA | |
void | bsp_push_reg (const void *ident, int size) |
Makes the memory location with specified size available for DRMA operations at the next and additional supersteps. | |
void | bsp_pop_reg (const void *ident) |
Deregisters the memory location. | |
void | bsp_put (int pid, const void *src, void *dst, int offset, int nbytes) |
Puts a block of data in the memory of some other processor at the next superstep. | |
void | bsp_get (int pid, const void *src, int offset, void *dst, int nbytes) |
Gets a block of data from the memory of some other processor at the next superstep. | |
BSMP | |
void | bsp_send (int pid, const void *tag, const void *payload, int payload_nbytes) |
Sends message to a processor. | |
void | bsp_qsize (int *restrict nmessages, int *restrict accum_nbytes) |
Gives the number of messages and the sum of the payload sizes in queue. | |
void | bsp_get_tag (int *restrict status, void *restrict tag) |
Retrieves the tag and payload size of the current message in queue. | |
void | bsp_move (void *payload, int reception_nbytes) |
Dequeue the current message. | |
void | bsp_set_tagsize (int *tag_nbytes) |
Sets the tag size at the next superstep. | |
High Performace | |
void | bsp_hpput (int pid, const void *src, void *dst, int offset, int nbytes) |
Puts a block of data in the memory of some other processor at then next superstep. | |
void | bsp_hpget (int pid, const void *src, int offset, void *dst, int nbytes) |
Gets a block of data from the memory of some other processor at the next superstep. | |
int | bsp_hpmove (void **tag_ptr, void **payload_ptr) |
Dequeue the current message in an unbuffered way. | |
Defines | |
#define | DELIVTAB_SIZE 1 |
#define | REQTAB_SIZE 1 |
#define | MEMREG_SIZE 1 |
Definition in file bsp.c.
|
Definition at line 353 of file bsp.c. Referenced by bsp_begin(). |
|
Definition at line 355 of file bsp.c. Referenced by bsp_begin(). |
|
Definition at line 354 of file bsp.c. Referenced by bsp_begin(). |
|
Aborts the program printing a message to the standard error output.
Definition at line 511 of file bsp.c. References bsp_intern_abort(), and ERR_BSP_ABORT. Here is the call graph for this function: |
|
Marks the start of the SPMD code. The code following the call to this function will be executed in parallel with at most maxprocs processors. The SPMD code must end with a call to bsp_end()
Definition at line 427 of file bsp.c. References _BSPObject::begintime, bsp, bsp_free(), bsp_malloc, _BSPObject::communicator, _BSPObject::delivery_received_table, _BSPObject::delivery_table, deliveryTable_initialize(), DELIVTAB_SIZE, _BSPObject::memory_register, memoryRegister_initialize(), MEMREG_SIZE, _BSPObject::message_queue, messageQueue_initialize(), MIN, _BSPObject::nprocs, _BSPObject::rank, REQTAB_SIZE, _BSPObject::request_received_table, _BSPObject::request_table, and requestTable_initialize(). Here is the call graph for this function: |
|
Ends the SPMD code. This function must be called after all SPMD code has been executed. The code after this call is executed by processor 0 only. Definition at line 489 of file bsp.c. References bsp, _BSPObject::delivery_received_table, _BSPObject::delivery_table, deliveryTable_destruct(), _BSPObject::memory_register, memoryRegister_destruct(), _BSPObject::request_received_table, _BSPObject::request_table, and requestTable_destruct(). Here is the call graph for this function: |
|
Gets a block of data from the memory of some other processor at the next superstep. This function is buffered, i.e.: The data is retrieved from the destionation processor at the start of the next bsp_sync(). Translation of the src pointer is performed with help of earlier calls to bsp_push_reg()
Definition at line 716 of file bsp.c. References bsp, ReqElement::dst, _BSPObject::memory_register, memoryRegister_memoized_find(), ReqElement::offset, _BSPObject::request_table, requestTable_push(), ReqElement::size, and ReqElement::src. Referenced by bsp_hpget(). Here is the call graph for this function: |
|
Retrieves the tag and payload size of the current message in queue.
Definition at line 774 of file bsp.c. References ALIGNED_TYPE, bsp, MessageQueue::head, _BSPObject::message_queue, MessageQueue::n_mesg, no_slots(), MessageQueue::recv_tag_size, and restrict. Here is the call graph for this function: |
|
Gets a block of data from the memory of some other processor at the next superstep. This should be the high performance unbuffered version of bsp_get(). However currently it is the same as bsp_get()
Definition at line 862 of file bsp.c. References bsp_get(). Here is the call graph for this function: |
|
Dequeue the current message in an unbuffered way.
Definition at line 875 of file bsp.c. References MessageQueue::accum_size, ALIGNED_TYPE, bsp, MessageQueue::head, _BSPObject::message_queue, MessageQueue::n_mesg, no_slots(), MessageQueue::recv_tag_size, and restrict. Here is the call graph for this function: |
|
Puts a block of data in the memory of some other processor at then next superstep. This should be de high perfomance unbuffered version of bsp_put, but currently these two functions are the same
Definition at line 845 of file bsp.c. References bsp_put(). Here is the call graph for this function: |
|
Initializes BSPonMPI.
void do_something() { bsp_begin(bsp_nprocs()) ... a parallel program ... bsp_end() } int main(int argc, char *argv[]) { bsp_init( &do_something, argc, argv); ... optional sequential code ... do_something(); ... optional sequential code ... }
Definition at line 397 of file bsp.c. References bsp, _BSPObject::nprocs, and _BSPObject::rank. |
|
Dequeue the current message.
Definition at line 795 of file bsp.c. References MessageQueue::accum_size, ALIGNED_TYPE, bsp, MessageQueue::head, _BSPObject::message_queue, MIN, MessageQueue::n_mesg, no_slots(), MessageQueue::recv_tag_size, and restrict. Here is the call graph for this function: |
|
Returns the number of processors available / allocated.
Definition at line 533 of file bsp.c. References bsp, and _BSPObject::nprocs. |
|
Returns the rank of the processor.
Definition at line 544 of file bsp.c. References bsp, and _BSPObject::rank. |
|
Deregisters the memory location.
Definition at line 669 of file bsp.c. References PopRegObject::address, bsp, _BSPObject::delivery_table, deliveryTable_push(), DelivElement::info, _DInfo::pop, popreg, _BSPObject::rank, and DelivElement::size. Here is the call graph for this function: |
|
Makes the memory location with specified size available for DRMA operations at the next and additional supersteps.
Definition at line 654 of file bsp.c. References PushRegObject::address, bsp, _BSPObject::delivery_table, deliveryTable_push(), DelivElement::info, _BSPObject::nprocs, _DInfo::push, pushreg, and DelivElement::size. Here is the call graph for this function: |
|
Puts a block of data in the memory of some other processor at the next superstep. This function is buffered, i.e.: the contents of src is copied to a buffer and transmitted at the next bsp_sync()
Definition at line 689 of file bsp.c. References bsp, _BSPObject::delivery_table, deliveryTable_push(), PutObject::dst, DelivElement::info, _BSPObject::memory_register, memoryRegister_memoized_find(), _DInfo::put, put, restrict, and DelivElement::size. Referenced by bsp_hpput(). Here is the call graph for this function: |
|
Gives the number of messages and the sum of the payload sizes in queue.
Definition at line 760 of file bsp.c. References MessageQueue::accum_size, bsp, _BSPObject::message_queue, and MessageQueue::n_mesg. |
|
Sends message to a processor. You may supply a tag and and a payload. The default size of the tag is 0. To change the tag size you can use bsp_set_tagsize().
Definition at line 742 of file bsp.c. References bsp, _BSPObject::delivery_table, deliveryTable_push(), DelivElement::info, _BSPObject::message_queue, SendObject::payload_size, restrict, _DInfo::send, send, MessageQueue::send_tag_size, and DelivElement::size. Here is the call graph for this function: |
|
Sets the tag size at the next superstep.
Definition at line 816 of file bsp.c. References bsp, _BSPObject::delivery_table, deliveryTable_push(), DelivElement::info, _BSPObject::message_queue, _BSPObject::rank, MessageQueue::send_tag_size, _DInfo::settag, settag, DelivElement::size, and SetTagObject::tag_size. Here is the call graph for this function: |
|
Seperates two supersteps.
Definition at line 564 of file bsp.c. References bsp, _BSPObject::delivery_received_table, _BSPObject::delivery_table, deliveryTable_reset(), _BSPObject::message_queue, messageQueue_sync(), _BSPObject::nprocs, _BSPObject::request_received_table, _BSPObject::request_table, requestTable_reset(), and _ExpandableTable::used_slot_count. Here is the call graph for this function: |
|
The time in seconds since bsp_begin().
Definition at line 553 of file bsp.c. References _BSPObject::begintime, and bsp. |