Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amdis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
iwr
amdis
Commits
54f26135
Commit
54f26135
authored
Jul 28, 2013
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
old Pluginsystem removed
parent
dd622fda
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
152 deletions
+0
-152
AMDiS/plugins/CMakeLists.txt
AMDiS/plugins/CMakeLists.txt
+0
-15
AMDiS/plugins/src/PluginProvider.h
AMDiS/plugins/src/PluginProvider.h
+0
-73
AMDiS/plugins/src/umfpack.cpp
AMDiS/plugins/src/umfpack.cpp
+0
-9
AMDiS/plugins/src/use.cpp
AMDiS/plugins/src/use.cpp
+0
-55
No files found.
AMDiS/plugins/CMakeLists.txt
deleted
100644 → 0
View file @
dd622fda
project
(
amdis-plugins
)
cmake_minimum_required
(
VERSION 2.8
)
include_directories
(
../src/ ../lib/mtl4/ ../lib/UMFPACK/Include ../lib/AMD/Include ../lib/UFconfig/
)
link_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../
${
CMAKE_CURRENT_SOURCE_DIR
}
/../lib/UMFPACK/Lib/
${
CMAKE_CURRENT_SOURCE_DIR
}
/../lib/AMD/Lib/
)
add_library
(
amdis-umfpack SHARED src/umfpack.cpp
)
target_link_libraries
(
amdis-umfpack umfpack amd blas
)
add_executable
(
use src/use.cpp
)
target_link_libraries
(
use dl amdis boost_iostreams boost_system
)
#amdis was compiled with openmp -> needed openmp for the application also.
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fopenmp"
)
AMDiS/plugins/src/PluginProvider.h
deleted
100644 → 0
View file @
dd622fda
#ifndef PLUGINPROVER_H
#define PLUGINPROVER_H
#include "dlfcn.h"
#include <string>
using
namespace
std
;
namespace
AMDiS
{
template
<
typename
DesiredCreator
>
struct
PluginProvider
{
typedef
DesiredCreator
*
Creator
();
typedef
void
Remover
(
DesiredCreator
*
);
string
createName
;
string
removeName
;
Remover
*
remover
;
PluginProvider
(
string
c
,
string
r
)
:
createName
(
c
),
removeName
(
r
),
remover
(
NULL
)
{}
enum
Error
{
NOLIBRARY
,
NOCREATOR
,
NOREMOVER
};
struct
Exception
{
Error
e
;
string
message
;
Exception
(
Error
e
,
string
m
)
:
e
(
e
),
message
(
m
)
{}
};
DesiredCreator
*
create
(
string
libname
)
{
void
*
library
=
dlopen
(
libname
.
c_str
(),
RTLD_LAZY
);
if
(
library
==
NULL
)
{
throw
Exception
(
NOLIBRARY
,
dlerror
());
}
dlerror
();
Creator
*
creator
=
(
Creator
*
)
(
dlsym
(
library
,
createName
.
c_str
()));
if
(
creator
==
NULL
)
{
throw
Exception
(
NOCREATOR
,
dlerror
());
}
remover
=
(
Remover
*
)
(
dlsym
(
library
,
removeName
.
c_str
()));
if
(
remover
==
NULL
)
{
throw
Exception
(
NOREMOVER
,
dlerror
());
}
DesiredCreator
*
creatingCreator
=
creator
();
return
creatingCreator
;
}
void
remove
(
DesiredCreator
*
dc
)
{
if
(
remover
==
NULL
)
{
throw
Exception
(
NOREMOVER
,
"the remover was not set
\n
"
);
}
remover
(
dc
);
}
};
//typedef OEMSolverCreator* createSolverCreator();
//typedef void removeSolverCreator(OEMSolverCreator*);
struct
SolverPluginProvider
:
PluginProvider
<
OEMSolverCreator
>
{
SolverPluginProvider
()
:
PluginProvider
<
OEMSolverCreator
>
(
"createSolverCreator"
,
"removeSolverCreator"
)
{}
};
}
#endif
AMDiS/plugins/src/umfpack.cpp
deleted
100644 → 0
View file @
dd622fda
#define HAVE_UMFPACK
#define MTL_HAS_UMFPACK
#include "AMDiS.h"
#include "UmfPackSolver.h"
using
namespace
AMDiS
;
extern
"C"
OEMSolverCreator
*
createSolverCreator
()
{
return
new
UmfPackSolver
::
Creator
();
}
extern
"C"
void
removeSolverCreator
(
OEMSolverCreator
*
p
)
{
delete
p
;
}
AMDiS/plugins/src/use.cpp
deleted
100644 → 0
View file @
dd622fda
#include "AMDiS.h"
#include "dlfcn.h"
#include "PluginProvider.h"
#include <iostream>
using
namespace
AMDiS
;
using
namespace
std
;
//typedef OEMSolverCreator* Creator();
//typedef void Remover(OEMSolverCreator*);
int
main
(
int
argc
,
char
**
argv
)
{
/* void* umfpackLib=dlopen("./libamdis-umfpack.so", RTLD_LAZY);
if (!umfpackLib) {
cerr << "Cannot load library: " << dlerror() << '\n';
return 1;
}
dlerror();
Creator* creator=(Creator*) (dlsym(umfpackLib, "createSolverCreator"));
if(creator == NULL) {
cerr << "could not load the create function in libumfpack.so \n";
return 2;
}
Remover* remover=(Remover* )(dlsym(umfpackLib, "removeSolverCreator"));
if( remover == NULL) {
cerr << "could not load the remove function in libumfpack.so \n";
return 3;
}
OEMSolverCreator* theCreator=creator();
*/
SolverPluginProvider
spp
;
OEMSolver
*
theSolver
(
NULL
);
try
{
OEMSolverCreator
*
theCreator
=
spp
.
create
(
"./libamdis-umfpack.so"
);
theCreator
->
setName
(
"umfpack"
);
theSolver
=
theCreator
->
create
();
// remover(theCreator);
spp
.
remove
(
theCreator
);
}
catch
(
SolverPluginProvider
::
Exception
e
)
{
std
::
cerr
<<
"could not load the umfpack solver: "
<<
e
.
message
<<
"
\n
"
;
return
1
;
}
mtl
::
matrix
::
compressed2D
<
double
>
testMatrix
(
10
,
10
);
mtl
::
matrix
::
diagonal_setup
(
testMatrix
,
5.0
);
mtl
::
vector
::
dense_vector
<
double
>
b
(
10
);
b
=
4.0
;
mtl
::
vector
::
dense_vector
<
double
>
x
(
10
);
x
=
0.0
;
theSolver
->
solveSystem
(
testMatrix
,
x
,
b
);
delete
theSolver
;
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment