core_portme.h | |
Description | This file contains configuration constants required to execute on different platforms |
Configuration | |
HAS_FLOAT | Define to 1 if the platform supports floating point. |
HAS_TIME_H | Define to 1 if platform has the time.h header file, and implementation of functions thereof. |
USE_CLOCK | Define to 1 if platform has the time.h header file, and implementation of functions thereof. |
HAS_STDIO | Define to 1 if the platform has stdio.h. |
HAS_PRINTF | Define to 1 if the platform has stdio.h and implements the printf function. |
CORE_TICKS | Define type of return from the timing functions. |
SEED_METHOD | Defines method to get seed values that cannot be computed at compile time. |
MEM_METHOD | Defines method to get a block of memry. |
MULTITHREAD | Define for parallel execution |
USE_PTHREAD | Sample implementation for launching parallel contexts This implementation uses pthread_thread_create and pthread_join. |
USE_FORK | Sample implementation for launching parallel contexts This implementation uses fork, waitpid, shmget,shmat and shmdt. |
USE_SOCKET | Sample implementation for launching parallel contexts This implementation uses fork, socket, sendto and recvfrom |
MAIN_HAS_NOARGC | Needed if platform does not support getting arguments to main. |
MAIN_HAS_NORETURN | Needed if platform does not support returning a value from main. |
Variables | |
default_num_contexts | Number of contexts to spawn in multicore context. |
Define for parallel execution
1 | only one context (default). |
N>1 | will execute N copies in parallel. |
If this flag is defined to more then 1, an implementation for launching parallel contexts must be defined.
Two sample implementations are provided. Use USE_PTHREAD or USE_FORK to enable them.
It is valid to have a different implementation of core_start_parallel and <core_end_parallel> in core_portme.c, to fit a particular architecture.
extern ee_u32 default_num_contexts
Number of contexts to spawn in multicore context. Override this global value to change number of contexts used.
This value may not be set higher then the MULTITHREAD define.
To experiment, you can set the MULTITHREAD define to the highest value expected, and use argc/argv in the portable_init to set this value from the command line.
Number of contexts to spawn in multicore context.
extern ee_u32 default_num_contexts
Target specific initialization code Test for some common mistakes.
void portable_init( core_portable * p, int * argc, char * argv[] )