PaStiX Handbook  6.2.1
api.c
Go to the documentation of this file.
1 /**
2  *
3  * @file api.c
4  *
5  * PaStiX API routines
6  *
7  * @copyright 2004-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8  * Univ. Bordeaux. All rights reserved.
9  *
10  * @version 6.2.1
11  * @author Xavier Lacoste
12  * @author Pierre Ramet
13  * @author Mathieu Faverge
14  * @author Esragul Korkmaz
15  * @author Gregoire Pichon
16  * @author Matias Hastaran
17  * @author Tony Delarue
18  * @date 2021-07-02
19  *
20  **/
21 #define _GNU_SOURCE 1
22 #include "common.h"
23 #if defined(PASTIX_ORDERING_METIS)
24 #include <metis.h>
25 #endif
26 #include "graph/graph.h"
27 #include "pastix/order.h"
28 #include "blend/solver.h"
29 #include "bcsc/bcsc.h"
30 #include "isched.h"
31 #include <sys/types.h>
32 #include <sys/stat.h>
33 #include "models.h"
34 #if defined(PASTIX_WITH_PARSEC)
36 #endif
37 #if defined(PASTIX_WITH_STARPU)
39 #endif
40 
41 #if defined(PASTIX_OS_WINDOWS)
42 #define pastix_mkdir( __str ) mkdir( (__str) )
43 #else
44 #define pastix_mkdir( __str ) mkdir( (__str), 0700 )
45 #endif
46 
47 #if defined(PASTIX_WITH_MPI)
48 static int pastix_mpi_in_use = 0; /**< Counter of the number of Pastix instances using MPI */
49 static int pastix_mpi_init = 0; /**< Boolean to know if MPI has been initialized by pastix or not */
50 static volatile pastix_atomic_lock_t pastix_mpi_lock = PASTIX_ATOMIC_UNLOCKED; /**< Lock to protect the MPI initialization */
51 #endif
52 
53 /**
54  *******************************************************************************
55  *
56  * @ingroup pastix_api
57  *
58  * @brief Generate a unique temporary directory to store output files
59  *
60  *******************************************************************************
61  *
62  * @param[inout] pastix_data
63  * On entry, the pastix_data structure associated to the pastix instance.
64  * On exit, if not already initialized, pastix_data->dir_global and
65  * pastix_data->dir_local are initialized.
66  *
67  *******************************************************************************/
68 void
69 pastix_gendirectories( pastix_data_t *pastix_data )
70 {
71  char **dir_global = &(pastix_data->dir_global);
72  mode_t old_mask;
73  int rc, len;
74 
75  if ( *dir_global != NULL ) {
76  return;
77  }
78 
79  if ( pastix_data->procnum == 0 )
80  {
81  *dir_global = strdup( "pastix-XXXXXX" );
82 
83 #if !defined(HAVE_MKDTEMP)
84  {
85  *dir_global = mktemp( *dir_global );
86  if ( (*dir_global)[0] == '\0' ) {
87  perror( "pastix_gendirectories/global/mktemp" );
88  free( *dir_global );
89  *dir_global = NULL;
90  return;
91  }
92 
93  old_mask = umask(S_IWGRP | S_IWOTH);
94  rc = pastix_mkdir( *dir_global );
95  (void)umask(old_mask);
96 
97  if ( rc == -1 ) {
98  perror( "pastix_gendirectories/global/mkdir" );
99  free( *dir_global );
100  *dir_global = NULL;
101  return;
102  }
103  }
104 #else
105  {
106  old_mask = umask(S_IWGRP | S_IWOTH);
107  *dir_global = mkdtemp( *dir_global );
108  (void)umask(old_mask);
109  if ( *dir_global == NULL ) {
110  perror( "pastix_gendirectories/global/mkdtemp" );
111  return;
112  }
113  }
114 #endif
115  /* Broadcast the main directory to everyone */
116  len = strlen( *dir_global );
117 
118  MPI_Bcast( &len, 1, MPI_INT,
119  0, pastix_data->inter_node_comm );
120  MPI_Bcast( pastix_data->dir_global, len+1, MPI_CHAR,
121  0, pastix_data->inter_node_comm );
122 
123  fprintf( stdout, "OUTPUTDIR: %s\n", *dir_global );
124  }
125  else {
126  len = 0;
127  MPI_Bcast( &len, 1, MPI_INT,
128  0, pastix_data->inter_node_comm );
129  pastix_data->dir_global = malloc( (len+1) * sizeof(char) );
130  MPI_Bcast( pastix_data->dir_global, len+1, MPI_CHAR,
131  0, pastix_data->inter_node_comm );
132  }
133 
134  assert( *dir_global != NULL );
135 
136  /*
137  * Create the local directory name
138  */
139 #if defined(PASTIX_WITH_MPI)
140  if (pastix_data->procnbr > 1)
141  {
142  char *localdir;
143  rc = asprintf( &localdir, "%s/%0*d",
144  *dir_global,
145  (int)pastix_iceil( pastix_data->procnbr, 10 ),
146  pastix_data->procnum );
147 
148  old_mask = umask(S_IWGRP | S_IWOTH);
149  rc = pastix_mkdir( localdir );
150  (void)umask(old_mask);
151 
152  if ( rc == -1 ) {
153  perror( "pastix_gendirectories/local/mkdir" );
154  free( localdir );
155  return;
156  }
157  pastix_data->dir_local = localdir;
158  }
159  else
160 #endif
161  {
162  pastix_data->dir_local = strdup( *dir_global );
163  }
164  (void)rc;
165 }
166 
167 /**
168  *******************************************************************************
169  *
170  * @ingroup pastix_api
171  *
172  * @brief Generate the full filename within local or global directory.
173  *
174  *******************************************************************************
175  *
176  * @param[in] dirname
177  * The pointer to the directory string associated to the instance.
178  * It must have been initialized before calling.
179  *
180  * @param[in] filename
181  * The filename to create in the unique directory.
182  *
183  *******************************************************************************
184  *
185  * @return The filename to use. NULL if failed.
186  *
187  *******************************************************************************/
188 char *
189 pastix_fname( const char *dirname,
190  const char *filename )
191 {
192  char *fullname = NULL;
193  int rc;
194 
195  /* Make sure dirname has been initialized before calling fopen */
196  assert( dirname );
197 
198  rc = asprintf( &fullname, "%s/%s", dirname, filename );
199  if ( rc <= 0 ) {
200  pastix_print_error( "pastix_fname: Couldn't not generate the tempory filename for the output file" );
201  return NULL;
202  }
203 
204  return fullname;
205 }
206 
207 /**
208  *******************************************************************************
209  *
210  * @ingroup pastix_api
211  *
212  * @brief Open a file in the unique directory of the pastix instance
213  *
214  *******************************************************************************
215  *
216  * @param[in] dirname
217  * The pointer to the directory string associated to the instance.
218  * It must have been initialized before calling.
219  *
220  * @param[in] filename
221  * The filename to create in the unique directory.
222  *
223  * @param[in] mode
224  * Opening mode of the file as described by the fopen() function.
225  *
226  *******************************************************************************
227  *
228  * @return The FILE structure of the opened file. NULL if failed.
229  *
230  *******************************************************************************/
231 FILE *
232 pastix_fopenw( const char *dirname,
233  const char *filename,
234  const char *mode )
235 {
236  char *fullname;
237  FILE *f = NULL;
238 
239  /* Make sure dirname has been initialized before calling fopen */
240  assert( dirname );
241 
242  fullname = pastix_fname( dirname, filename );
243  if ( !fullname ) {
244  return NULL;
245  }
246 
247  f = fopen( fullname, mode );
248  free( fullname );
249 
250  if ( NULL == f )
251  {
252  perror( "pastix_fopenw" );
253  pastix_print_error( "pastix_fopenw: Couldn't open file: %s with mode %s\n",
254  filename, mode );
255  return NULL;
256  }
257 
258  return f;
259 }
260 
261 /**
262  *******************************************************************************
263  *
264  * @ingroup pastix_api
265  *
266  * @brief Open a file in the current directory in read only mode.
267  *
268  *******************************************************************************
269  *
270  * @param[in] filename
271  * The filename of the file to open.
272  *
273  *******************************************************************************
274  *
275  * @return The FILE structure of the opened file. NULL if failed.
276  *
277  *******************************************************************************/
278 FILE *
279 pastix_fopen( const char *filename )
280 {
281  FILE *f = fopen(filename, "r");
282 
283  if (NULL == f)
284  {
285  perror("pastix_fopen");
286  pastix_print_error( "pastix_fopen: Couldn't open file: %s with mode r\n",
287  filename );
288  return NULL;
289  }
290 
291  return f;
292 }
293 
294 /**
295  *******************************************************************************
296  *
297  * @ingroup pastix_api
298  *
299  * @brief Print information about the solver configuration
300  *
301  *******************************************************************************
302  *
303  * @param[in] pastix
304  * The main data structure.
305  *
306  *******************************************************************************/
307 void
308 pastixWelcome( const pastix_data_t *pastix )
309 {
310  pastix_print( pastix->procnum, 0, OUT_HEADER,
311  /* Version */ PASTIX_VERSION_MAJOR, PASTIX_VERSION_MINOR, PASTIX_VERSION_MICRO,
312  /* Sched. seq */ "Enabled",
313  /* Sched. sta */ (pastix->isched ? "Started" : "Disabled"),
314  /* Sched. dyn */ ( (pastix->iparm[IPARM_SCHEDULER] == PastixSchedDynamic) ? "Started" : "Disabled" ),
315  /* Sched. PaR */
316 #if defined(PASTIX_WITH_PARSEC)
317  (pastix->parsec == NULL ? "Enabled" : "Started" ),
318 #else
319  "Disabled",
320 #endif
321  /* Sched. SPU */
322 #if defined(PASTIX_WITH_STARPU)
323  (pastix->starpu == NULL ? "Enabled" : "Started" ),
324 #else
325  "Disabled",
326 #endif
327  /* MPI nbr */ pastix->procnbr,
328  /* Thrd nbr */ (int)(pastix->iparm[IPARM_THREAD_NBR]),
329  /* GPU nbr */ (int)(pastix->iparm[IPARM_GPU_NBR]),
330  /* MPI mode */ pastix_mpithreadmode_getstr( pastix->iparm[IPARM_MPI_THREAD_LEVEL] ),
331  /* Distrib */ ((pastix->iparm[IPARM_TASKS2D_LEVEL] == 0) ? "1D" : "2D"),
332  ((pastix->iparm[IPARM_TASKS2D_LEVEL] < 0) ? ((long)pastix->iparm[IPARM_TASKS2D_WIDTH]) :
333  -((long)pastix->iparm[IPARM_TASKS2D_LEVEL])),
334  /* Block size */ (long)pastix->iparm[IPARM_MIN_BLOCKSIZE],
335  (long)pastix->iparm[IPARM_MAX_BLOCKSIZE],
336  /* Model CPU */ pastix->cpu_models->name,
337  /* Model GPU */ pastix->gpu_models->name,
338  /* Strategy */ ((pastix->iparm[IPARM_COMPRESS_WHEN] == PastixCompressNever) ? "No compression" :
339  (pastix->iparm[IPARM_COMPRESS_WHEN] == PastixCompressWhenBegin) ? "Memory Optimal" : "Just-In-Time") );
340 
341 
343  pastix_print( pastix->procnum, 0, OUT_HEADER_LR,
344  /* Tolerance */ (double)pastix->dparm[DPARM_COMPRESS_TOLERANCE],
345  /* Compress method */ compmeth_shnames[pastix->iparm[IPARM_COMPRESS_METHOD]],
346  /* Compress width */ (long)pastix->iparm[IPARM_COMPRESS_MIN_WIDTH],
347  /* Compress height */ (long)pastix->iparm[IPARM_COMPRESS_MIN_HEIGHT],
348  /* Min ratio */ (double)pastix->dparm[DPARM_COMPRESS_MIN_RATIO],
349  /* Tolerance used */ pastix->iparm[IPARM_COMPRESS_RELTOL] ? "Relative" : "Absolute",
350  /* Ortho method */ ((pastix->iparm[IPARM_COMPRESS_ORTHO] == PastixCompressOrthoCGS) ? "CGS" :
351  (pastix->iparm[IPARM_COMPRESS_ORTHO] == PastixCompressOrthoQR) ? "QR" : "partialQR"),
352  /* Splitting strategy */ ((pastix->iparm[IPARM_SPLITTING_STRATEGY] == PastixSplitNot) ? "Not used" :
353  (pastix->iparm[IPARM_SPLITTING_STRATEGY] == PastixSplitKway) ? "KWAY" : "KWAY and projections"),
354  /* Levels of projections */ (long)pastix->iparm[IPARM_SPLITTING_LEVELS_PROJECTIONS],
355  /* Levels of kway */ (long)pastix->iparm[IPARM_SPLITTING_LEVELS_KWAY],
356  /* Projections distance */ (long)pastix->iparm[IPARM_SPLITTING_PROJECTIONS_DISTANCE],
357  /* Projections depth */ (long)pastix->iparm[IPARM_SPLITTING_PROJECTIONS_DEPTH],
358  /* Projections width */ (long)pastix->iparm[IPARM_SPLITTING_PROJECTIONS_WIDTH] );
359  }
360 }
361 
362 /**
363  *******************************************************************************
364  *
365  * @ingroup pastix_api
366  *
367  * @brief Print summary information
368  *
369  *******************************************************************************
370  *
371  * @param[in] pastix
372  * The main data structure.
373  *
374  *******************************************************************************/
375 void
376 pastixSummary( const pastix_data_t *pastix )
377 {
378  (void)pastix;
379 }
380 
381 /**
382  *******************************************************************************
383  *
384  * @ingroup pastix_api
385  *
386  * @brief Initialize the iparm and dparm arrays to their default
387  * values.
388  *
389  * This is performed only if iparm[IPARM_MODIFY_PARAMETER] is set to 0.
390  *
391  *******************************************************************************
392  *
393  * @param[inout] iparm
394  * The integer array of parameters to initialize.
395  *
396  * @param[inout] dparm
397  * The floating point array of parameters to initialize.
398  *
399  *******************************************************************************/
400 void
401 pastixInitParam( pastix_int_t *iparm,
402  double *dparm )
403 {
404  memset( iparm, 0, IPARM_SIZE * sizeof(pastix_int_t) );
405  memset( dparm, 0, DPARM_SIZE * sizeof(double) );
406 
408  iparm[IPARM_IO_STRATEGY] = PastixIONo;
409 
410  /* Stats */
411  iparm[IPARM_NNZEROS] = 0;
412  iparm[IPARM_NNZEROS_BLOCK_LOCAL] = 0;
413  iparm[IPARM_ALLOCATED_TERMS] = 0;
414  iparm[IPARM_PRODUCE_STATS] = 0;
415  iparm[IPARM_TRACE] = PastixTraceNumfact;
416 
417  /* Scaling */
418  iparm[IPARM_MC64] = 0;
419 
420  /*
421  * Ordering parameters
422  */
423  iparm[IPARM_ORDERING] = -1;
424 #if defined(PASTIX_ORDERING_METIS)
426 #endif
427 #if defined(PASTIX_ORDERING_SCOTCH)
429 #endif
430  iparm[IPARM_ORDERING_DEFAULT] = 1;
431 
432  /* Scotch */
433  {
434  iparm[IPARM_SCOTCH_MT] = 1;
435  iparm[IPARM_SCOTCH_SWITCH_LEVEL] = 120;
436  iparm[IPARM_SCOTCH_CMIN] = 0;
437  iparm[IPARM_SCOTCH_CMAX] = 100000;
438  iparm[IPARM_SCOTCH_FRAT] = 8;
439  }
440 
441  /* Metis */
442  {
443 #if defined(PASTIX_ORDERING_METIS)
444  iparm[IPARM_METIS_CTYPE ] = METIS_CTYPE_SHEM;
445  iparm[IPARM_METIS_RTYPE ] = METIS_RTYPE_SEP1SIDED;
446 #else
447  iparm[IPARM_METIS_CTYPE ] = -1;
448  iparm[IPARM_METIS_RTYPE ] = -1;
449 #endif
450  iparm[IPARM_METIS_NO2HOP ] = 0;
451  iparm[IPARM_METIS_NSEPS ] = 1;
452  iparm[IPARM_METIS_NITER ] = 10;
453  iparm[IPARM_METIS_UFACTOR ] = 200;
454  iparm[IPARM_METIS_COMPRESS] = 1;
455  iparm[IPARM_METIS_CCORDER ] = 0;
456  iparm[IPARM_METIS_PFACTOR ] = 0;
457  iparm[IPARM_METIS_SEED ] = 3452;
458  iparm[IPARM_METIS_DBGLVL ] = 0;
459  }
460 
461  /* Symbolic factorization */
462  iparm[IPARM_AMALGAMATION_LVLCBLK] = 5;
463  iparm[IPARM_AMALGAMATION_LVLBLAS] = 5;
464 
465  /* Reordering */
466  iparm[IPARM_REORDERING_SPLIT] = 0;
467  iparm[IPARM_REORDERING_STOP] = PASTIX_INT_MAX;
468 
469  /* Splitting */
472  iparm[IPARM_SPLITTING_LEVELS_KWAY] = PASTIX_INT_MAX;
476 
477  /* Analyze */
478  iparm[IPARM_MIN_BLOCKSIZE] = 160;
479  iparm[IPARM_MAX_BLOCKSIZE] = 320;
480  iparm[IPARM_TASKS2D_LEVEL] = -1;
482  iparm[IPARM_ALLCAND] = 0;
483 
484  /* Incomplete */
485  iparm[IPARM_INCOMPLETE] = 0;
486  iparm[IPARM_LEVEL_OF_FILL] = 0;
487 
488  /* Factorization */
490  iparm[IPARM_STATIC_PIVOTING] = 0;
491  iparm[IPARM_FREE_CSCUSER] = 0;
492  iparm[IPARM_SCHUR_FACT_MODE] = PastixFactModeLocal;
493 
494  /* Solve */
496  iparm[IPARM_SCHUR_SOLV_MODE] = PastixSolvModeLocal;
497  iparm[IPARM_APPLYPERM_WS] = 1;
498 
499  /* Refinement */
501  iparm[IPARM_NBITER] = 0;
502  iparm[IPARM_ITERMAX] = 250;
503  iparm[IPARM_GMRES_IM] = 25;
504 
505  /* Context */
507  iparm[IPARM_THREAD_NBR] = -1;
508  iparm[IPARM_AUTOSPLIT_COMM] = 0;
509 
510  /* GPU */
511  iparm[IPARM_GPU_NBR] = 0;
512  iparm[IPARM_GPU_MEMORY_PERCENTAGE] = 95;
513  iparm[IPARM_GPU_MEMORY_BLOCK_SIZE] = 32 * 1024;
514 
515  /* Compression */
516  iparm[IPARM_COMPRESS_MIN_WIDTH] = 128;
517  iparm[IPARM_COMPRESS_MIN_HEIGHT] = 20;
521  iparm[IPARM_COMPRESS_PRESELECT] = 1;
522  iparm[IPARM_COMPRESS_ILUK] = -2;
523 
524  /* MPI modes */
526 
527  /* Subset for old pastix interface */
528  iparm[IPARM_MODIFY_PARAMETER] = 1;
531  iparm[IPARM_FLOAT] = -1;
532  iparm[IPARM_MTX_TYPE] = -1;
533  iparm[IPARM_DOF_NBR] = 1;
534 
535  dparm[DPARM_FILL_IN] = 0.;
536  dparm[DPARM_EPSILON_REFINEMENT] = -1.;
537  dparm[DPARM_RELATIVE_ERROR] = -1.;
538  dparm[DPARM_EPSILON_MAGN_CTRL] = 0.;
539  dparm[DPARM_ANALYZE_TIME] = 0.;
540  dparm[DPARM_PRED_FACT_TIME] = 0.;
541  dparm[DPARM_FACT_TIME] = 0.;
542  dparm[DPARM_SOLV_TIME] = 0.;
543  dparm[DPARM_FACT_FLOPS] = 0.;
544  dparm[DPARM_FACT_THFLOPS] = 0.;
545  dparm[DPARM_FACT_RLFLOPS] = 0.;
546  dparm[DPARM_MEM_FR] = 0.;
547  dparm[DPARM_MEM_LR] = 0.;
548  dparm[DPARM_SOLV_FLOPS] = 0.;
549  dparm[DPARM_SOLV_THFLOPS] = 0.;
550  dparm[DPARM_SOLV_RLFLOPS] = 0.;
551  dparm[DPARM_REFINE_TIME] = 0.;
552  dparm[DPARM_A_NORM] = -1.;
553  dparm[DPARM_COMPRESS_TOLERANCE] = 1e-8;
554  dparm[DPARM_COMPRESS_MIN_RATIO] = 1.;
555 }
556 
557 /**
558  *******************************************************************************
559  *
560  * @ingroup pastix_internal
561  *
562  * @brief Internal function that setups the multiple communicators in order
563  * to perform the ordering step in MPI only mode, and the factorization in
564  * MPI+Thread mode with the same amount of ressources.
565  *
566  *******************************************************************************
567  *
568  * @param[inout] pastix
569  * The pastix datat structure to initialize.
570  *
571  * @param[in] comm
572  * The MPI communicator associated to the pastix data structure
573  *
574  * @param[in] autosplit
575  * Enable automatic split when multiple processes run on the same node
576  *
577  *******************************************************************************/
578 static inline void
579 apiInitMPI( pastix_data_t *pastix,
580  PASTIX_Comm comm,
581  int autosplit )
582 {
583  /*
584  * Setup all communicators for autosplitmode and initialize number/rank of
585  * processes.
586  */
587  if ( comm == 0 ) {
588  comm = MPI_COMM_WORLD;
589  }
590  pastix->pastix_comm = comm;
591  MPI_Comm_size(pastix->pastix_comm, &(pastix->procnbr));
592  MPI_Comm_rank(pastix->pastix_comm, &(pastix->procnum));
593 
594 #if defined(PASTIX_WITH_MPI)
595  if ( autosplit )
596  {
597  int i, len;
598  char procname[MPI_MAX_PROCESSOR_NAME];
599  int rc, key = pastix->procnum;
600  int64_t color;
601  (void)rc;
602 
603  /*
604  * Get hostname to generate a hash that will be the color of each node
605  * MPI_Get_processor_name is not used as it can returned different
606  * strings for processes of a same physical node.
607  */
608  rc = gethostname(procname, MPI_MAX_PROCESSOR_NAME-1);
609  assert(rc == 0);
610  procname[MPI_MAX_PROCESSOR_NAME-1] = '\0';
611  len = strlen( procname );
612 
613  /* Compute hash */
614  color = 0;
615  for (i = 0; i < len; i++) {
616  color = color*256*sizeof(char) + procname[i];
617  }
618 
619  /* Create intra-node communicator */
620  MPI_Comm_split(pastix->pastix_comm, color, key, &(pastix->intra_node_comm));
621  MPI_Comm_size(pastix->intra_node_comm, &(pastix->intra_node_procnbr));
622  MPI_Comm_rank(pastix->intra_node_comm, &(pastix->intra_node_procnum));
623 
624  /* Create inter-node communicator */
625  MPI_Comm_split(pastix->pastix_comm, pastix->intra_node_procnum, key, &(pastix->inter_node_comm));
626  MPI_Comm_size(pastix->inter_node_comm, &(pastix->inter_node_procnbr));
627  MPI_Comm_rank(pastix->inter_node_comm, &(pastix->inter_node_procnum));
628  }
629  else
630 #endif
631  {
632  pastix->intra_node_comm = MPI_COMM_SELF;
633  pastix->intra_node_procnbr = 1;
634  pastix->intra_node_procnum = 0;
635  pastix->inter_node_comm = pastix->pastix_comm;
636  pastix->inter_node_procnbr = pastix->procnbr;
637  pastix->inter_node_procnum = pastix->procnum;
638  }
639 
640  assert( pastix->inter_node_procnbr * pastix->intra_node_procnbr == pastix->procnbr );
641  (void)autosplit;
642  (void)comm;
643 }
644 
645 /**
646  *******************************************************************************
647  *
648  * @ingroup pastix_api
649  *
650  * @brief Initialize the solver instance with a bintab array to specify the
651  * thread binding.
652  *
653  * @remark You should always prefer the pastixInit() function when hwloc is
654  * available, and use the pastixInitWithAffinity() function only if you know
655  * what you want to do with your threads.
656  *
657  *******************************************************************************
658  *
659  * @param[inout] pastix_data
660  * The main data structure.
661  *
662  * @param[in] pastix_comm
663  * The MPI communicator.
664  *
665  * @param[inout] iparm
666  * The integer array of parameters to initialize.
667  *
668  * @param[inout] dparm
669  * The floating point array of parameters to initialize.
670  *
671  * @param[in] bindtab
672  * Integer array of size iparm[IPARM_THREAD_NBR] that will specify the
673  * thread binding. NULL if let to the system.
674  * Each thread i will be bound to to the core bindtab[i] if
675  * bindtab[i] >= 0, or not bound if bindtab[i] < 0.
676  * If other libraries of the main application are spawning their own threads
677  * too (eg. OpenMP), we strongly recommend not to bind the main thread,
678  * and let bindtab[0] = -1 to avoid binding impact on other libraries.
679  *
680  *******************************************************************************/
681 void
682 pastixInitWithAffinity( pastix_data_t **pastix_data,
683  PASTIX_Comm pastix_comm,
684  pastix_int_t *iparm,
685  double *dparm,
686  const int *bindtab )
687 {
688  pastix_data_t *pastix;
689 
690  /*
691  * Allocate pastix_data structure when we enter PaStiX for the first time.
692  */
693  MALLOC_INTERN(pastix, 1, pastix_data_t);
694  memset( pastix, 0, sizeof(pastix_data_t) );
695 
696  /*
697  * Initialize iparm/dparm vectors and set them to default values if not set
698  * by the user.
699  */
700  if ( iparm[IPARM_MODIFY_PARAMETER] == 0 ) {
701  pastixInitParam( iparm, dparm );
702  }
703 
704  /*
705  * Check if MPI is initialized
706  */
707 #if defined(PASTIX_WITH_MPI)
708  {
709  int provided = MPI_THREAD_SINGLE;
710  int flag = 0;
711 
712  pastix_atomic_lock( &pastix_mpi_lock );
713  pastix_mpi_in_use++;
714 
715  MPI_Initialized(&flag);
716  if ( !flag ) {
717  MPI_Init_thread( NULL, NULL, MPI_THREAD_MULTIPLE, &provided );
718  pastix_mpi_init = 1;
719  }
720  else {
721  MPI_Query_thread( &provided );
722  }
723 
724  switch ( provided ) {
725  case MPI_THREAD_MULTIPLE:
727  break;
728  case MPI_THREAD_SERIALIZED:
730  break;
731  case MPI_THREAD_FUNNELED:
733  break;
734  case MPI_THREAD_SINGLE:
736  break;
737  default:
739  }
740  pastix_atomic_unlock( &pastix_mpi_lock );
741  }
742 #endif
743 
744  /*
745  * TODO : Replace this id by a list of ids to know
746  * which sub-problem this instance represents.
747  */
748  pastix->id = 953833;
749  pastix->iparm = iparm;
750  pastix->dparm = dparm;
751 
752  pastix->steps = 0;
753  pastix->sched = PastixSchedDynamic;
754 
755  pastix->isched = NULL;
756 #if defined(PASTIX_WITH_PARSEC)
757  pastix->parsec = NULL;
758 #endif
759 #if defined(PASTIX_WITH_STARPU)
760  pastix->starpu = NULL;
761 #endif
762 
763  apiInitMPI( pastix, pastix_comm, iparm[IPARM_AUTOSPLIT_COMM] );
764 
765  if ( (pastix->intra_node_procnbr > 1) &&
766  (pastix->iparm[IPARM_THREAD_NBR] != -1 ) ) {
767  pastix_print( pastix->procnum, 0,
768  "WARNING: Thread number forced by MPI autosplit feature\n" );
769  iparm[IPARM_THREAD_NBR] = pastix->intra_node_procnbr;
770  }
771 
772 #if defined(PASTIX_GENERATE_MODEL)
773  pastix_print( pastix->procnum, 0,
774  "WARNING: PaStiX compiled with -DPASTIX_GENERATE_MODEL forces single thread computations\n" );
775  iparm[IPARM_THREAD_NBR] = 1;
776 #endif
777 
778  /*
779  * Start the internal threads
780  */
781  pastix->isched = ischedInit( pastix->iparm[IPARM_THREAD_NBR], bindtab );
782  pastix->iparm[IPARM_THREAD_NBR] = pastix->isched->world_size;
783 
784  /*
785  * Start PaRSEC if compiled with it and scheduler set to PaRSEC
786  */
787 #if defined(PASTIX_WITH_PARSEC)
788  if ( (pastix->parsec == NULL) &&
789  (iparm[IPARM_SCHEDULER] == PastixSchedParsec) ) {
790  int argc = 0;
791  pastix_parsec_init( pastix, &argc, NULL, bindtab );
792  }
793 #endif /* defined(PASTIX_WITH_PARSEC) */
794 
795  /*
796  * Start StarPU if compiled with it and scheduler set to StarPU
797  */
798 #if defined(PASTIX_WITH_STARPU)
799  if ( (pastix->starpu == NULL) &&
800  (iparm[IPARM_SCHEDULER] == PastixSchedStarPU) ) {
801  int argc = 0;
802  pastix_starpu_init( pastix, &argc, NULL, bindtab );
803  }
804 #endif /* defined(PASTIX_WITH_STARPU) */
805 
806  pastix->graph = NULL;
807  pastix->schur_n = 0;
808  pastix->schur_list = NULL;
809  pastix->zeros_n = 0;
810  pastix->zeros_list = NULL;
811  pastix->ordemesh = NULL;
812 
813  pastix->symbmtx = NULL;
814 
815  pastix->bcsc = NULL;
816  pastix->solvmatr = NULL;
817 
818  pastix->cpu_models = NULL;
819  pastix->gpu_models = NULL;
820 
821  pastix->dir_global = NULL;
822  pastix->dir_local = NULL;
823 
825 
826  if (iparm[IPARM_VERBOSE] > PastixVerboseNot) {
828  }
829 
830  /* Initialization step done, overwrite anything done before */
831  pastix->steps = STEP_INIT;
832 
833  *pastix_data = pastix;
834 }
835 
836 /**
837  *******************************************************************************
838  *
839  * @ingroup pastix_api
840  *
841  * @brief Initialize the solver instance
842  *
843  *******************************************************************************
844  *
845  * @param[inout] pastix_data
846  * The main data structure.
847  *
848  * @param[in] pastix_comm
849  * The MPI communicator.
850  *
851  * @param[inout] iparm
852  * The integer array of parameters to initialize.
853  *
854  * @param[inout] dparm
855  * The floating point array of parameters to initialize.
856  *
857  *******************************************************************************/
858 void
859 pastixInit( pastix_data_t **pastix_data,
860  PASTIX_Comm pastix_comm,
861  pastix_int_t *iparm,
862  double *dparm )
863 {
864  pastixInitWithAffinity( pastix_data, pastix_comm,
865  iparm, dparm, NULL );
866 }
867 
868 /**
869  *******************************************************************************
870  *
871  * @ingroup pastix_api
872  *
873  * @brief Finalize the solver instance
874  *
875  *******************************************************************************
876  *
877  * @param[inout] pastix_data
878  * The main data structure.
879  *
880  *******************************************************************************/
881 void
882 pastixFinalize( pastix_data_t **pastix_data )
883 {
884  pastix_data_t *pastix = *pastix_data;
885 
886  pastixSummary( *pastix_data );
887 
888  ischedFinalize( pastix->isched );
889 
890  if ( pastix->graph != NULL )
891  {
892  graphExit( pastix->graph );
893  memFree_null( pastix->graph );
894  }
895 
896  if ( pastix->ordemesh != NULL )
897  {
898  pastixOrderExit( pastix->ordemesh );
899  memFree_null( pastix->ordemesh );
900  }
901 
902  if ( pastix->symbmtx != NULL )
903  {
904  pastixSymbolExit( pastix->symbmtx );
905  memFree_null( pastix->symbmtx );
906  }
907 
908  if ( pastix->solvloc != NULL )
909  {
910  solverExit( pastix->solvloc );
911  memFree_null( pastix->solvloc );
912  }
913 
914  if ( pastix->solvglob != NULL )
915  {
916  solverExit( pastix->solvglob );
917  memFree_null( pastix->solvglob );
918  }
919 
920  if ( pastix->solvmatr != NULL )
921  {
922  pastix->solvmatr = NULL;
923  }
924 
925  if ( pastix->bcsc != NULL )
926  {
927  bcscExit( pastix->bcsc );
928  memFree_null( pastix->bcsc );
929  }
930 
931  if (pastix->schur_list != NULL )
932  {
933  memFree_null( pastix->schur_list );
934  }
935 #if defined(PASTIX_WITH_PARSEC)
936  if (pastix->parsec != NULL) {
938  }
939 #endif /* defined(PASTIX_WITH_PARSEC) */
940 #if defined(PASTIX_WITH_STARPU)
941  if (pastix->starpu != NULL) {
943  }
944 #endif /* defined(PASTIX_WITH_STARPU) */
945 
946 #if defined(PASTIX_WITH_MPI)
947  pastix_atomic_lock( &pastix_mpi_lock );
948  pastix_mpi_in_use--;
949  if ( (pastix_mpi_in_use == 0) && pastix_mpi_init ) {
950  MPI_Finalize();
951  }
952  pastix_atomic_unlock( &pastix_mpi_lock );
953 #endif
954 
955  if ( pastix->cpu_models != NULL ) {
956  pastixModelsFree( pastix->cpu_models );
957  pastix->cpu_models = NULL;
958  }
959  if ( pastix->gpu_models != NULL ) {
960  pastixModelsFree( pastix->gpu_models );
961  pastix->gpu_models = NULL;
962  }
963 
964  if ( pastix->dir_global != NULL ) {
965  free( pastix->dir_global );
966  }
967  if ( pastix->dir_local != NULL ) {
968  free( pastix->dir_local );
969  }
970  memFree_null(*pastix_data);
971 }
972 
973 /**
974  *******************************************************************************
975  *
976  * @ingroup pastix_api
977  *
978  * @brief Dump the iparm and dparm parameters in a CSV file.
979  *
980  *******************************************************************************
981  *
982  * @param[inout] pastix_data
983  * The main data structure.
984  *
985  *******************************************************************************/
986 void
987 pastixDumpParam( const pastix_data_t *pastix_data )
988 {
989  FILE *csv = NULL;
990  char *fullname = NULL;
991  int rc;
992  int32_t lidx;
993  static volatile int32_t id = 0;
994 
995  if( pastix_data->inter_node_procnum != 0 ) {
996  return;
997  }
998 
999  lidx = pastix_atomic_add_32b( &id, 1 );
1000  rc = asprintf( &fullname, "idparam_%d.csv", lidx );
1001 
1002  if ( rc <= 0 ) {
1003  pastix_print_error( "pastixDumpParam: Couldn't not generate the filename for the output file" );
1004  return;
1005  }
1006 
1007  csv = pastix_fopenw( pastix_data->dir_global, fullname, "w" );
1008  pastix_param2csv( pastix_data, csv );
1009 
1010  fclose(csv);
1011  free(fullname);
1012 }
1013 
1014 /**
1015  *******************************************************************************
1016  *
1017  * @ingroup pastix_api
1018  *
1019  * @brief Check the values of iparm and dparm arrays.
1020  *
1021  *******************************************************************************
1022  *
1023  * @param[in] iparm
1024  * The iparm options array. Can be NULL.
1025  *
1026  * @param[in] dparm
1027  * The dparm options array. Can be NULL.
1028  *
1029  *******************************************************************************
1030  *
1031  * @return The amount of iparm/dparm with an incorrect value.
1032  *
1033  *******************************************************************************/
1034 int
1035 pastixCheckParam( const pastix_int_t *iparm,
1036  const double *dparm )
1037 {
1038  int irc = 0;
1039  int drc = 0;
1040 
1041  if ( iparm != NULL ) {
1042  irc = iparm_check_values( iparm );
1043  }
1044  if ( dparm != NULL ) {
1045  drc = dparm_check_values( dparm );
1046  }
1047 
1048  return irc + drc;
1049 }
IPARM_METIS_SEED
@ IPARM_METIS_SEED
Definition: api.h:70
solver.h
pastix_parsec_finalize
void pastix_parsec_finalize(pastix_data_t *pastix)
Finalize the PaRSEC runtime system.
Definition: parsec.c:176
pastix_starpu_finalize
void pastix_starpu_finalize(pastix_data_t *pastix)
Finalize the StarPU runtime system.
Definition: starpu.c:227
IPARM_NBITER
@ IPARM_NBITER
Definition: api.h:111
IPARM_ITERMAX
@ IPARM_ITERMAX
Definition: api.h:112
DPARM_FACT_FLOPS
@ DPARM_FACT_FLOPS
Definition: api.h:164
IPARM_TRACE
@ IPARM_TRACE
Definition: api.h:44
DPARM_COMPRESS_TOLERANCE
@ DPARM_COMPRESS_TOLERANCE
Definition: api.h:175
IPARM_SCHUR_SOLV_MODE
@ IPARM_SCHUR_SOLV_MODE
Definition: api.h:106
IPARM_SCOTCH_CMIN
@ IPARM_SCOTCH_CMIN
Definition: api.h:56
IPARM_ORDERING
@ IPARM_ORDERING
Definition: api.h:50
PastixCompressOrthoQR
@ PastixCompressOrthoQR
Definition: api.h:387
IPARM_METIS_COMPRESS
@ IPARM_METIS_COMPRESS
Definition: api.h:67
IPARM_ORDERING_DEFAULT
@ IPARM_ORDERING_DEFAULT
Definition: api.h:51
IPARM_MAX_BLOCKSIZE
@ IPARM_MAX_BLOCKSIZE
Definition: api.h:89
IPARM_MPI_THREAD_LEVEL
@ IPARM_MPI_THREAD_LEVEL
Definition: api.h:136
pastixSymbolExit
void pastixSymbolExit(symbol_matrix_t *symbptr)
Free the content of symbolic matrix.
Definition: symbol.c:140
bcscExit
void bcscExit(pastix_bcsc_t *bcsc)
Cleanup the block csc structure but do not free the bcsc pointer.
Definition: bcsc.c:414
DPARM_EPSILON_REFINEMENT
@ DPARM_EPSILON_REFINEMENT
Definition: api.h:154
pastixOrderExit
void pastixOrderExit(pastix_order_t *ordeptr)
Free the arrays initialized in the order structure.
Definition: order.c:273
DPARM_MEM_FR
@ DPARM_MEM_FR
Definition: api.h:167
PastixSplitKway
@ PastixSplitKway
Definition: api.h:396
IPARM_LEVEL_OF_FILL
@ IPARM_LEVEL_OF_FILL
Definition: api.h:96
IPARM_COMPRESS_RELTOL
@ IPARM_COMPRESS_RELTOL
Definition: api.h:131
IPARM_SPLITTING_PROJECTIONS_DEPTH
@ IPARM_SPLITTING_PROJECTIONS_DEPTH
Definition: api.h:83
IPARM_METIS_PFACTOR
@ IPARM_METIS_PFACTOR
Definition: api.h:69
pastix_gendirectories
void pastix_gendirectories(pastix_data_t *pastix_data)
Generate a unique temporary directory to store output files.
Definition: api.c:69
DPARM_REFINE_TIME
@ DPARM_REFINE_TIME
Definition: api.h:173
compmeth_shnames
const char * compmeth_shnames[PastixCompressMethodNbr]
List of short names for the compression kernels.
Definition: lowrank.c:27
pastix_parsec.h
IPARM_MC64
@ IPARM_MC64
Definition: api.h:47
IPARM_GPU_MEMORY_PERCENTAGE
@ IPARM_GPU_MEMORY_PERCENTAGE
Definition: api.h:122
IPARM_SCOTCH_SWITCH_LEVEL
@ IPARM_SCOTCH_SWITCH_LEVEL
Definition: api.h:55
IPARM_STATIC_PIVOTING
@ IPARM_STATIC_PIVOTING
Definition: api.h:100
IPARM_NNZEROS_BLOCK_LOCAL
@ IPARM_NNZEROS_BLOCK_LOCAL
Definition: api.h:41
IPARM_ALLCAND
@ IPARM_ALLCAND
Definition: api.h:92
PastixCompressMethodPQRCP
@ PastixCompressMethodPQRCP
Definition: api.h:375
IPARM_COMPRESS_ORTHO
@ IPARM_COMPRESS_ORTHO
Definition: api.h:130
PastixCompressNever
@ PastixCompressNever
Definition: api.h:364
IPARM_TASKS2D_WIDTH
@ IPARM_TASKS2D_WIDTH
Definition: api.h:91
IPARM_PRODUCE_STATS
@ IPARM_PRODUCE_STATS
Definition: api.h:43
PastixCompressOrthoCGS
@ PastixCompressOrthoCGS
Definition: api.h:386
DPARM_A_NORM
@ DPARM_A_NORM
Definition: api.h:174
IPARM_COMPRESS_MIN_HEIGHT
@ IPARM_COMPRESS_MIN_HEIGHT
Definition: api.h:127
DPARM_MEM_LR
@ DPARM_MEM_LR
Definition: api.h:168
pastixSummary
void pastixSummary(const pastix_data_t *pastix)
Print summary information.
Definition: api.c:376
PastixOrderMetis
@ PastixOrderMetis
Definition: api.h:325
IPARM_SCOTCH_CMAX
@ IPARM_SCOTCH_CMAX
Definition: api.h:57
PastixMpiNone
@ PastixMpiNone
Definition: api.h:335
PastixNoTrans
@ PastixNoTrans
Definition: api.h:424
IPARM_NNZEROS
@ IPARM_NNZEROS
Definition: api.h:40
IPARM_GPU_MEMORY_BLOCK_SIZE
@ IPARM_GPU_MEMORY_BLOCK_SIZE
Definition: api.h:123
IPARM_SCOTCH_FRAT
@ IPARM_SCOTCH_FRAT
Definition: api.h:58
DPARM_PRED_FACT_TIME
@ DPARM_PRED_FACT_TIME
Definition: api.h:162
IPARM_COMPRESS_METHOD
@ IPARM_COMPRESS_METHOD
Definition: api.h:129
pastixCheckParam
int pastixCheckParam(const pastix_int_t *iparm, const double *dparm)
Check the values of iparm and dparm arrays.
Definition: api.c:1035
IPARM_SCHEDULER
@ IPARM_SCHEDULER
Definition: api.h:116
IPARM_THREAD_NBR
@ IPARM_THREAD_NBR
Definition: api.h:117
DPARM_FACT_THFLOPS
@ DPARM_FACT_THFLOPS
Definition: api.h:165
IPARM_AMALGAMATION_LVLCBLK
@ IPARM_AMALGAMATION_LVLCBLK
Definition: api.h:75
IPARM_METIS_UFACTOR
@ IPARM_METIS_UFACTOR
Definition: api.h:66
pastixModelsFree
void pastixModelsFree(pastix_model_t *model)
Free a model data structure.
Definition: models.c:520
DPARM_SOLV_THFLOPS
@ DPARM_SOLV_THFLOPS
Definition: api.h:171
bcsc.h
PastixSchedParsec
@ PastixSchedParsec
Definition: api.h:315
IPARM_MIN_BLOCKSIZE
@ IPARM_MIN_BLOCKSIZE
Definition: api.h:88
DPARM_RELATIVE_ERROR
@ DPARM_RELATIVE_ERROR
Definition: api.h:155
PastixCompressWhenBegin
@ PastixCompressWhenBegin
Definition: api.h:365
PastixMpiThreadFunneled
@ PastixMpiThreadFunneled
Definition: api.h:337
pastixWelcome
void pastixWelcome(const pastix_data_t *pastix)
Print information about the solver configuration.
Definition: api.c:308
IPARM_COMPRESS_MIN_WIDTH
@ IPARM_COMPRESS_MIN_WIDTH
Definition: api.h:126
IPARM_SPLITTING_STRATEGY
@ IPARM_SPLITTING_STRATEGY
Definition: api.h:80
pastix_starpu_init
void pastix_starpu_init(pastix_data_t *pastix, int *argc, char **argv[], const int *bindtab)
Startup the StarPU runtime system.
Definition: starpu.c:92
PastixVerboseNot
@ PastixVerboseNot
Definition: api.h:209
IPARM_TRANSPOSE_SOLVE
@ IPARM_TRANSPOSE_SOLVE
Definition: api.h:105
DPARM_FILL_IN
@ DPARM_FILL_IN
Definition: api.h:153
apiInitMPI
static void apiInitMPI(pastix_data_t *pastix, PASTIX_Comm comm, int autosplit)
Internal function that setups the multiple communicators in order to perform the ordering step in MPI...
Definition: api.c:579
PastixVerboseNo
@ PastixVerboseNo
Definition: api.h:210
pastix_fopenw
FILE * pastix_fopenw(const char *dirname, const char *filename, const char *mode)
Open a file in the unique directory of the pastix instance.
Definition: api.c:232
IPARM_REORDERING_STOP
@ IPARM_REORDERING_STOP
Definition: api.h:79
DPARM_SOLV_RLFLOPS
@ DPARM_SOLV_RLFLOPS
Definition: api.h:172
IPARM_COMPRESS_WHEN
@ IPARM_COMPRESS_WHEN
Definition: api.h:128
PastixRefineGMRES
@ PastixRefineGMRES
Definition: api.h:266
IPARM_APPLYPERM_WS
@ IPARM_APPLYPERM_WS
Definition: api.h:107
solverExit
void solverExit(SolverMatrix *solvmtx)
Free the content of the solver matrix structure.
Definition: solver.c:143
PastixMpiThreadMultiple
@ PastixMpiThreadMultiple
Definition: api.h:339
IPARM_MTX_TYPE
@ IPARM_MTX_TYPE
Definition: api.h:143
IPARM_METIS_DBGLVL
@ IPARM_METIS_DBGLVL
Definition: api.h:71
IPARM_SPLITTING_LEVELS_PROJECTIONS
@ IPARM_SPLITTING_LEVELS_PROJECTIONS
Definition: api.h:81
pastixInit
void pastixInit(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, pastix_int_t *iparm, double *dparm)
Initialize the solver instance.
Definition: api.c:859
IPARM_FREE_CSCUSER
@ IPARM_FREE_CSCUSER
Definition: api.h:101
IPARM_END_TASK
@ IPARM_END_TASK
Definition: api.h:141
pastixInitWithAffinity
void pastixInitWithAffinity(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, pastix_int_t *iparm, double *dparm, const int *bindtab)
Initialize the solver instance with a bintab array to specify the thread binding.
Definition: api.c:682
IPARM_FLOAT
@ IPARM_FLOAT
Definition: api.h:142
DPARM_FACT_TIME
@ DPARM_FACT_TIME
Definition: api.h:163
DPARM_COMPRESS_MIN_RATIO
@ DPARM_COMPRESS_MIN_RATIO
Definition: api.h:176
IPARM_SCHUR_FACT_MODE
@ IPARM_SCHUR_FACT_MODE
Definition: api.h:102
IPARM_METIS_RTYPE
@ IPARM_METIS_RTYPE
Definition: api.h:62
IPARM_COMPRESS_ILUK
@ IPARM_COMPRESS_ILUK
Definition: api.h:133
DPARM_SOLV_FLOPS
@ DPARM_SOLV_FLOPS
Definition: api.h:170
IPARM_GPU_NBR
@ IPARM_GPU_NBR
Definition: api.h:121
graph.h
PastixTaskClean
@ PastixTaskClean
Definition: api.h:194
pastixDumpParam
void pastixDumpParam(const pastix_data_t *pastix_data)
Dump the iparm and dparm parameters in a CSV file.
Definition: api.c:987
IPARM_AMALGAMATION_LVLBLAS
@ IPARM_AMALGAMATION_LVLBLAS
Definition: api.h:74
IPARM_MODIFY_PARAMETER
@ IPARM_MODIFY_PARAMETER
Definition: api.h:139
DPARM_SOLV_TIME
@ DPARM_SOLV_TIME
Definition: api.h:169
IPARM_ALLOCATED_TERMS
@ IPARM_ALLOCATED_TERMS
Definition: api.h:42
IPARM_SPLITTING_PROJECTIONS_WIDTH
@ IPARM_SPLITTING_PROJECTIONS_WIDTH
Definition: api.h:85
PastixTaskOrdering
@ PastixTaskOrdering
Definition: api.h:188
IPARM_SPLITTING_PROJECTIONS_DISTANCE
@ IPARM_SPLITTING_PROJECTIONS_DISTANCE
Definition: api.h:84
pastix_starpu.h
pastix
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.
Definition: pastix.c:103
IPARM_VERBOSE
@ IPARM_VERBOSE
Definition: api.h:36
PastixIONo
@ PastixIONo
Definition: api.h:218
PastixFactLU
@ PastixFactLU
Definition: api.h:304
PastixMpiThreadSerialized
@ PastixMpiThreadSerialized
Definition: api.h:338
IPARM_SPLITTING_LEVELS_KWAY
@ IPARM_SPLITTING_LEVELS_KWAY
Definition: api.h:82
DPARM_ANALYZE_TIME
@ DPARM_ANALYZE_TIME
Definition: api.h:161
order.h
IPARM_METIS_NO2HOP
@ IPARM_METIS_NO2HOP
Definition: api.h:63
IPARM_START_TASK
@ IPARM_START_TASK
Definition: api.h:140
pastixInitParam
void pastixInitParam(pastix_int_t *iparm, double *dparm)
Initialize the iparm and dparm arrays to their default values.
Definition: api.c:401
PastixMpiThreadSingle
@ PastixMpiThreadSingle
Definition: api.h:336
IPARM_GMRES_IM
@ IPARM_GMRES_IM
Definition: api.h:113
PastixSplitNot
@ PastixSplitNot
Definition: api.h:395
PastixOrderScotch
@ PastixOrderScotch
Definition: api.h:324
pastix_fname
char * pastix_fname(const char *dirname, const char *filename)
Generate the full filename within local or global directory.
Definition: api.c:189
IPARM_INCOMPLETE
@ IPARM_INCOMPLETE
Definition: api.h:95
IPARM_METIS_CCORDER
@ IPARM_METIS_CCORDER
Definition: api.h:68
IPARM_TASKS2D_LEVEL
@ IPARM_TASKS2D_LEVEL
Definition: api.h:90
IPARM_DOF_NBR
@ IPARM_DOF_NBR
Definition: api.h:144
IPARM_METIS_NSEPS
@ IPARM_METIS_NSEPS
Definition: api.h:64
DPARM_FACT_RLFLOPS
@ DPARM_FACT_RLFLOPS
Definition: api.h:166
IPARM_REORDERING_SPLIT
@ IPARM_REORDERING_SPLIT
Definition: api.h:78
pastix_parsec_init
void pastix_parsec_init(pastix_data_t *pastix, int *argc, char **argv[], const int *bindtab)
Startup the PaRSEC runtime system.
Definition: parsec.c:59
IPARM_METIS_CTYPE
@ IPARM_METIS_CTYPE
Definition: api.h:61
pastixFinalize
void pastixFinalize(pastix_data_t **pastix_data)
Finalize the solver instance.
Definition: api.c:882
IPARM_METIS_NITER
@ IPARM_METIS_NITER
Definition: api.h:65
DPARM_EPSILON_MAGN_CTRL
@ DPARM_EPSILON_MAGN_CTRL
Definition: api.h:156
graphExit
void graphExit(pastix_graph_t *graph)
Free the content of the graph structure.
Definition: graph.c:71
PastixSchedStarPU
@ PastixSchedStarPU
Definition: api.h:316
IPARM_IO_STRATEGY
@ IPARM_IO_STRATEGY
Definition: api.h:37
pastix_fopen
FILE * pastix_fopen(const char *filename)
Open a file in the current directory in read only mode.
Definition: api.c:279
IPARM_AUTOSPLIT_COMM
@ IPARM_AUTOSPLIT_COMM
Definition: api.h:118
IPARM_REFINEMENT
@ IPARM_REFINEMENT
Definition: api.h:110
IPARM_SCOTCH_MT
@ IPARM_SCOTCH_MT
Definition: api.h:54
IPARM_FACTORIZATION
@ IPARM_FACTORIZATION
Definition: api.h:99
PastixSchedDynamic
@ PastixSchedDynamic
Definition: api.h:317
IPARM_COMPRESS_PRESELECT
@ IPARM_COMPRESS_PRESELECT
Definition: api.h:132
pastixModelsLoad
void pastixModelsLoad(pastix_data_t *pastix_data)
Load the performance models that will be used by the solver.
Definition: models.c:549