20 #ifndef DOXYGEN_SHOULD_SKIP_THIS
26 #if !defined(PASTIX_WITH_PARSEC)
27 #error "This file should not be compiled if PaRSEC is not enabled"
31 #include "parsec/utils/mca_param.h"
32 #if defined(PASTIX_WITH_CUDA)
62 int *argc,
char **argv[],
65 extern char **environ;
67 char **parsec_argv = (argv == NULL) ? NULL : *argv;
74 #if !defined(PASTIX_WITH_CUDA)
79 #if defined(PASTIX_GENERATE_MODEL)
80 pastix_print(
pastix->procnum, 0,
81 "WARNING: PaStiX compiled with -DPASTIX_GENERATE_MODEL forces:\n"
82 " - a single event per stream\n"
83 " - a single stream per GPU\n"
84 " - restore the automatic detection of the number of threads\n" );
87 parsec_setenv_mca_param(
"device_cuda_max_streams",
"3", &environ );
88 parsec_setenv_mca_param(
"device_cuda_max_events_per_stream",
"1", &environ );
92 parsec_setenv_mca_param(
"device_cuda_enabled", value, &environ );
96 parsec_setenv_mca_param(
"device_cuda_memory_block_size", value, &environ );
100 parsec_setenv_mca_param(
"device_cuda_memory_use", value, &environ );
105 parsec_setenv_mca_param(
"device_show_statistics",
"1", &environ );
108 parsec_setenv_mca_param(
"device_show_capabilities",
"1", &environ );
112 #if defined(PASTIX_WITH_CUDA)
117 if ( bindtab != NULL ) {
121 rc = asprintf( &value,
"%d", bindtab[0] );
124 rc = asprintf( &value,
"%s:%d", valtmp, bindtab[i] );
128 if (parsec_argv == NULL) {
129 parsec_argv = malloc( 4 *
sizeof(
char*) );
130 parsec_argv[0] = strdup(
"./pastix" );
131 parsec_argv[1] = strdup(
"--parsec_bind" );
132 parsec_argv[2] = value;
133 parsec_argv[3] = NULL;
137 void *new_ptr = realloc( parsec_argv, (*argc+3) *
sizeof(
char*) );
139 if ( new_ptr != NULL ) {
140 parsec_argv = new_ptr;
142 parsec_argv[*argc ] = strdup(
"--parsec_bind" );
143 parsec_argv[*argc + 1] = value;
144 parsec_argv[*argc + 2] = NULL;
149 pastix->parsec = parsec_init( thrdnbr, argc, argv );
151 if ( bindtab != NULL ) {
152 assert( *argc >= 3 );
154 free( parsec_argv[*argc - 1] );
155 free( parsec_argv[*argc - 2] );
157 free( parsec_argv[*argc - 3] );
180 if (
pastix->parsec != NULL) {
181 parsec_fini( (parsec_context_t**)&(
pastix->parsec) );
BEGIN_C_DECLS typedef int pastix_int_t
BEGIN_C_DECLS int pastix(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, pastix_int_t n, pastix_int_t *colptr, pastix_int_t *rowptr, void *values, pastix_int_t *perm, pastix_int_t *invp, void *B, pastix_int_t nrhs, pastix_int_t *iparm, double *dparm)
Main function for compatibility with former releases.
@ IPARM_GPU_MEMORY_BLOCK_SIZE
@ IPARM_GPU_MEMORY_PERCENTAGE
void pastix_parsec_init(pastix_data_t *pastix, int *argc, char **argv[], const int *bindtab)
Startup the PaRSEC runtime system.
void pastix_parsec_finalize(pastix_data_t *pastix)
Finalize the PaRSEC runtime system.
Main PaStiX data structure.