#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 (const void **tag_ptr, const void **payload_ptr) |
Dequeue the current message in an unbuffered way. | |
Defines | |
#define | DELIVTAB_SIZE 1000 |
#define | REQTAB_SIZE 1000 |
#define | MEMREG_SIZE 100 |
#define | MESGQ_SIZE 1000 |
Definition in file bsp.c.
|
Definition at line 370 of file bsp.c. Referenced by bsp_begin(). |
|
Definition at line 372 of file bsp.c. Referenced by bsp_begin(). |
|
Definition at line 373 of file bsp.c. Referenced by bsp_begin(). |
|
Definition at line 371 of file bsp.c. Referenced by bsp_begin(). |
|
Aborts the program printing a message to the standard error output.
Definition at line 530 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 445 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, MESGQ_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 507 of file bsp.c. References bsp, _BSPObject::delivery_received_table, _BSPObject::delivery_table, deliveryTable_destruct(), _BSPObject::memory_register, memoryRegister_destruct(), _BSPObject::message_queue, messageQueue_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 678 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 731 of file bsp.c. References bsp, _BSPObject::message_queue, messageQueue_getNumber(), and messageQueue_getTag(). 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 804 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 817 of file bsp.c. References bsp, _BSPObject::message_queue, messageQueue_getNumber(), and messageQueue_hpdequeue(). 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 787 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 415 of file bsp.c. References bsp, _BSPObject::nprocs, and _BSPObject::rank. |
|
Dequeue the current message.
Definition at line 746 of file bsp.c. References bsp, _BSPObject::message_queue, and messageQueue_dequeue(). Here is the call graph for this function: ![]() |
|
Returns the number of processors available / allocated.
Definition at line 552 of file bsp.c. References bsp, and _BSPObject::nprocs. |
|
Returns the rank of the processor.
Definition at line 563 of file bsp.c. References bsp, and _BSPObject::rank. |
|
Deregisters the memory location.
Definition at line 633 of file bsp.c. References PopRegObject::address, bsp, VarSizeElement::data, _BSPObject::delivery_table, deliveryTable_push(), VarSizeElement::info, _VarSzInfo::pop, popreg, _BSPObject::rank, VarSizeElement::size, and VarSizeElement::type. 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 616 of file bsp.c. References PushRegObject::address, bsp, VarSizeElement::data, _BSPObject::delivery_table, deliveryTable_push(), VarSizeElement::info, _BSPObject::nprocs, _VarSzInfo::push, pushreg, VarSizeElement::size, and VarSizeElement::type. 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 655 of file bsp.c. References bsp, _BSPObject::delivery_table, deliveryTable_pushPut(), _BSPObject::memory_register, and memoryRegister_memoized_find(). 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 717 of file bsp.c. References bsp, _BSPObject::message_queue, messageQueue_getAccumSize(), and messageQueue_getNumber(). Here is the call graph for this function: ![]() |
|
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 704 of file bsp.c. References bsp, _BSPObject::delivery_table, deliveryTable_pushSend(), _BSPObject::message_queue, and messageQueue_getTagSize(). Here is the call graph for this function: ![]() |
|
Sets the tag size at the next superstep.
Definition at line 756 of file bsp.c. References bsp, VarSizeElement::data, _BSPObject::delivery_table, deliveryTable_push(), VarSizeElement::info, _BSPObject::message_queue, messageQueue_getTagSize(), _BSPObject::rank, settag, _VarSzInfo::settag, VarSizeElement::size, SetTagObject::tag_size, and VarSizeElement::type. Here is the call graph for this function: ![]() |
|
Seperates two supersteps.
Definition at line 582 of file bsp.c. References bsp, _BSPObject::communicator, _BSPObject::delivery_received_table, _BSPObject::delivery_table, deliveryTable_execute(), deliveryTable_reset(), expandableTable_comm(), expandableTable_reset(), _BSPObject::memory_register, memoryRegister_pack(), _BSPObject::message_queue, messageQueue_reset(), _BSPObject::request_received_table, _BSPObject::request_table, and requestTable_execute(). Here is the call graph for this function: ![]() |
|
The time in seconds since bsp_begin().
Definition at line 572 of file bsp.c. References _BSPObject::begintime, and bsp. |