Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Cunliffe <[email protected]>
  • Loading branch information
willGraham01 and samcunliffe authored Jun 6, 2023
1 parent 5b0fa47 commit 16bd67c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
3 changes: 1 addition & 2 deletions tdms/include/hdf5_io/hdf5_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
/**
* @brief Class wrapper of the reading of HDF5 format files.
* @details Opens files in readonly and retrieves the datasets (in our
* case
* **double, but can be anything in general).
* case, **double, but can be anything in general).
*/
class HDF5Reader : public HDF5Base {
public:
Expand Down
4 changes: 2 additions & 2 deletions tdms/include/simulation_manager/objects_from_infile.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class IndependentObjectsFromInfile {

GridLabels input_grid_labels;//!< cartesian labels of the Yee cells

FrequencyExtractVector
f_ex_vec;//< Vector of frequencies to extract field & phasors at
//! Vector of frequencies to extract field & phasors at
FrequencyExtractVector f_ex_vec;

/* DERIVED VARIABLES FROM INDEPENDENT INPUTS */

Expand Down
21 changes: 12 additions & 9 deletions tdms/src/simulation_manager/execute_detector_subfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,18 @@ void SimulationManager::compute_detector_functions(unsigned int tind,
phaseTermE, cphaseTermE)
{
// For each frequency
/* https://stackoverflow.com/questions/2820621/why-arent-unsigned-openmp-index-variables-allowed
On Windows, we are forced to unsafe cast between unsigned and signed integer
because OpenMP 2.5 (the only version the VSCode compiler supports) does not
permit unsigned integers in parallel for loops.
Conversely, OpenMP on Mac and Ubuntu does support this, and thus we can avoid
both an unsafe cast and unsafe comparison between a signed loop variable and
unsigned vector size.
*/
/**
* The following #if ... #else ... #endif block is to work around
* https://stackoverflow.com/questions/2820621/
*
* On Windows, we are forced to unsafe cast between unsigned and signed integer
* because OpenMP 2.5 (the only version the VSCode compiler supports) does not
* permit unsigned integers in parallel for loops.
*
* Conversely, OpenMP on Mac and Ubuntu does support this, so the code is simpler
* and safer. When VisualStudio eventually update their OpenMP spec we can
* probably remove this.
*/
#if (_OPENMP < 200805)
long long int loop_upper_index = inputs.f_ex_vec.size();

Expand Down

0 comments on commit 16bd67c

Please sign in to comment.