240 #ifdef MCBSP_ENABLE_HP_DIRECTIVES
241 #ifdef MCBSP_ENABLE_FAKE_HP_DIRECTIVES
242 #pragma message "Warning: MCBSP_ENABLE_HP_DIRECTIVES takes precedence over MCBSP_ENABLE_FAKE_HP_DIRECTIVES"
243 #undef MCBSP_ENABLE_FAKE_HP_DIRECTIVES
246 #ifndef MCBSP_ENABLE_FAKE_HP_DIRECTIVES
247 #define MCBSP_ENABLE_HP_DIRECTIVES
298 #ifndef MCBSP_DISABLE_COMPILATION_MODE_WARNING
299 #pragma message "Warning: compiling in profile mode"
301 #define MCBSP_FUNCTION_PREFIX(n) mcbsp_profile_##n
302 #elif MCBSP_MODE == 2
303 #ifndef MCBSP_DISABLE_COMPILATION_MODE_WARNING
304 #pragma message "Warning: compiling in debug mode"
306 #define MCBSP_FUNCTION_PREFIX(n) mcbsp_debug_##n
309 #pragma message "Warning: unknown MCBSP_MODE `" #MCBSP_MODE "'; defaulting to perf mode..."
311 #define MCBSP_FUNCTION_PREFIX(n) mcbsp_perf_##n
329 const void *
const source,
330 const void *
const destination,
336 const void *
const source,
338 void *
const destination,
343 const void *
const source,
345 void *
const destination,
351 const void *
const tag,
352 const void *
const payload,
364 void *
const payload,
369 void* *
const p_payload
373 const void *
const source,
374 const void *
const destination,
380 const void *
const source,
382 void *
const destination,
385 #ifdef MCBSP_ENABLE_HP_DIRECTIVES
388 const void *
const tag,
389 const void *
const payload,
395 #define mcbsp_begin mcbsp_debug_begin
396 #define mcbsp_end mcbsp_debug_end
397 #define mcbsp_init mcbsp_debug_init
398 #define mcbsp_abort mcbsp_debug_abort
399 #define mcbsp_vabort mcbsp_debug_vabort
400 #define mcbsp_nprocs mcbsp_debug_nprocs
401 #define mcbsp_pid mcbsp_debug_pid
402 #define mcbsp_time mcbsp_debug_time
403 #define mcbsp_sync mcbsp_debug_sync
404 #define mcbsp_push_reg mcbsp_debug_push_reg
405 #define mcbsp_pop_reg mcbsp_debug_pop_reg
406 #define mcbsp_put mcbsp_debug_put
407 #define mcbsp_get mcbsp_debug_get
408 #define mcbsp_send mcbsp_debug_send
409 #define mcbsp_qsize mcbsp_debug_qsize
410 #define mcbsp_get_tag mcbsp_debug_get_tag
411 #define mcbsp_move mcbsp_debug_move
412 #define mcbsp_hpmove mcbsp_debug_hpmove
413 #define mcbsp_hpput mcbsp_debug_hpput
414 #define mcbsp_hpget mcbsp_debug_hpget
415 #define mcbsp_set_tagsize mcbsp_debug_set_tagsize
417 #define mcbsp_hpsend mcbsp_debug_hpsend
418 #define mcbsp_direct_get mcbsp_debug_direct_get
419 #elif MCBSP_MODE == 3
420 #define mcbsp_begin mcbsp_profile_begin
421 #define mcbsp_end mcbsp_profile_end
422 #define mcbsp_init mcbsp_profile_init
423 #define mcbsp_abort mcbsp_profile_abort
424 #define mcbsp_vabort mcbsp_profile_vabort
425 #define mcbsp_nprocs mcbsp_profile_nprocs
426 #define mcbsp_pid mcbsp_profile_pid
427 #define mcbsp_time mcbsp_profile_time
428 #define mcbsp_sync mcbsp_profile_sync
429 #define mcbsp_push_reg mcbsp_profile_push_reg
430 #define mcbsp_pop_reg mcbsp_profile_pop_reg
431 #define mcbsp_put mcbsp_profile_put
432 #define mcbsp_get mcbsp_profile_get
433 #define mcbsp_send mcbsp_profile_send
434 #define mcbsp_qsize mcbsp_profile_qsize
435 #define mcbsp_get_tag mcbsp_profile_get_tag
436 #define mcbsp_move mcbsp_profile_move
437 #define mcbsp_hpmove mcbsp_profile_hpmove
438 #define mcbsp_hpput mcbsp_profile_hpput
439 #define mcbsp_hpget mcbsp_profile_hpget
440 #define mcbsp_set_tagsize mcbsp_profile_set_tagsize
442 #define mcbsp_hpsend mcbsp_profile_hpsend
443 #define mcbsp_direct_get mcbsp_profile_direct_get
445 #define mcbsp_begin mcbsp_perf_begin
446 #define mcbsp_end mcbsp_perf_end
447 #define mcbsp_init mcbsp_perf_init
448 #define mcbsp_abort mcbsp_perf_abort
449 #define mcbsp_vabort mcbsp_perf_vabort
450 #define mcbsp_nprocs mcbsp_perf_nprocs
451 #define mcbsp_pid mcbsp_perf_pid
452 #define mcbsp_time mcbsp_perf_time
453 #define mcbsp_sync mcbsp_perf_sync
454 #define mcbsp_push_reg mcbsp_perf_push_reg
455 #define mcbsp_pop_reg mcbsp_perf_pop_reg
456 #define mcbsp_put mcbsp_perf_put
457 #define mcbsp_get mcbsp_perf_get
458 #define mcbsp_send mcbsp_perf_send
459 #define mcbsp_qsize mcbsp_perf_qsize
460 #define mcbsp_get_tag mcbsp_perf_get_tag
461 #define mcbsp_move mcbsp_perf_move
462 #define mcbsp_hpmove mcbsp_perf_hpmove
463 #define mcbsp_hpput mcbsp_perf_hpput
464 #define mcbsp_hpget mcbsp_perf_hpget
465 #define mcbsp_set_tagsize mcbsp_perf_set_tagsize
467 #define mcbsp_hpsend mcbsp_perf_hpsend
468 #define mcbsp_direct_get mcbsp_perf_direct_get
472 #ifdef MCBSP_COMPATIBILITY_MODE
473 static inline void bsp_begin(
const int P ) {
477 static inline void bsp_end(
void ) {
481 static inline void bsp_init(
void (*spmd)(
void),
int argc,
char **argv ) {
485 static inline void bsp_abort(
const char *
const error_message, ... ) {
487 va_start( args, error_message );
492 static inline void bsp_vabort(
const char *
const error_message, va_list args ) {
500 static inline int bsp_pid(
void ) {
504 static inline double bsp_time(
void ) {
508 static inline void bsp_sync(
void ) {
512 static inline void bsp_push_reg(
void *
const address,
const int size ) {
516 static inline void bsp_pop_reg(
void *
const address ) {
522 const void *
const source,
523 const void *
const destination,
532 const void *
const source,
534 void *
const destination,
541 size_t convert = (size_t) *size;
543 *size = (int)convert;
548 const void *
const tag,
549 const void *
const payload,
555 #ifdef MCBSP_ENABLE_HP_DIRECTIVES
558 const void *
const tag,
559 const void *
const payload,
568 int *
const accumulated_size
571 if( accumulated_size == NULL ) {
576 *accumulated_size = (int)conv_size;
578 *packets = (int)conv_packets;
587 if( converted != SIZE_MAX ) {
588 *status = (int)converted;
594 static inline void bsp_move(
void *
const payload,
const int max_copy_size ) {
598 static inline int bsp_hpmove(
void* *
const p_tag,
void* *
const p_payload ) {
604 const void *
const source,
605 const void *
const destination,
614 const void *
const source,
616 void *
const destination,
676 static inline void bsp_init(
void (*spmd)(
void),
int argc,
char **argv ) {
693 static inline void bsp_abort(
const char *
const error_message, ... ) {
695 va_start( args, error_message );
714 static inline void bsp_vabort(
const char *
const error_message, va_list args ) {
927 const void *
const source,
928 const void *
const destination,
932 mcbsp_put( pid, source, destination, offset, size );
980 const void *
const source,
982 void *
const destination,
985 mcbsp_get( pid, source, offset, destination, size );
1045 const void *
const source,
1047 void *
const destination,
1108 const void *
const tag,
1109 const void *
const payload,
1115 #ifdef MCBSP_ENABLE_HP_DIRECTIVES
1172 const void *
const tag,
1173 const void *
const payload,
1367 const void *
const source,
1368 const void *
const destination,
1372 mcbsp_hpput( pid, source, destination, offset, size );
1433 const void *
const source,
1435 void *
const destination,
1438 mcbsp_hpget( pid, source, offset, destination, size );
static void bsp_hpsend(const bsp_pid_t pid, const void *const tag, const void *const payload, const bsp_size_t size)
This is a non-buffering and non-blocking send request.
Definition: bsp.h:1170
#define mcbsp_vabort
Definition: bsp.h:449
#define MCBSP_FUNCTION_PREFIX(n)
Definition: bsp.h:311
static void bsp_send(const bsp_pid_t pid, const void *const tag, const void *const payload, const bsp_size_t size)
Sends a message to a remote thread.
Definition: bsp.h:1106
#define mcbsp_qsize
Definition: bsp.h:459
void MCBSP_FUNCTION_PREFIX() qsize(bsp_nprocs_t *const packets, bsp_size_t *const accumulated_size)
void MCBSP_FUNCTION_PREFIX() set_tagsize(bsp_size_t *const size)
static bsp_pid_t bsp_nprocs(void)
Returns the number of available processors or processes, depending on whether we are inside or outsid...
Definition: bsp.h:745
#define mcbsp_pop_reg
Definition: bsp.h:455
#define mcbsp_put
Definition: bsp.h:456
static void bsp_abort(const char *const error_message,...)
Aborts an SPMD program.
Definition: bsp.h:693
bsp_pid_t MCBSP_FUNCTION_PREFIX() nprocs(void)
static void bsp_move(void *const payload, const bsp_size_t max_copy_size)
Retrieves the payload from the first message in the queue of incoming messages, and removes that mess...
Definition: bsp.h:1257
static void bsp_init(void(*spmd)(void), int argc, char **argv)
Prepares for parallel SPMD execution of a given program.
Definition: bsp.h:676
#define mcbsp_hpget
Definition: bsp.h:464
#define mcbsp_set_tagsize
Definition: bsp.h:465
static bsp_pid_t bsp_pid(void)
Returns a unique BSP process identifier.
Definition: bsp.h:767
static void bsp_put(const bsp_pid_t pid, const void *const source, const void *const destination, const bsp_size_t offset, const bsp_size_t size)
Put data in a remote memory location.
Definition: bsp.h:925
static bsp_size_t bsp_hpmove(void **const p_tag, void **const p_payload)
Unbuffered retrieval of the payload of the first message in the incoming message queue.
Definition: bsp.h:1312
void MCBSP_FUNCTION_PREFIX() direct_get(const bsp_pid_t pid, const void *const source, const bsp_size_t offset, void *const destination, const bsp_size_t size)
static void bsp_push_reg(void *const address, const bsp_size_t size)
Registers a memory area for communication.
Definition: bsp.h:854
void MCBSP_FUNCTION_PREFIX() vabort(const char *const error_message, va_list args)
static void bsp_get_tag(bsp_size_t *const status, void *const tag)
Retrieves the tag of the first message in the queue of incoming messages.
Definition: bsp.h:1219
static void bsp_vabort(const char *const error_message, va_list args)
Alternative bsp_abort call.
Definition: bsp.h:714
void MCBSP_FUNCTION_PREFIX() get_tag(bsp_size_t *const status, void *const tag)
static void bsp_end(void)
Terminates an SPMD program.
Definition: bsp.h:655
static void bsp_get(const bsp_pid_t pid, const void *const source, const bsp_size_t offset, void *const destination, const bsp_size_t size)
Get data from a remote memory location.
Definition: bsp.h:978
#define mcbsp_send
Definition: bsp.h:458
bsp_pid_t MCBSP_FUNCTION_PREFIX() pid(void)
void MCBSP_FUNCTION_PREFIX() sync(void)
bsp_size_t MCBSP_FUNCTION_PREFIX() hpmove(void **const p_tag, void **const p_payload)
void MCBSP_FUNCTION_PREFIX() hpget(const bsp_pid_t pid, const void *const source, const bsp_size_t offset, void *const destination, const bsp_size_t size)
void MCBSP_FUNCTION_PREFIX() put(const bsp_pid_t pid, const void *const source, const void *const destination, const bsp_size_t offset, const bsp_size_t size)
void MCBSP_FUNCTION_PREFIX() pop_reg(void *const address)
static void bsp_begin(const bsp_pid_t P)
The first statement in an SPMD program.
Definition: bsp.h:640
#define mcbsp_hpmove
Definition: bsp.h:462
#define mcbsp_get
Definition: bsp.h:457
void MCBSP_FUNCTION_PREFIX() hpput(const bsp_pid_t pid, const void *const source, const void *const destination, const bsp_size_t offset, const bsp_size_t size)
#define mcbsp_get_tag
Definition: bsp.h:460
unsigned int bsp_nprocs_t
Data type used to count the number of BSMP messages waiting in queue.
Definition: bsp.h:254
static void bsp_sync(void)
Signals the end of a superstep and starts global synchronisation.
Definition: bsp.h:812
#define mcbsp_init
Definition: bsp.h:447
static void bsp_hpget(const bsp_pid_t pid, const void *const source, const bsp_size_t offset, void *const destination, const bsp_size_t size)
Get data from a remote memory location.
Definition: bsp.h:1431
void MCBSP_FUNCTION_PREFIX() push_reg(void *const address, const bsp_size_t size)
size_t bsp_size_t
Data type used to refer to memory region sizes.
Definition: bsp.h:256
#define mcbsp_time
Definition: bsp.h:452
void MCBSP_FUNCTION_PREFIX() abort(const char *const error_message,...)
static void bsp_qsize(bsp_nprocs_t *const packets, bsp_size_t *const accumulated_size)
Queries the size of the incoming BSMP queue.
Definition: bsp.h:1189
static void bsp_set_tagsize(bsp_size_t *const size)
Sets the tag size of inter-thread messages.
Definition: bsp.h:1084
static void bsp_direct_get(const bsp_pid_t pid, const void *const source, const bsp_size_t offset, void *const destination, const bsp_size_t size)
Get data from a remote memory location.
Definition: bsp.h:1043
static void bsp_pop_reg(void *const address)
De-registers a pushed registration.
Definition: bsp.h:882
#define mcbsp_sync
Definition: bsp.h:453
#define mcbsp_move
Definition: bsp.h:461
void MCBSP_FUNCTION_PREFIX() move(void *const payload, const bsp_size_t max_copy_size)
static void bsp_hpput(const bsp_pid_t pid, const void *const source, const void *const destination, const bsp_size_t offset, const bsp_size_t size)
Put data in a remote memory location.
Definition: bsp.h:1365
#define mcbsp_begin
Definition: bsp.h:445
#define mcbsp_pid
Definition: bsp.h:451
void MCBSP_FUNCTION_PREFIX() send(const bsp_pid_t pid, const void *const tag, const void *const payload, const bsp_size_t size)
#define mcbsp_direct_get
Definition: bsp.h:468
void MCBSP_FUNCTION_PREFIX() begin(const bsp_pid_t P)
#define mcbsp_push_reg
Definition: bsp.h:454
void MCBSP_FUNCTION_PREFIX() end(void)
#define mcbsp_end
Definition: bsp.h:446
void MCBSP_FUNCTION_PREFIX() init(void(*spmd)(void), int argc, char **argv)
unsigned int bsp_pid_t
Data type used for thread IDs.
Definition: bsp.h:252
static double bsp_time(void)
Indicates the elapsed time in this SPMD run.
Definition: bsp.h:785
#define mcbsp_nprocs
Definition: bsp.h:450
double MCBSP_FUNCTION_PREFIX() time(void)
#define mcbsp_hpsend
Definition: bsp.h:467
void MCBSP_FUNCTION_PREFIX() hpsend(const bsp_pid_t pid, const void *const tag, const void *const payload, const bsp_size_t size)
#define mcbsp_hpput
Definition: bsp.h:463