Added an error message if trying to load device constants without MPI
This commit is contained in:
@@ -26,6 +26,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "host_forcing.h"
|
#include "host_forcing.h"
|
||||||
|
|
||||||
|
#include "errchk.h"
|
||||||
|
|
||||||
// #include "math_utils.h"
|
// #include "math_utils.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -192,6 +194,7 @@ DEPRECATED_acForcingVec(const AcReal forcing_magnitude, const AcReal3 k_force,
|
|||||||
const AcReal3 ff_hel_re, const AcReal3 ff_hel_im,
|
const AcReal3 ff_hel_re, const AcReal3 ff_hel_im,
|
||||||
const AcReal forcing_phase, const AcReal kaver)
|
const AcReal forcing_phase, const AcReal kaver)
|
||||||
{
|
{
|
||||||
|
#if AC_MPI_ENABLED
|
||||||
acGridLoadScalarUniform(STREAM_DEFAULT, AC_forcing_magnitude, forcing_magnitude);
|
acGridLoadScalarUniform(STREAM_DEFAULT, AC_forcing_magnitude, forcing_magnitude);
|
||||||
acGridLoadScalarUniform(STREAM_DEFAULT, AC_forcing_phase, forcing_phase);
|
acGridLoadScalarUniform(STREAM_DEFAULT, AC_forcing_phase, forcing_phase);
|
||||||
|
|
||||||
@@ -208,11 +211,22 @@ DEPRECATED_acForcingVec(const AcReal forcing_magnitude, const AcReal3 k_force,
|
|||||||
acGridLoadScalarUniform(STREAM_DEFAULT, AC_ff_hel_imz, ff_hel_im.z);
|
acGridLoadScalarUniform(STREAM_DEFAULT, AC_ff_hel_imz, ff_hel_im.z);
|
||||||
|
|
||||||
acGridLoadScalarUniform(STREAM_DEFAULT, AC_kaver, kaver);
|
acGridLoadScalarUniform(STREAM_DEFAULT, AC_kaver, kaver);
|
||||||
|
#else
|
||||||
|
(void)forcing_magnitude;
|
||||||
|
(void)k_force;
|
||||||
|
(void)ff_hel_re;
|
||||||
|
(void)ff_hel_im;
|
||||||
|
(void)k_force;
|
||||||
|
(void)forcing_phase;
|
||||||
|
(void)kaver;
|
||||||
|
ERROR("AC_MPI_ENABLED must be set to use DEPRECATED_acForcingVec");
|
||||||
|
#endif // AC_MPI_ENABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
loadForcingParamsToGrid(const ForcingParams& forcing_params)
|
loadForcingParamsToGrid(const ForcingParams& forcing_params)
|
||||||
{
|
{
|
||||||
|
#if AC_MPI_ENABLED
|
||||||
acGridLoadScalarUniform(STREAM_DEFAULT, AC_forcing_magnitude, forcing_params.magnitude);
|
acGridLoadScalarUniform(STREAM_DEFAULT, AC_forcing_magnitude, forcing_params.magnitude);
|
||||||
acGridLoadScalarUniform(STREAM_DEFAULT, AC_forcing_phase, forcing_params.phase);
|
acGridLoadScalarUniform(STREAM_DEFAULT, AC_forcing_phase, forcing_params.phase);
|
||||||
|
|
||||||
@@ -230,6 +244,10 @@ loadForcingParamsToGrid(const ForcingParams& forcing_params)
|
|||||||
|
|
||||||
acGridLoadScalarUniform(STREAM_DEFAULT, AC_kaver, forcing_params.kaver);
|
acGridLoadScalarUniform(STREAM_DEFAULT, AC_kaver, forcing_params.kaver);
|
||||||
acGridSynchronizeStream(STREAM_ALL);
|
acGridSynchronizeStream(STREAM_ALL);
|
||||||
|
#else
|
||||||
|
(void)forcing_params;
|
||||||
|
ERROR("AC_MPI_ENABLED must be set to use loadForcingParamsToGrid");
|
||||||
|
#endif // AC_MPI_ENABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This function would be used in autotesting to update the forcing params of the host
|
/** This function would be used in autotesting to update the forcing params of the host
|
||||||
|
Reference in New Issue
Block a user