Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ProfugusMC
ProfugusMC
Commits
e0e5c83e
Commit
e0e5c83e
authored
Aug 31, 2018
by
Hamilton, Steven P
Browse files
Removing HDF5.
parent
18ee938e
Changes
33
Hide whitespace changes
Inline
Side-by-side
TPLsList.cmake
View file @
e0e5c83e
...
...
@@ -10,9 +10,7 @@
#
# Trilinos/cmake/TrilinosTPLs.cmake
#
SET
(
ProfugusMC_TPLS_FINDMODS_CLASSIFICATIONS
HDF5
"cmake/TPLs/"
SS
)
SET
(
ProfugusMC_TPLS_FINDMODS_CLASSIFICATIONS
)
##---------------------------------------------------------------------------##
## end of TPLsList.cmake
...
...
cmake/TPLs/FindTPLHDF5.cmake
deleted
100644 → 0
View file @
18ee938e
SET
(
LIBS_NAMES hdf5_hl hdf5
)
IF
(
${
PROJECT_NAME
}
_ENABLE_VERAIn
)
APPEND_SET
(
LIBS_NAMES hdf5_fortran
)
ENDIF
()
TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES
(
HDF5
REQUIRED_HEADERS hdf5.h
REQUIRED_LIBS_NAMES
${
LIBS_NAMES
}
z
)
cmake/TPLs/FindTPLSILO.cmake
deleted
100644 → 0
View file @
18ee938e
IF
(
NOT TPL_ENABLE_HDF5
)
MESSAGE
(
FATAL_ERROR
"
\n
SILO TPL requires that HDF5 support is enabled.
\n\n
"
)
ELSE
()
TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES
(
SILO
REQUIRED_HEADERS silo.h
REQUIRED_LIBS_NAMES siloh5
)
ENDIF
()
install/cmake_cpu.sh
View file @
e0e5c83e
...
...
@@ -10,10 +10,9 @@ cmake \
-DCMAKE_CXX_COMPILER
=
"mpicxx"
\
-DCMAKE_INSTALL_PREFIX
:PATH
=
${
INSTALL
}
\
-DBUILD_SHARED_LIBS
:BOOL
=
ON
\
-DProfugus_ENABLE_CXX11
:BOOL
=
ON
\
-DProfugus
MC
_ENABLE_CXX11
:BOOL
=
ON
\
-DTPL_ENABLE_MPI
:BOOL
=
ON
\
-DTPL_ENABLE_HDF5
:BOOL
=
ON
\
-DProfugus_ENABLE_MC
:BOOL
=
ON
\
-DProfugus_ENABLE_TESTS
:BOOL
=
OFF
\
-DProfugusMC_ENABLE_MC
:BOOL
=
ON
\
-DProfugusMC_ENABLE_TESTS
:BOOL
=
OFF
\
${
SOURCE
}
install/cmake_cuda.sh
View file @
e0e5c83e
...
...
@@ -11,14 +11,13 @@ cmake \
-DCMAKE_CXX_COMPILER
=
"mpicxx"
\
-DCMAKE_INSTALL_PREFIX
:PATH
=
${
INSTALL
}
\
-DBUILD_SHARED_LIBS
:BOOL
=
ON
\
-DProfugus_ENABLE_CXX11
:BOOL
=
ON
\
-DProfugus
MC
_ENABLE_CXX11
:BOOL
=
ON
\
-DTPL_ENABLE_MPI
:BOOL
=
ON
\
-DTPL_ENABLE_HDF5
:BOOL
=
ON
\
-DTPL_ENABLE_CUDA
:BOOL
=
ON
\
-DProfugus_ENABLE_CUDA
:BOOL
=
ON
\
-DProfugus
MC
_ENABLE_CUDA
:BOOL
=
ON
\
-DCUDA_PROPAGATE_HOST_FLAGS
:BOOL
=
OFF
\
-DCUDA_NVCC_FLAGS
:STRING
=
"--std=c++11;-arch=sm_35;-Xptxas=-dlcm=cg"
\
-DProfugus_ENABLE_MC
:BOOL
=
ON
\
-DProfugus_ENABLE_TESTS
:BOOL
=
OFF
\
-DProfugus
MC
_ENABLE_MC
:BOOL
=
ON
\
-DProfugus
MC
_ENABLE_TESTS
:BOOL
=
OFF
\
${
SOURCE
}
packages/MC/cuda_mc/Cell_Tally.cuh
View file @
e0e5c83e
...
...
@@ -142,9 +142,6 @@ class Cell_Tally_DMM : public cuda::Device_Memory_Manager<Cell_Tally<Geometry>>
std
::
vector
<
double
>
d_tally_sum_sq
;
std
::
vector
<
double
>
d_batch_np
;
// Prefix for hdf5 filename
std
::
string
d_file_prefix
;
public:
// Constructor.
...
...
packages/MC/cuda_mc/Cell_Tally.t.cuh
View file @
e0e5c83e
...
...
@@ -16,7 +16,6 @@
#include "Utils/comm/global.hh"
#include "Utils/utils/View_Field.hh"
#include "Utils/utils/Serial_HDF5_Writer.hh"
#include "cuda_utils/Launch_Args.t.cuh"
...
...
@@ -42,9 +41,6 @@ Cell_Tally_DMM<Geometry>::Cell_Tally_DMM(RCP_Std_DB db,
REQUIRE
(
d_geometry
.
get_device_ptr
());
REQUIRE
(
d_physics
.
get_host_ptr
());
REQUIRE
(
d_physics
.
get_device_ptr
());
d_file_prefix
=
"cell_tally"
;
if
(
db
->
isType
<
std
::
string
>
(
"problem_name"
))
d_file_prefix
=
db
->
get
<
std
::
string
>
(
"problem_name"
);
}
//---------------------------------------------------------------------------//
...
...
@@ -149,20 +145,6 @@ void Cell_Tally_DMM<Geometry>::finalize(double num_particles)
d_host_tally
[
cell
]
=
tally_mean
/
vol
;
d_host_std_dev
[
cell
]
=
std
::
sqrt
(
var
)
/
vol
;
}
#ifdef USE_HDF5
// Open file for writing
std
::
string
filename
=
d_file_prefix
+
"_flux.h5"
;
profugus
::
Serial_HDF5_Writer
writer
;
writer
.
open
(
filename
);
// Write data
writer
.
write
(
"cells"
,
d_host_cells
);
writer
.
write
(
"flux_mean"
,
d_host_tally
);
writer
.
write
(
"flux_std_dev"
,
d_host_std_dev
);
writer
.
close
();
#endif
}
//---------------------------------------------------------------------------//
...
...
packages/MC/cuda_mc/Manager_Cuda.hh
View file @
e0e5c83e
...
...
@@ -101,9 +101,6 @@ class Manager_Cuda : public mc::Manager_Base
// Solve the problem.
void
solve
();
// Output.
void
output
();
protected:
// Get keff
...
...
packages/MC/cuda_mc/Manager_Cuda.t.cuh
View file @
e0e5c83e
...
...
@@ -20,8 +20,6 @@
#include "comm/global.hh"
#include "xs/XS_Builder.hh"
#include "utils/String_Functions.hh"
#include "utils/Serial_HDF5_Writer.hh"
#include "utils/Parallel_HDF5_Writer.hh"
#include "cuda_geometry/Mesh_Geometry.hh"
#include "Uniform_Source.cuh"
#include "Tallier.cuh"
...
...
@@ -232,67 +230,6 @@ void Manager_Cuda<Geometry_DMM>::solve()
}
}
//---------------------------------------------------------------------------//
/*!
* \brief Do output.
*/
template
<
class
Geometry_DMM
>
void
Manager_Cuda
<
Geometry_DMM
>::
output
()
{
using
std
::
string
;
SCOPED_TIMER
(
"Manager_Cuda.output"
);
SCREEN_MSG
(
"Outputting data"
);
// >>> OUTPUT FINAL DATABASE
// output the final database
if
(
d_node
==
0
)
{
std
::
ostringstream
m
;
m
<<
d_problem_name
<<
"_db.xml"
;
Teuchos
::
writeParameterListToXmlFile
(
*
d_db
,
m
.
str
());
}
profugus
::
global_barrier
();
// >>> OUTPUT SOLUTION (only available if HDF5 is on)
#ifdef USE_HDF5
// Output filename
std
::
ostringstream
m
;
m
<<
d_problem_name
<<
"_output.h5"
;
string
outfile
=
m
.
str
();
// scalar output for kcode
if
(
d_keff_solver
)
{
// get the kcode tally
auto
keff
=
d_keff_solver
->
keff_tally
();
CHECK
(
keff
);
// make the hdf5 file
profugus
::
Serial_HDF5_Writer
writer
;
writer
.
open
(
outfile
);
// output scalar quantities
writer
.
begin_group
(
"keff"
);
writer
.
write
(
string
(
"mean"
),
keff
->
mean
());
writer
.
write
(
string
(
"variance"
),
keff
->
variance
());
writer
.
write
(
string
(
"num_active_cycles"
),
static_cast
<
int
>
(
keff
->
cycle_count
()));
writer
.
write
(
string
(
"cycle_estimates"
),
keff
->
all_keff
());
writer
.
end_group
();
writer
.
close
();
}
#endif // USE_HDF5
}
//---------------------------------------------------------------------------//
/*!
* \brief Build mesh geometry
...
...
packages/MC/mc/Cell_Tally.t.hh
View file @
e0e5c83e
...
...
@@ -16,7 +16,6 @@
#include "Utils/comm/global.hh"
#include "Cell_Tally.hh"
#include "utils/Serial_HDF5_Writer.hh"
namespace
profugus
{
...
...
@@ -160,7 +159,7 @@ void Cell_Tally<Geometry>::finalize(double num_particles)
// Store the error of the sample mean
moments
.
second
=
std
::
sqrt
(
var
*
inv_N
);
// Store values back into vectors
for HDF5 writing
// Store values back into vectors
first
[
ctr
]
=
moments
.
first
;
second
[
ctr
]
=
moments
.
second
;
...
...
@@ -195,18 +194,6 @@ void Cell_Tally<Geometry>::finalize(double num_particles)
second
[
i
]
=
tmp_second
[
ind
];
}
}
#ifdef USE_HDF5
REQUIRE
(
d_db
->
isType
<
std
::
string
>
(
"problem_name"
)
);
std
::
string
filename
=
d_db
->
get
<
std
::
string
>
(
"problem_name"
)
+
"_flux.h5"
;
Serial_HDF5_Writer
writer
;
writer
.
open
(
filename
);
writer
.
write
(
"cells"
,
cells
);
writer
.
write
(
"flux_mean"
,
first
);
writer
.
write
(
"flux_std_dev"
,
second
);
writer
.
close
();
#endif
}
//---------------------------------------------------------------------------//
...
...
packages/MC/mc/Source_Diagnostic_Tally.hh
View file @
e0e5c83e
...
...
@@ -18,7 +18,6 @@
#include "Teuchos_RCP.hpp"
#include "Teuchos_ParameterList.hpp"
#include "utils/Serial_HDF5_Writer.hh"
#include "geometry/Mesh_Geometry.hh"
#include "Tally.hh"
...
...
@@ -99,9 +98,8 @@ class Source_Diagnostic_Tally : public Source_Tally<Geometry>
private:
// >>> IMPLEMENTATION
// Output file name
and hdf5 writer.
// Output file name
std
::
string
d_filename
;
Serial_HDF5_Writer
d_writer
;
// Cycle counter.
int
d_cycle_ctr
;
...
...
packages/MC/mc/Source_Diagnostic_Tally.t.hh
View file @
e0e5c83e
...
...
@@ -52,33 +52,8 @@ Source_Diagnostic_Tally<Geometry>::Source_Diagnostic_Tally(
// set the name
Base
::
set_name
(
"fission_source"
);
#ifndef USE_HDF5
ADD_WARNING
(
"HDF5 not available in this build, turning source diagnostic"
<<
" tally off"
);
#else
// make the source diagnostic output file
d_filename
=
db
->
get
<
std
::
string
>
(
"problem_name"
)
+
"_fs.h5"
;
// make the initial file
d_writer
.
open
(
d_filename
);
// write the mesh
d_writer
.
begin_group
(
"mesh"
);
// get the underlying cartesian mesh
const
auto
&
cart_mesh
=
d_mesh
->
mesh
();
// write the edges
d_writer
.
write
(
"x"
,
cart_mesh
.
edges
(
def
::
X
));
d_writer
.
write
(
"y"
,
cart_mesh
.
edges
(
def
::
Y
));
d_writer
.
write
(
"z"
,
cart_mesh
.
edges
(
def
::
Z
));
d_writer
.
end_group
();
d_writer
.
close
();
#endif
}
//---------------------------------------------------------------------------//
...
...
@@ -90,25 +65,6 @@ Source_Diagnostic_Tally<Geometry>::Source_Diagnostic_Tally(
template
<
class
Geometry
>
void
Source_Diagnostic_Tally
<
Geometry
>::
birth
(
const
Particle_t
&
p
)
{
#ifdef USE_HDF5
// get the particle's geometric state
const
auto
&
geo_state
=
p
.
geo_state
();
// initialize the particle in the fission-matrix mesh
d_mesh
->
initialize
(
d_geometry
->
position
(
geo_state
),
d_geometry
->
direction
(
geo_state
),
d_state
);
// determine the birth cell in the fission matrix mesh
auto
mesh_idx
=
d_mesh
->
cell
(
d_state
);
CHECK
(
mesh_idx
>=
0
&&
mesh_idx
<
d_mesh
->
num_cells
());
// tally the source (particle) density
d_source_density
[
mesh_idx
]
+=
p
.
wt
();
// count up the particles in this cycle
++
d_num_per_cycle
;
#endif
}
//---------------------------------------------------------------------------//
...
...
@@ -118,59 +74,6 @@ void Source_Diagnostic_Tally<Geometry>::birth(const Particle_t &p)
template
<
class
Geometry
>
void
Source_Diagnostic_Tally
<
Geometry
>::
end_cycle
(
double
num_particles
)
{
#ifdef USE_HDF5
REQUIRE
(
d_source_density
.
size
()
==
d_mesh
->
num_cells
());
// reduce the tally across all sets
profugus
::
global_sum
(
d_source_density
.
data
(),
d_source_density
.
size
());
// get the underlying cartesian mesh
const
auto
&
cart_mesh
=
d_mesh
->
mesh
();
CHECK
(
cart_mesh
.
num_cells
()
==
d_mesh
->
num_cells
());
// normalize so that s\dot s = 1
double
norm
=
0.0
;
for
(
int
cell
=
0
;
cell
<
d_source_density
.
size
();
++
cell
)
{
d_source_density
[
cell
]
/=
cart_mesh
.
volume
(
cell
);
norm
+=
d_source_density
[
cell
]
*
d_source_density
[
cell
];
}
// calculate the normalization
norm
=
1.0
/
std
::
sqrt
(
norm
);
// apply the normalization
for
(
auto
&
s
:
d_source_density
)
{
s
*=
norm
;
}
// open the file - writing is only on proc 0
d_writer
.
open
(
d_filename
,
HDF5_IO
::
APPEND
,
0
);
// make the cycle group
std
::
ostringstream
m
;
m
<<
"cycle_"
<<
d_cycle_ctr
;
d_writer
.
begin_group
(
m
.
str
());
// write the number of particles
profugus
::
global_sum
(
&
d_num_per_cycle
,
1
);
d_writer
.
write
(
"num_particles"
,
d_num_per_cycle
);
// write the normalized source
d_writer
.
write
(
"source_density"
,
d_source_density
);
// end the group and close
d_writer
.
end_group
();
d_writer
.
close
();
// reset the source tally for the next cycle
reset
();
// update the cycle counter
++
d_cycle_ctr
;
#endif
}
//---------------------------------------------------------------------------//
...
...
packages/MC/mc_driver/Manager.hh
View file @
e0e5c83e
...
...
@@ -92,9 +92,6 @@ class Manager : public Manager_Base
double
k_std_ref
,
std
::
string
flux_file
);
// Output.
void
output
();
protected:
// Get keff
...
...
packages/MC/mc_driver/Manager.t.hh
View file @
e0e5c83e
...
...
@@ -14,15 +14,13 @@
#include <sstream>
#include <fstream>
#include <iostream>
//
#include <iomanip>
#include <iomanip>
#include "Teuchos_XMLParameterListHelpers.hpp"
#include "harness/DBC.hh"
#include "comm/Timing.hh"
#include "comm/global.hh"
#include "utils/Serial_HDF5_Writer.hh"
#include "utils/Parallel_HDF5_Writer.hh"
#include "mc/Fission_Source.hh"
#include "mc/Uniform_Source.hh"
#include "mc/KCode_Solver.hh"
...
...
@@ -263,67 +261,6 @@ void Manager<Geometry>::get_keff(double& keff_mean, double& keff_var)
keff_var
=
keff_tally
->
variance
();
}
//---------------------------------------------------------------------------//
/*!
* \brief Do output.
*/
template
<
class
Geometry
>
void
Manager
<
Geometry
>::
output
()
{
using
std
::
string
;
SCOPED_TIMER
(
"Manager.output"
);
SCREEN_MSG
(
"Outputting data"
);
// >>> OUTPUT FINAL DATABASE
// output the final database
if
(
d_node
==
0
)
{
std
::
ostringstream
m
;
m
<<
d_problem_name
<<
"_db.xml"
;
Teuchos
::
writeParameterListToXmlFile
(
*
d_db
,
m
.
str
());
}
profugus
::
global_barrier
();
// >>> OUTPUT SOLUTION (only available if HDF5 is on)
#ifdef USE_HDF5
// Output filename
std
::
ostringstream
m
;
m
<<
d_problem_name
<<
"_output.h5"
;
string
outfile
=
m
.
str
();
// scalar output for kcode
if
(
d_keff_solver
)
{
// get the kcode tally
auto
keff
=
d_keff_solver
->
keff_tally
();
CHECK
(
keff
);
// make the hdf5 file
profugus
::
Serial_HDF5_Writer
writer
;
writer
.
open
(
outfile
);
// output scalar quantities
writer
.
begin_group
(
"keff"
);
writer
.
write
(
string
(
"mean"
),
keff
->
mean
());
writer
.
write
(
string
(
"variance"
),
keff
->
variance
());
writer
.
write
(
string
(
"num_active_cycles"
),
static_cast
<
int
>
(
keff
->
cycle_count
()));
writer
.
write
(
string
(
"cycle_estimates"
),
keff
->
all_keff
());
writer
.
end_group
();
writer
.
close
();
}
#endif // USE_HDF5
}
}
// end namespace mc
#endif // mc_driver_Manager_t_hh
...
...
packages/MC/mc_driver/Manager_Base.hh
View file @
e0e5c83e
...
...
@@ -48,9 +48,6 @@ class Manager_Base
double
k_std_ref
,
std
::
string
flux_file
);
// Output data.
virtual
void
output
()
=
0
;
protected:
// Get keff
...
...
packages/MC/mc_driver/mc.cc
View file @
e0e5c83e
...
...
@@ -129,9 +129,6 @@ int main(int argc, char *argv[])
// solve the problem
manager
->
solve
();
// output
manager
->
output
();
}
catch
(
const
profugus
::
assertion
&
a
)
{
...
...
packages/MC/mc_driver/profugus.cc
View file @
e0e5c83e
...
...
@@ -184,9 +184,6 @@ int main(int argc, char *argv[])
double
k_std_ref
=
6.131761e-06
;
std
::
string
flux_file
=
data_dir
+
"c5g7_flux_ref.txt"
;
manager
->
check_solution
(
k_ref
,
k_std_ref
,
flux_file
);
// output
manager
->
output
();
}
catch
(
const
profugus
::
assertion
&
a
)
{
...
...
packages/Utils/CMakeLists.txt
View file @
e0e5c83e
...
...
@@ -202,14 +202,6 @@ IF(SPRNG_BigEndian)
SET
(
SPRNG_LittleEndian OFF
)
ENDIF
()
##---------------------------------------------------------------------------##
## Optional TPLs
IF
(
TPL_ENABLE_HDF5
)
MESSAGE
(
STATUS
"Building Utils with HDF5 support"
)
SET
(
USE_HDF5 ON
)
ENDIF
()
##---------------------------------------------------------------------------##
# C) Process the subpackages
##---------------------------------------------------------------------------##
...
...
@@ -260,20 +252,9 @@ INSTALL(FILES ${COMM_HEADERS} DESTINATION include/Utils/comm)
FILE
(
GLOB UTILS_HEADERS utils/*.hh
)
SET
(
UTILS_SOURCES
utils/Hash_Functions.cc
utils/String_Functions.cc
)
IF
(
TPL_ENABLE_HDF5
)
APPEND_SET
(
UTILS_SOURCES
utils/HDF5_IO.cc
utils/HDF5_Reader.cc
utils/Hash_Functions.cc
utils/Member_Manager.cc
utils/Parallel_HDF5_Writer.cc
utils/Serial_HDF5_Writer.cc
utils/String_Functions.cc
utils/Vector_Functions.cc
)
ENDIF
()
utils/Member_Manager.cc
utils/String_Functions.cc
utils/Vector_Functions.cc
)
LIST
(
APPEND HEADERS
${
UTILS_HEADERS
}
)
LIST
(
APPEND SOURCES
${
UTILS_SOURCES
}
)
...
...
packages/Utils/cmake/Dependencies.cmake
View file @
e0e5c83e
...
...
@@ -13,7 +13,7 @@ SET(LIB_OPTIONAL_DEP_PACKAGES)
SET
(
TEST_REQUIRED_DEP_PACKAGES
)
SET
(
TEST_OPTIONAL_DEP_PACKAGES
)
SET
(
LIB_REQUIRED_DEP_TPLS
)
SET
(
LIB_OPTIONAL_DEP_TPLS
HDF5
)
SET
(
LIB_OPTIONAL_DEP_TPLS
)
SET
(
TEST_REQUIRED_DEP_TPLS
)
SET
(
TEST_OPTIONAL_DEP_TPLS
)
...
...
packages/Utils/cmake/config.h.in
View file @
e0e5c83e
...
...
@@ -144,9 +144,6 @@
/* C++11 settings */
#cmakedefine01 GTEST_LANG_CXX11
/* USE HDF5 OUTPUT FUNCTIONS */
#cmakedefine USE_HDF5
#cmakedefine CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
/* >>> RNG VARIABLES */
...
...
Prev
1
2
Next
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