Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Dmitri Naumov
ogs
Commits
402258b5
Commit
402258b5
authored
4 years ago
by
Lars Bilke
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] Removed definition USE_MPI.
parent
99029f33
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
BaseLib/RunTime.h
+22
-23
22 additions, 23 deletions
BaseLib/RunTime.h
CMakeLists.txt
+0
-4
0 additions, 4 deletions
CMakeLists.txt
MeshLib/IO/VtkIO/VtuInterface.cpp
+16
-14
16 additions, 14 deletions
MeshLib/IO/VtkIO/VtuInterface.cpp
with
38 additions
and
41 deletions
BaseLib/RunTime.h
+
22
−
23
View file @
402258b5
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#pragma once
#pragma once
#ifdef USE_
MPI
#ifdef USE_
PETSC
#include
<mpi.h>
#include
<mpi.h>
#else
#else
#include
<chrono>
#include
<chrono>
...
@@ -22,38 +22,37 @@
...
@@ -22,38 +22,37 @@
namespace
BaseLib
namespace
BaseLib
{
{
/// Count the running time.
/// Count the running time.
class
RunTime
class
RunTime
{
{
public:
public:
/// Start the timer.
/// Start the timer.
void
start
()
void
start
()
{
{
#ifdef USE_
MPI
#ifdef USE_
PETSC
_start_time
=
MPI_Wtime
();
_start_time
=
MPI_Wtime
();
#else
#else
_start_time
=
std
::
chrono
::
system_clock
::
now
();
_start_time
=
std
::
chrono
::
system_clock
::
now
();
#endif
#endif
}
}
/// Get the elapsed time in seconds.
/// Get the elapsed time in seconds.
double
elapsed
()
const
double
elapsed
()
const
{
{
#ifdef USE_
MPI
#ifdef USE_
PETSC
return
MPI_Wtime
()
-
_start_time
;
return
MPI_Wtime
()
-
_start_time
;
#else
#else
using
namespace
std
::
chrono
;
using
namespace
std
::
chrono
;
return
duration
<
double
>
(
system_clock
::
now
()
-
_start_time
).
count
();
return
duration
<
double
>
(
system_clock
::
now
()
-
_start_time
).
count
();
#endif
#endif
}
}
private
:
private
:
#ifdef USE_
MPI
#ifdef USE_
PETSC
double
_start_time
=
std
::
numeric_limits
<
double
>::
quiet_NaN
();
double
_start_time
=
std
::
numeric_limits
<
double
>::
quiet_NaN
();
#else
#else
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
_start_time
;
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
_start_time
;
#endif
#endif
};
};
}
// end namespace BaseLib
}
// end namespace BaseLib
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
0
−
4
View file @
402258b5
...
@@ -194,10 +194,6 @@ if(OGS_USE_MKL)
...
@@ -194,10 +194,6 @@ if(OGS_USE_MKL)
include_directories
(
SYSTEM
${
MKL_INCLUDE_DIR
}
)
include_directories
(
SYSTEM
${
MKL_INCLUDE_DIR
}
)
endif
()
endif
()
if
(
OGS_USE_MPI
)
add_definitions
(
-DUSE_MPI
)
endif
()
# Eigen
# Eigen
if
(
CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
if
(
CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
add_definitions
(
-DEIGEN_INITIALIZE_MATRICES_BY_NAN
)
add_definitions
(
-DEIGEN_INITIALIZE_MATRICES_BY_NAN
)
...
...
This diff is collapsed.
Click to expand it.
MeshLib/IO/VtkIO/VtuInterface.cpp
+
16
−
14
View file @
402258b5
...
@@ -13,20 +13,20 @@
...
@@ -13,20 +13,20 @@
#include
"VtuInterface.h"
#include
"VtuInterface.h"
#include
<vtkNew.h>
#include
<vtkGenericDataObjectReader.h>
#include
<vtkGenericDataObjectReader.h>
#include
<vtkNew.h>
#include
<vtkXMLUnstructuredGridReader.h>
#include
<vtkXMLUnstructuredGridReader.h>
#include
<vtkXMLUnstructuredGridWriter.h>
#include
<vtkXMLUnstructuredGridWriter.h>
#if defined(USE_PETSC)
|| defined(USE_MPI)
#if defined(USE_PETSC)
#include
<vtkXMLPUnstructuredGridWriter.h>
#include
<vtkXMLPUnstructuredGridWriter.h>
#endif
#endif
#include
<vtkSmartPointer.h>
#include
<vtkSmartPointer.h>
#include
<vtkUnstructuredGrid.h>
#include
<vtkUnstructuredGrid.h>
#include
"BaseLib/Logging.h"
#include
<boost/algorithm/string/erase.hpp>
#include
<boost/algorithm/string/erase.hpp>
#include
"BaseLib/Logging.h"
#ifdef USE_PETSC
#ifdef USE_PETSC
#include
<petsc.h>
#include
<petsc.h>
#endif
#endif
...
@@ -40,9 +40,9 @@ namespace MeshLib
...
@@ -40,9 +40,9 @@ namespace MeshLib
{
{
namespace
IO
namespace
IO
{
{
VtuInterface
::
VtuInterface
(
const
MeshLib
::
Mesh
*
mesh
,
int
dataMode
,
VtuInterface
::
VtuInterface
(
const
MeshLib
::
Mesh
*
mesh
,
int
dataMode
,
bool
compress
)
:
bool
compress
)
_mesh
(
mesh
),
_data_mode
(
dataMode
),
_use_compressor
(
compress
)
:
_mesh
(
mesh
),
_data_mode
(
dataMode
),
_use_compressor
(
compress
)
{
{
if
(
_data_mode
==
vtkXMLWriter
::
Ascii
&&
compress
)
if
(
_data_mode
==
vtkXMLWriter
::
Ascii
&&
compress
)
{
{
...
@@ -50,9 +50,10 @@ VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compres
...
@@ -50,9 +50,10 @@ VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compres
}
}
}
}
MeshLib
::
Mesh
*
VtuInterface
::
readVTUFile
(
std
::
string
const
&
file_name
)
MeshLib
::
Mesh
*
VtuInterface
::
readVTUFile
(
std
::
string
const
&
file_name
)
{
{
if
(
!
BaseLib
::
IsFileExisting
(
file_name
))
{
if
(
!
BaseLib
::
IsFileExisting
(
file_name
))
{
ERR
(
"File '{:s}' does not exist."
,
file_name
);
ERR
(
"File '{:s}' does not exist."
,
file_name
);
return
nullptr
;
return
nullptr
;
}
}
...
@@ -69,8 +70,10 @@ MeshLib::Mesh* VtuInterface::readVTUFile(std::string const &file_name)
...
@@ -69,8 +70,10 @@ MeshLib::Mesh* VtuInterface::readVTUFile(std::string const &file_name)
return
nullptr
;
return
nullptr
;
}
}
std
::
string
const
mesh_name
(
BaseLib
::
extractBaseNameWithoutExtension
(
file_name
));
std
::
string
const
mesh_name
(
return
MeshLib
::
VtkMeshConverter
::
convertUnstructuredGrid
(
vtkGrid
,
mesh_name
);
BaseLib
::
extractBaseNameWithoutExtension
(
file_name
));
return
MeshLib
::
VtkMeshConverter
::
convertUnstructuredGrid
(
vtkGrid
,
mesh_name
);
}
}
MeshLib
::
Mesh
*
VtuInterface
::
readVTKFile
(
std
::
string
const
&
file_name
)
MeshLib
::
Mesh
*
VtuInterface
::
readVTKFile
(
std
::
string
const
&
file_name
)
...
@@ -161,6 +164,5 @@ int writeVtu(MeshLib::Mesh const& mesh, std::string const& file_name,
...
@@ -161,6 +164,5 @@ int writeVtu(MeshLib::Mesh const& mesh, std::string const& file_name,
return
0
;
return
0
;
}
}
}
// end namespace IO
}
// end namespace IO
}
// end namespace MeshLib
}
// end namespace MeshLib
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