Skip to content

Commit

Permalink
Updating PIConGPU sourcecode for MaxwellJuettnerPush
Browse files Browse the repository at this point in the history
  • Loading branch information
Ermakov committed Feb 29, 2024
1 parent ed04add commit bb4b648
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
56 changes: 56 additions & 0 deletions etc/picongpu/mpirun.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
# Copyright 2013-2022 Axel Huebl, Anton Helm, Rene Widera
#
# This file is part of PIConGPU.
#
# PIConGPU is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PIConGPU is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PIConGPU.
# If not, see <http://www.gnu.org/licenses/>.
#

##calculations will be performed by tbg##

# settings that can be controlled by environment variables before submit
.TBG_author=${MY_NAME:+--author \"${MY_NAME}\"}
.TBG_profile=${PIC_PROFILE:-"~/picongpu.profile"}

# 8 gpus per node if we need more than 8 gpus else same count as TBG_tasks
.TBG_gpusPerNode=$(if [ $TBG_tasks -gt 8 ] ; then echo 8; else echo $TBG_tasks; fi)

## end calculations ##


echo 'Running program...'

cd !TBG_dstPath

export MODULES_NO_OUTPUT=1
. !TBG_profile
unset MODULES_NO_OUTPUT

#set user rights to u=rwx;g=r-x;o=---
umask 0027

mkdir simOutput 2> /dev/null
cd simOutput

# test if cuda_memtest binary is available
if [ -f !TBG_dstPath/input/bin/cuda_memtest ] ; then
mpirun -am !TBG_dstPath/tbg/openib.conf --mca mpi_leave_pinned 0 -npernode !TBG_gpusPerNode -n !TBG_tasks !TBG_dstPath/input/bin/cuda_memtest.sh
else
echo "Note: GPU memory test was skipped as no binary 'cuda_memtest' available. This does not affect PIConGPU, starting it now" >&2
fi

if [ $? -eq 0 ] ; then
mpirun -am !TBG_dstPath/tbg/openib.conf --mca mpi_leave_pinned 0 -npernode !TBG_gpusPerNode -n !TBG_tasks !TBG_dstPath/input/bin/picongpu !TBG_author !TBG_programParams | tee output
fi
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ namespace picongpu
typename T_ValueFunctor = pmacc::math::operation::Add>
using Temperature = generic::FreeRng<
acc::Temperature<T_ParamClass, T_ValueFunctor>,
pmacc::random::distributions::Normal<float_X>>;
pmacc::random::distributions::Normal<float_X>>;

/** Version with user-provided temperature functor
*
Expand Down
6 changes: 4 additions & 2 deletions include/picongpu/particles/manipulators/unary/Temperature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,20 @@ namespace picongpu
float_X const macroWeighting = particle[weighting_];
float_X const macroEnergy = macroWeighting * energy;
float_X const macroMass = attribute::getMass(macroWeighting, particle);
float_X const standardDeviation

float_X const standardDeviation
= static_cast<float_X>(math::sqrt(precisionCast<sqrt_X>(macroEnergy * macroMass)));
float3_X const mom
= float3_X(standardNormalRng(), standardNormalRng(), standardNormalRng())
* standardDeviation;

T_ValueFunctor::operator()(particle[momentum_], mom);
}
};

} // namespace detail

template<typename T_ParamClass, typename T_ValueFunctor>
template<typename T_ParamClass, typename T_ValueFunctor>
struct Temperature : public detail::TemperatureImpl<T_ValueFunctor>
{
//! Base class
Expand Down

0 comments on commit bb4b648

Please sign in to comment.