20#if !defined(PASTIX_WITH_STARPU)
21#error "This file should not be compiled if Starpu is not enabled"
25#if defined(PASTIX_WITH_MPI)
33typedef struct pst_range_ pst_range_t;
44static pst_range_t *pst_first = NULL;
49static int64_t starpu_tag_ub = 0;
71 void *tag_ub_p = NULL;
73 starpu_mpi_comm_get_attr(
pastix->inter_node_comm, STARPU_MPI_TAG_UB, &tag_ub_p, &ok );
74 starpu_tag_ub = (uint64_t)((intptr_t)tag_ub_p);
77 pastix_print_error(
"pastix_starpu_tag_init: MPI_TAG_UB not known by StarPU\n");
113 pst_range_t *prev = NULL;
114 pst_range_t *current = pst_first;
116 int64_t max = ( current == NULL ) ? starpu_tag_ub : current->min;
118 assert( starpu_tag_ub != 0 );
120 while ( ((max - min) < nbtags) && (current != NULL) ) {
123 current = current->next;
124 max = ( current == NULL ) ? starpu_tag_ub : current->min;
127 if ( (max - min) < nbtags ) {
128 pastix_print_error(
"pastix_starpu_tag_book: No space left in tags (looking for %ld tags)\n",
133 new = malloc(
sizeof( pst_range_t ) );
135 new->max = min + nbtags;
137 if ( prev == NULL ) {
141 assert( prev->next == current );
145#if defined(PASTIX_DEBUG_STARPU)
146 fprintf( stderr,
"pastix_starpu_tag: Book %ld - %ld\n",
147 (
long)min, (
long)(min + nbtags) );
150 assert( pst_first != NULL );
170 pst_range_t *prev = NULL;
171 pst_range_t *current = pst_first;
173 assert( pst_first != NULL );
175 while ( (current != NULL) && (current->min < min) ) {
177 current = current->next;
180 assert( current != NULL );
181 assert( current->min == min );
184 prev->next = current->next;
187 assert( current == pst_first );
188 pst_first = current->next;
191#if defined(PASTIX_DEBUG_STARPU)
192 fprintf( stderr,
"pastix_starpu_tag: Release %ld - %ld\n",
193 (
long)current->min, (
long)current->max );
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.
int64_t pastix_starpu_tag_book(int64_t nbtags)
Book a range of StarPU unique tags of size nbtags.
void pastix_starpu_tag_release(int64_t min)
Release the set of tags starting by min.
int pastix_starpu_tag_init(pastix_data_t *pastix)
Initialize the StarPU tags manager.
Main PaStiX data structure.