MulticoreBSP for C  Version 2.0.4
bsp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2017
3  *
4  * File created Albert-Jan N. Yzelman, 2007-2009.
5  *
6  * This file is part of MulticoreBSP in C --
7  * a port of the original Java-based MulticoreBSP.
8  *
9  * MulticoreBSP for C is distributed as part of the original
10  * MulticoreBSP and is free software: you can redistribute
11  * it and/or modify it under the terms of the GNU Lesser
12  * General Public License as published by the Free Software
13  * Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  * MulticoreBSP is distributed in the hope that it will be
16  * useful, but WITHOUT ANY WARRANTY; without even the
17  * implied warranty of MERCHANTABILITY or FITNESS FOR A
18  * PARTICULAR PURPOSE. See the GNU Lesser General Public
19  * License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General
22  * Public License along with MulticoreBSP. If not, see
23  * <http://www.gnu.org/licenses/>.
24  */
25 
231 #ifndef _H_MCBSP
232 #define _H_MCBSP
233 
234 #include <stdarg.h>
235 #include <stddef.h>
236 #include <stdint.h>
237 
238 //macros that control the interface follow first:
239 
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
244  #endif
245 #else
246  #ifndef MCBSP_ENABLE_FAKE_HP_DIRECTIVES
247  #define MCBSP_ENABLE_HP_DIRECTIVES
248  #endif
249 #endif
250 
252 typedef unsigned int bsp_pid_t;
254 typedef unsigned int bsp_nprocs_t;
256 typedef size_t bsp_size_t;
257 
258 //The public API is actually overriden by the use of macros in the below.
259 //This allows for per-unit mode switching, between, for instance,
260 //performance, debug, or profiling mode.
261 //Special modes are defined using the macro MCBSP_MODE, whose value
262 //contains the prefix to be used. For example:
263 //#define MCBSP_MODE bsp_profile
264 //will transform all BSP calls to bsp_begin to bsp_profile_begin, and
265 //similarly for all other BSP primitives. A special case is given by the
266 //MCBSP_COMPATIBILITY_MODE, which uses ANSI C99 style inlining in
267 //combination with macro-based aliases.
268 //A list of currently supported values for MCBSP_MODE follows:
269 // -1: the default performance mode.
270 // -2: a debugging mode that performs more sanity checks and
271 // is friendly for use with debuggers such as gdb and
272 // valgrind.
273 // -3: a profile mode that collects statistics during the
274 // SPMD run and report them after SPMD exit.
275 
276 #ifndef MCBSP_MODE
277 
294  #define MCBSP_MODE 1
295 #endif
296 
297 #if MCBSP_MODE == 3
298  #ifndef MCBSP_DISABLE_COMPILATION_MODE_WARNING
299  #pragma message "Warning: compiling in profile mode"
300  #endif
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"
305  #endif
306  #define MCBSP_FUNCTION_PREFIX(n) mcbsp_debug_##n
307 #else
308  #if MCBSP_MODE != 1
309  #pragma message "Warning: unknown MCBSP_MODE `" #MCBSP_MODE "'; defaulting to perf mode..."
310  #endif
311  #define MCBSP_FUNCTION_PREFIX(n) mcbsp_perf_##n
312 #endif
313 
314 //the real library functions are prototyped here,
315 //and depend on which mode we are compiling for:
316 void MCBSP_FUNCTION_PREFIX(begin)( const bsp_pid_t P );
317 void MCBSP_FUNCTION_PREFIX(end)( void );
318 void MCBSP_FUNCTION_PREFIX(init)( void (*spmd)(void), int argc, char **argv );
319 void MCBSP_FUNCTION_PREFIX(abort)( const char * const error_message, ... );
320 void MCBSP_FUNCTION_PREFIX(vabort)( const char * const error_message, va_list args );
323 double MCBSP_FUNCTION_PREFIX(time)( void );
324 void MCBSP_FUNCTION_PREFIX(sync)( void );
325 void MCBSP_FUNCTION_PREFIX(push_reg)( void * const address, const bsp_size_t size );
326 void MCBSP_FUNCTION_PREFIX(pop_reg)( void * const address );
328  const bsp_pid_t pid,
329  const void * const source,
330  const void * const destination,
331  const bsp_size_t offset,
332  const bsp_size_t size
333 );
334 void MCBSP_FUNCTION_PREFIX(get)(
335  const bsp_pid_t pid,
336  const void * const source,
337  const bsp_size_t offset,
338  void * const destination,
339  const bsp_size_t size
340 );
342  const bsp_pid_t pid,
343  const void * const source,
344  const bsp_size_t offset,
345  void * const destination,
346  const bsp_size_t size
347 );
348 void MCBSP_FUNCTION_PREFIX(set_tagsize)( bsp_size_t * const size );
350  const bsp_pid_t pid,
351  const void * const tag,
352  const void * const payload,
353  const bsp_size_t size
354 );
356  bsp_nprocs_t * const packets,
357  bsp_size_t * const accumulated_size
358 );
360  bsp_size_t * const status,
361  void * const tag
362 );
364  void * const payload,
365  const bsp_size_t max_copy_size
366 );
368  void* * const p_tag,
369  void* * const p_payload
370 );
372  const bsp_pid_t pid,
373  const void * const source,
374  const void * const destination,
375  const bsp_size_t offset,
376  const bsp_size_t size
377 );
379  const bsp_pid_t pid,
380  const void * const source,
381  const bsp_size_t offset,
382  void * const destination,
383  const bsp_size_t size
384 );
385 #ifdef MCBSP_ENABLE_HP_DIRECTIVES
387  const bsp_pid_t pid,
388  const void * const tag,
389  const void * const payload,
390  const bsp_size_t size
391 );
392 #endif
393 
394 #if MCBSP_MODE == 2
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
416 
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
441 
442  #define mcbsp_hpsend mcbsp_profile_hpsend
443  #define mcbsp_direct_get mcbsp_profile_direct_get
444 #else
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
466 
467  #define mcbsp_hpsend mcbsp_perf_hpsend
468  #define mcbsp_direct_get mcbsp_perf_direct_get
469 #endif
470 
471 //now account for possible compatibility mode translations
472 #ifdef MCBSP_COMPATIBILITY_MODE
473 static inline void bsp_begin( const int P ) {
475 }
476 
477 static inline void bsp_end( void ) {
478  mcbsp_end();
479 }
480 
481 static inline void bsp_init( void (*spmd)(void), int argc, char **argv ) {
482  mcbsp_init( spmd, argc, argv );
483 }
484 
485 static inline void bsp_abort( const char * const error_message, ... ) {
486  va_list args;
487  va_start( args, error_message );
488  mcbsp_vabort( error_message, args );
489  va_end( args );
490 }
491 
492 static inline void bsp_vabort( const char * const error_message, va_list args ) {
493  mcbsp_vabort( error_message, args );
494 }
495 
496 static inline int bsp_nprocs( void ) {
497  return (int)mcbsp_nprocs();
498 }
499 
500 static inline int bsp_pid( void ) {
501  return (int)mcbsp_pid();
502 }
503 
504 static inline double bsp_time( void ) {
505  return mcbsp_time();
506 }
507 
508 static inline void bsp_sync( void ) {
509  mcbsp_sync();
510 }
511 
512 static inline void bsp_push_reg( void * const address, const int size ) {
513  mcbsp_push_reg( address, (bsp_size_t)size );
514 }
515 
516 static inline void bsp_pop_reg( void * const address ) {
517  mcbsp_pop_reg( address );
518 }
519 
520 static inline void bsp_put(
521  const int pid,
522  const void * const source,
523  const void * const destination,
524  const int offset,
525  const int size
526 ) {
527  mcbsp_put( (bsp_pid_t)pid, source, destination, (bsp_size_t)offset, (bsp_size_t)size );
528 }
529 
530 static inline void bsp_get(
531  const int pid,
532  const void * const source,
533  const int offset,
534  void * const destination,
535  const int size
536 ) {
537  mcbsp_get( (bsp_pid_t)pid, source, (bsp_size_t)offset, destination, (bsp_size_t)size );
538 }
539 
540 static inline void bsp_set_tagsize( int * const size ) {
541  size_t convert = (size_t) *size;
542  mcbsp_set_tagsize( &convert );
543  *size = (int)convert;
544 }
545 
546 static inline void bsp_send(
547  const int pid,
548  const void * const tag,
549  const void * const payload,
550  const int size
551 ) {
552  mcbsp_send( (bsp_pid_t)pid, tag, payload, (bsp_size_t)size );
553 }
554 
555 #ifdef MCBSP_ENABLE_HP_DIRECTIVES
556 static inline void bsp_hpsend(
557  const int pid,
558  const void * const tag,
559  const void * const payload,
560  const int size
561 ) {
562  mcbsp_hpsend( (bsp_pid_t)pid, tag, payload, (bsp_size_t)size );
563 }
564 #endif
565 
566 static inline void bsp_qsize(
567  int * const packets,
568  int * const accumulated_size
569 ) {
570  bsp_nprocs_t conv_packets;
571  if( accumulated_size == NULL ) {
572  mcbsp_qsize( &conv_packets, NULL );
573  } else {
574  bsp_size_t conv_size;
575  mcbsp_qsize( &conv_packets, &conv_size );
576  *accumulated_size = (int)conv_size;
577  }
578  *packets = (int)conv_packets;
579 }
580 
581 static inline void bsp_get_tag(
582  int * const status,
583  void * const tag
584 ) {
585  bsp_size_t converted;
586  mcbsp_get_tag( &converted, tag );
587  if( converted != SIZE_MAX ) {
588  *status = (int)converted;
589  } else {
590  *status = -1;
591  }
592 }
593 
594 static inline void bsp_move( void * const payload, const int max_copy_size ) {
595  mcbsp_move( payload, (const bsp_size_t)max_copy_size );
596 }
597 
598 static inline int bsp_hpmove( void* * const p_tag, void* * const p_payload ) {
599  return (int)mcbsp_hpmove( p_tag, p_payload );
600 }
601 
602 static inline void bsp_hpput(
603  const int pid,
604  const void * const source,
605  const void * const destination,
606  const int offset,
607  const int size
608 ) {
609  mcbsp_hpput( (const bsp_pid_t)pid, source, destination, (const bsp_size_t)offset, (const bsp_size_t)size );
610 }
611 
612 static inline void bsp_hpget(
613  const int pid,
614  const void * const source,
615  const int offset,
616  void * const destination,
617  const int size
618 ) {
619  mcbsp_hpget( (const bsp_pid_t)pid, source, (const bsp_size_t)offset, destination, (const bsp_size_t)size );
620 }
621 #else
622 
640 static inline void bsp_begin( const bsp_pid_t P ) {
641  mcbsp_begin( P );
642 }
643 
655 static inline void bsp_end( void ) {
656  mcbsp_end();
657 }
658 
676 static inline void bsp_init( void (*spmd)(void), int argc, char **argv ) {
677  mcbsp_init( spmd, argc, argv );
678 }
679 
693 static inline void bsp_abort( const char * const error_message, ... ) {
694  va_list args;
695  va_start( args, error_message );
696  mcbsp_vabort( error_message, args );
697  va_end( args );
698 }
699 
714 static inline void bsp_vabort( const char * const error_message, va_list args ) {
715  mcbsp_vabort( error_message, args );
716 }
717 
745 static inline bsp_pid_t bsp_nprocs( void ) {
746  return mcbsp_nprocs();
747 }
748 
767 static inline bsp_pid_t bsp_pid( void ) {
768  return mcbsp_pid();
769 }
770 
785 static inline double bsp_time( void ) {
786  return mcbsp_time();
787 }
788 
812 static inline void bsp_sync( void ) {
813  mcbsp_sync();
814 }
815 
854 static inline void bsp_push_reg( void * const address, const bsp_size_t size ) {
855  mcbsp_push_reg( address, size );
856 }
857 
882 static inline void bsp_pop_reg( void * const address ) {
883  mcbsp_pop_reg( address );
884 }
885 
925 static inline void bsp_put(
926  const bsp_pid_t pid,
927  const void * const source,
928  const void * const destination,
929  const bsp_size_t offset,
930  const bsp_size_t size
931 ) {
932  mcbsp_put( pid, source, destination, offset, size );
933 }
934 
978 static inline void bsp_get(
979  const bsp_pid_t pid,
980  const void * const source,
981  const bsp_size_t offset,
982  void * const destination,
983  const bsp_size_t size
984 ) {
985  mcbsp_get( pid, source, offset, destination, size );
986 }
987 
1043 static inline void bsp_direct_get(
1044  const bsp_pid_t pid,
1045  const void * const source,
1046  const bsp_size_t offset,
1047  void * const destination,
1048  const bsp_size_t size
1049 ) {
1050  mcbsp_direct_get( pid, source, offset, destination, size );
1051 }
1052 
1084 static inline void bsp_set_tagsize( bsp_size_t * const size ) {
1085  mcbsp_set_tagsize( size );
1086 }
1087 
1106 static inline void bsp_send(
1107  const bsp_pid_t pid,
1108  const void * const tag,
1109  const void * const payload,
1110  const bsp_size_t size
1111 ) {
1112  mcbsp_send( pid, tag, payload, size );
1113 }
1114 
1115 #ifdef MCBSP_ENABLE_HP_DIRECTIVES
1116 
1170 static inline void bsp_hpsend(
1171  const bsp_pid_t pid,
1172  const void * const tag,
1173  const void * const payload,
1174  const bsp_size_t size
1175 ) {
1176  mcbsp_hpsend( pid, tag, payload, size );
1177 }
1178 #endif
1179 
1189 static inline void bsp_qsize(
1190  bsp_nprocs_t * const packets,
1191  bsp_size_t * const accumulated_size
1192 ) {
1193  mcbsp_qsize( packets, accumulated_size );
1194 }
1195 
1219 static inline void bsp_get_tag(
1220  bsp_size_t * const status,
1221  void * const tag
1222 ) {
1223  mcbsp_get_tag( status, tag );
1224 }
1225 
1257 static inline void bsp_move( void * const payload, const bsp_size_t max_copy_size ) {
1258  mcbsp_move( payload, max_copy_size );
1259 }
1260 
1312 static inline bsp_size_t bsp_hpmove( void* * const p_tag, void* * const p_payload ) {
1313  return mcbsp_hpmove( p_tag, p_payload );
1314 }
1315 
1365 static inline void bsp_hpput(
1366  const bsp_pid_t pid,
1367  const void * const source,
1368  const void * const destination,
1369  const bsp_size_t offset,
1370  const bsp_size_t size
1371 ) {
1372  mcbsp_hpput( pid, source, destination, offset, size );
1373 }
1374 
1431 static inline void bsp_hpget(
1432  const bsp_pid_t pid,
1433  const void * const source,
1434  const bsp_size_t offset,
1435  void * const destination,
1436  const bsp_size_t size
1437 ) {
1438  mcbsp_hpget( pid, source, offset, destination, size );
1439 }
1440 #endif
1441 
1442 #endif
1443 
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