Commit b30adff8 authored by Hamilton, Steven P's avatar Hamilton, Steven P
Browse files

Fixing up hdf5 writing for naming consistency.

parent a5b5325b
......@@ -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()
......
......@@ -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);
......
......@@ -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
*
......
......@@ -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
}
......
......@@ -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());
......
......@@ -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());
......
......@@ -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)
......
......@@ -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());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment