Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
31152b0f
Commit
31152b0f
authored
3 months ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Add access and setting pgs functions for partitioner library
parent
3b98e735
No related branches found
No related tags found
1 merge request
!202
Prepare PTScotch integration
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/language/modules/CoreModule.cpp
+22
-0
22 additions, 0 deletions
src/language/modules/CoreModule.cpp
src/utils/PartitionerOptions.hpp
+14
-0
14 additions, 0 deletions
src/utils/PartitionerOptions.hpp
with
36 additions
and
0 deletions
src/language/modules/CoreModule.cpp
+
22
−
0
View file @
31152b0f
...
...
@@ -32,6 +32,7 @@
#include
<language/utils/UnaryOperatorRegisterForRnxn.hpp>
#include
<language/utils/UnaryOperatorRegisterForZ.hpp>
#include
<utils/Messenger.hpp>
#include
<utils/PartitionerOptions.hpp>
#include
<utils/PugsUtils.hpp>
#include
<utils/RandomEngine.hpp>
#include
<utils/Stop.hpp>
...
...
@@ -94,6 +95,27 @@ CoreModule::CoreModule() : BuiltinModule(true)
));
this
->
_addBuiltinFunction
(
"setPartitionerLibrary"
,
std
::
function
(
[](
const
std
::
string
&
library_name
)
->
void
{
PartitionerOptions
::
default_options
.
library
()
=
getPartitionerEnumFromName
<
PartitionerLibrary
>
(
library_name
);
}
));
this
->
_addBuiltinFunction
(
"getPartitionerOptions"
,
std
::
function
(
[]()
->
std
::
string
{
std
::
ostringstream
os
;
os
<<
rang
::
fgB
::
yellow
<<
"Partitioner options"
<<
rang
::
style
::
reset
<<
'\n'
;
os
<<
PartitionerOptions
::
default_options
;
return
os
.
str
();
}
));
this
->
_addTypeDescriptor
(
ast_node_data_type_from
<
std
::
shared_ptr
<
const
OStream
>>
);
this
->
_addBuiltinFunction
(
"ofstream"
,
std
::
function
(
...
...
This diff is collapsed.
Click to expand it.
src/utils/PartitionerOptions.hpp
+
14
−
0
View file @
31152b0f
...
...
@@ -32,6 +32,20 @@ name(const PartitionerLibrary library)
throw
UnexpectedError
(
"Linear system library name is not defined!"
);
}
template
<
typename
PartitionerEnumType
>
inline
PartitionerEnumType
getPartitionerEnumFromName
(
const
std
::
string
&
enum_name
)
{
using
BaseT
=
std
::
underlying_type_t
<
PartitionerEnumType
>
;
for
(
BaseT
enum_value
=
static_cast
<
BaseT
>
(
PartitionerEnumType
::
PT__begin
);
enum_value
<
static_cast
<
BaseT
>
(
PartitionerEnumType
::
PT__end
);
++
enum_value
)
{
if
(
name
(
PartitionerEnumType
{
enum_value
})
==
enum_name
)
{
return
PartitionerEnumType
{
enum_value
};
}
}
throw
NormalError
(
std
::
string
{
"could not find '"
}
+
enum_name
+
"' associate type!"
);
}
class
PartitionerOptions
{
private:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment