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

Getting solution checking to work with Cuda.

parent 9dcf8615
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ LIST(APPEND SOURCES ${MC_SOURCES})

FILE(GLOB DRIVER_HEADERS mc_driver/*.hh)
SET(DRIVER_SOURCES
  mc_driver/Manager_Base.cc
  mc_driver/Manager.pt.cc
  mc_driver/Manager_Builder.cc
  mc_driver/Problem_Builder.pt.cc
+9 −0
Original line number Diff line number Diff line
@@ -104,6 +104,15 @@ class Manager_Cuda : public mc::Manager_Base
    // Output.
    void output();

  protected:

    // Get keff
    void get_keff(double& keff_mean, double& keff_var);

    // Get flux tally result
    void get_flux(std::vector<double>& flux_val,
                  std::vector<double>& flux_std);

  private:
    // >>> IMPLEMENTATION

+31 −2
Original line number Diff line number Diff line
//----------------------------------*-C++-*----------------------------------//
/*!
 * \file   cuda_mc/Manager_Cuda.t.cuh
/*!  * \file   cuda_mc/Manager_Cuda.t.cuh
 * \author Steven Hamilton
 * \date   Wed Jun 18 11:21:16 2014
 * \brief  Manager_Cuda member definitions.
@@ -443,6 +442,36 @@ void Manager_Cuda<Geometry_DMM>::build_physics(RCP_ParameterList master_db)
    d_physics = SDP_Physics( physics_host );
}

//---------------------------------------------------------------------------//
/*!
 * \brief Get keff
 */
template <class Geometry_DMM>
void Manager_Cuda<Geometry_DMM>::get_keff(double& keff_mean, double& keff_var)
{
    REQUIRE(d_keff_solver);
    auto keff_tally = d_keff_solver->keff_tally();
    CHECK(keff_tally);
    keff_mean = keff_tally->mean();
    keff_var = keff_tally->variance();
}

//---------------------------------------------------------------------------//
/*!
 * \brief Extract flux from tally
 */
template <class Geometry_DMM>
void Manager_Cuda<Geometry_DMM>::get_flux(
        std::vector<double>& flux_val,
        std::vector<double>& flux_std)
{
    REQUIRE(d_tallier_dmm);

    // Get mean and std dev from cell tally
    auto cell_tally = d_tallier_dmm->cell_tally();
    flux_val = cell_tally->results();
    flux_std = cell_tally->std_dev();
}

} // end namespace cuda_mc

+3 −0
Original line number Diff line number Diff line
@@ -156,6 +156,9 @@ class Tallier_DMM : public cuda::Device_Memory_Manager<Tallier<Geometry>>
    // Add keff tally.
    void add_keff_tally(SP_Keff_Tally_DMM tally);

    // Access cell tally
    SP_Cell_Tally_DMM cell_tally() const {return d_cell_tally_dmm;}

    // >>> HOST-SIDE TALLY OPERATIONS

    // Tell the tallies to begin active kcode cycles
+9 −0
Original line number Diff line number Diff line
@@ -95,6 +95,15 @@ class Manager : public Manager_Base
    // Output.
    void output();

  protected:

    // Get keff
    void get_keff(double& keff_mean, double& keff_var);

    // Get computed flux solution
    void get_flux(std::vector<double>& flux_val,
                  std::vector<double>& flux_std);

  private:
    // >>> IMPLEMENTATION

Loading