Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ProfugusMC
ProfugusMC
Commits
b30adff8
Commit
b30adff8
authored
Sep 07, 2017
by
Hamilton, Steven P
Browse files
Fixing up hdf5 writing for naming consistency.
parent
a5b5325b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Profugus/Source/src/packages/MC/cuda_mc/Cell_Tally.cuh
View file @
b30adff8
...
...
@@ -109,12 +109,13 @@ class Cell_Tally_DMM : public cuda::Device_Memory_Manager<Cell_Tally<Geometry>>
public:
//@{
//! Typedefs.
typedef
Geometry
Geometry_t
;
typedef
Physics
<
Geometry
>
Physics_t
;
typedef
cuda
::
Shared_Device_Ptr
<
Geometry_t
>
SDP_Geometry
;
typedef
cuda
::
Shared_Device_Ptr
<
Physics_t
>
SDP_Physics
;
typedef
thrust
::
device_vector
<
double
>
Dev_Dbl
;
typedef
thrust
::
device_vector
<
int
>
Dev_Int
;
typedef
Geometry
Geometry_t
;
typedef
Physics
<
Geometry
>
Physics_t
;
typedef
cuda
::
Shared_Device_Ptr
<
Geometry_t
>
SDP_Geometry
;
typedef
cuda
::
Shared_Device_Ptr
<
Physics_t
>
SDP_Physics
;
typedef
thrust
::
device_vector
<
double
>
Dev_Dbl
;
typedef
thrust
::
device_vector
<
int
>
Dev_Int
;
typedef
Teuchos
::
RCP
<
Teuchos
::
ParameterList
>
RCP_Std_DB
;
//@}
private:
...
...
@@ -141,10 +142,15 @@ 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.
Cell_Tally_DMM
(
SDP_Geometry
geometry
,
SDP_Physics
physics
);
Cell_Tally_DMM
(
RCP_Std_DB
db
,
SDP_Geometry
geometry
,
SDP_Physics
physics
);
// DMM interface
Cell_Tally
<
Geometry
>
device_instance
()
...
...
Profugus/Source/src/packages/MC/cuda_mc/Cell_Tally.t.cuh
View file @
b30adff8
...
...
@@ -33,7 +33,8 @@ namespace cuda_mc
* \brief Constructor.
*/
template
<
class
Geometry
>
Cell_Tally_DMM
<
Geometry
>::
Cell_Tally_DMM
(
SDP_Geometry
geometry
,
Cell_Tally_DMM
<
Geometry
>::
Cell_Tally_DMM
(
RCP_Std_DB
db
,
SDP_Geometry
geometry
,
SDP_Physics
physics
)
:
d_geometry
(
geometry
)
,
d_physics
(
physics
)
...
...
@@ -42,6 +43,9 @@ Cell_Tally_DMM<Geometry>::Cell_Tally_DMM(SDP_Geometry geometry,
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,7 +153,7 @@ void Cell_Tally_DMM<Geometry>::finalize(double num_particles)
#ifdef USE_HDF5
// Open file for writing
std
::
string
filename
=
"cell_tally
.h5"
;
std
::
string
filename
=
d_file_prefix
+
"_flux
.h5"
;
profugus
::
Serial_HDF5_Writer
writer
;
writer
.
open
(
filename
);
...
...
Profugus/Source/src/packages/MC/cuda_mc/KCode_Solver.cuh
View file @
b30adff8
...
...
@@ -123,6 +123,9 @@ class KCode_Solver : public Solver<Geometry>
// Get keff value
double
keff
()
const
{
return
d_keff_tally
->
mean
();
}
// Get keff tally
SP_Keff_Tally_DMM
keff_tally
()
const
{
return
d_keff_tally
;}
/*
* \brief Access inactive tallier
*
...
...
Profugus/Source/src/packages/MC/cuda_mc/Manager_Cuda.t.cuh
View file @
b30adff8
...
...
@@ -129,7 +129,7 @@ void Manager_Cuda<Geometry_DMM>::setup(RCP_ParameterList master)
auto
cells
=
tally_db
->
get
<
Array_Int
>
(
"cells"
);
auto
cell_tally_dmm
=
std
::
make_shared
<
Cell_Tally_DMM
<
Geom_t
>>
(
d_geometry
,
d_physics
);
d_db
,
d_geometry
,
d_physics
);
cell_tally_dmm
->
set_cells
(
cells
.
toVector
(),
d_geometry_dmm
->
volumes
());
...
...
@@ -267,7 +267,6 @@ void Manager_Cuda<Geometry_DMM>::output()
string
outfile
=
m
.
str
();
// scalar output for kcode
#if 0
if
(
d_keff_solver
)
{
// get the kcode tally
...
...
@@ -291,7 +290,6 @@ void Manager_Cuda<Geometry_DMM>::output()
writer
.
close
();
}
#endif
#endif // USE_HDF5
}
...
...
Profugus/Source/src/packages/MC/cuda_mc/test/Cell_Tally_Tester.cu
View file @
b30adff8
...
...
@@ -110,7 +110,8 @@ void Cell_Tally_Tester::test_tally(int num_batches)
REQUIRE
(
cudaGetLastError
()
==
cudaSuccess
);
// Build cell tally
auto
sp_tally_dmm
=
std
::
make_shared
<
Cell_Tally_DMM
<
Geom
>
>
(
sdp_geom
,
sdp_phys
);
auto
sp_tally_dmm
=
std
::
make_shared
<
Cell_Tally_DMM
<
Geom
>
>
(
pl
,
sdp_geom
,
sdp_phys
);
sp_tally_dmm
->
set_cells
(
cells
,
geom_dmm
->
volumes
());
auto
tally
=
cuda
::
shared_device_ptr
<
Cell_Tally
<
Geom
>>
(
sp_tally_dmm
->
device_instance
());
...
...
Profugus/Source/src/packages/MC/cuda_mc/test/Fixed_Solver_Tester.cu
View file @
b30adff8
...
...
@@ -74,7 +74,7 @@ void Fixed_Solver_Tester::test_transport(int num_groups)
// Build cell tally
std
::
cout
<<
"Building Cell_Tally"
<<
std
::
endl
;
auto
sp_cell_tally
=
std
::
make_shared
<
Cell_Tally_DMM
<
Geom
>>
(
sdp_geom
,
sdp_phys
);
pl
,
sdp_geom
,
sdp_phys
);
std
::
vector
<
int
>
cells
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
};
sp_cell_tally
->
set_cells
(
cells
,
geom_dmm
->
volumes
());
...
...
Profugus/Source/src/packages/MC/cuda_mc/test/KCode_Solver_Tester.cu
View file @
b30adff8
...
...
@@ -67,7 +67,7 @@ void run_transport(std::shared_ptr<Geom_DMM> geom_dmm,
// Build cell tally
std
::
cout
<<
"Building Cell_Tally"
<<
std
::
endl
;
auto
cell_tally
=
std
::
make_shared
<
Cell_Tally_DMM
<
Geom
>>
(
sdp_geom
,
sdp_phys
);
pl
,
sdp_geom
,
sdp_phys
);
int
num_cells
=
geom_dmm
->
volumes
().
size
();
std
::
vector
<
int
>
cells
;
for
(
int
cell
=
0
;
cell
<
num_cells
;
++
cell
)
...
...
Profugus/Source/src/packages/MC/cuda_mc/test/Source_Transporter_Tester.cu
View file @
b30adff8
...
...
@@ -60,7 +60,7 @@ void Source_Transporter_Tester::test_transport(int num_groups)
// Build cell tally
std
::
cout
<<
"Building Cell_Tally"
<<
std
::
endl
;
auto
cell_tally
=
std
::
make_shared
<
Cell_Tally_DMM
<
Geom
>>
(
sdp_geom
,
sdp_phys
);
pl
,
sdp_geom
,
sdp_phys
);
std
::
vector
<
int
>
cells
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
};
cell_tally
->
set_cells
(
cells
,
geom_dmm
->
volumes
());
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment