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

Fixing up hdf5 writing for naming consistency.

parent a5b5325b
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ class Cell_Tally_DMM : public cuda::Device_Memory_Manager<Cell_Tally<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()
+6 −2
Original line number Diff line number Diff line
@@ -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);

+3 −0
Original line number Diff line number Diff line
@@ -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
     *
+1 −3
Original line number Diff line number Diff line
@@ -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
}
+2 −1
Original line number Diff line number Diff line
@@ -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());
Loading