MyraMath
Options.h
Go to the documentation of this file.
1 // ========================================================================= //
2 // This file is part of MyraMath, copyright (c) 2014-2019 by Ryan A Chilton //
3 // and distributed by MyraCore, LLC. See LICENSE.txt for license terms. //
4 // ========================================================================= //
5 
6 #ifndef MYRAMATH_MULTIFRONTAL_OPTIONS_H
7 #define MYRAMATH_MULTIFRONTAL_OPTIONS_H
8 
14 #include <myramath/utility/detail/LIBPUBLIC.h>
15 
16 // For conversion to JOBGRAPH::Options
17 #include <myramath/jobgraph/Options.h>
19 
20 namespace myra {
21 namespace multifrontal {
22 
24 class LIBPUBLIC Options
25  {
26  public:
27 
30 
32  int nthreads;
33 
36 
38  int blocksize;
39 
41  int globsize;
42 
44  bool check;
45 
48  {
50  nthreads = maxthreads();
51  blocksize = 256;
52  globsize = 256;
53  check = true;
54  }
55 
57  static Options create()
58  { return Options(); }
59 
61  Options& set_threading_layer(int in_threading_layer)
62  { threading_layer = jobgraph::Options::sanitize(in_threading_layer); return *this; }
63 
64  Options& set_nthreads(int in_nthreads)
65  { nthreads = in_nthreads; return *this; }
66 
67  Options& set_progress(const ProgressMeter& in_progress)
68  { progress = in_progress; return *this; }
69 
70  Options& set_blocksize(int in_blocksize)
71  { blocksize = in_blocksize; return *this; }
72 
73  Options& set_globsize(int in_globsize)
74  { globsize = in_globsize; return *this; }
75 
76  Options& set_check(bool in_check)
77  { check = in_check; return *this; }
78 
80  operator ::myra::jobgraph::Options() const
81  { return ::myra::jobgraph::Options::create().set_threading_layer(threading_layer).set_nthreads(nthreads).set_progress(progress); }
82 
84  // embedded dimension of reorder()
85  // crossover point between ND and MMD within reorder()
86  // control over coarsening algorithms of Graph
87  // tolerance and iterations for refine, instead of them being defined at the call site
88 
89  };
90 
91 } // namespace multifrontal
92 } // namespace myra
93 
94 #endif
Options & set_threading_layer(int in_threading_layer)
Named constructor idiom, setters.
Definition: Options.h:61
Options pack for routines in /multifrontal.
Definition: Options.h:24
int blocksize
Desired blocksize.
Definition: Options.h:38
Options()
Constructs default Options.
Definition: Options.h:47
bool check
Enables various checks.
Definition: Options.h:44
static Options create()
Named constructor idiom, creates default options.
Definition: Options.h:57
int globsize
Desired globsize.
Definition: Options.h:41
Definition: syntax.dox:1
Interface for measuring progress via callbacks. Wraps an underlying polymorphic ProgressMeterBase.
Definition: ProgressMeter.h:55
Returns maximum number of threads, by probing the environment for MYRAMATH_NUM_THREADS.
static int default_threading_layer()
Returns one of the THREADING_LAYER constants named below.
Definition: Options.cpp:32
ProgressMeter progress
Enable progress meter?
Definition: Options.h:35
int threading_layer
Which threading_layer to use? (See JOBGRAPH::Options)
Definition: Options.h:29
int nthreads
How many threads to use?
Definition: Options.h:32