Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SST_ELEMENT_CONFIG_OUTPUT()
# depending on the use-picky flag
SST_CHECK_PICKY
AS_IF([test "x$use_picky" = "xyes"],
[WARNFLAGS="-Wall -Wextra"],
[WARNFLAGS="-Wall -Wextra -Wvla"],
[WARNFLAGS=""])
AM_CFLAGS="$AM_CFLAGS $WARNFLAGS"
AM_CXXFLAGS="$AM_CXXFLAGS $WARNFLAGS"
Expand Down
9 changes: 5 additions & 4 deletions src/sst/elements/mask-mpi/mpi_api_type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Questions? Contact sst-macro-help@sandia.gov
//#include <sumi-mpi/otf2_output_stat.h>
#include <mercury/components/operating_system.h>
#include <climits>
#include <memory>

namespace SST::Hg {
extern void apiLock();
Expand Down Expand Up @@ -429,12 +430,12 @@ MpiApi::typeIndexed(int count, const int lens[], const int* displs,
{
MpiType* in_type_obj = typeFromId(intype);
int type_extent = in_type_obj->extent();
MPI_Aint byte_displs[count];
auto byte_displs = std::make_unique<MPI_Aint[]>(count);
for (int i=0; i < count; ++i){
byte_displs[i] = displs[i] * type_extent;
}

int rc = doTypeHindexed(count, lens, byte_displs, in_type_obj, outtype);
int rc = doTypeHindexed(count, lens, byte_displs.get(), in_type_obj, outtype);
#ifdef SST_HG_OTF2_ENABLED
if (OTF2Writer_){
OTF2Writer_->writer().register_type(*outtype, count*in_type_obj->packed_size());
Expand Down Expand Up @@ -525,11 +526,11 @@ MpiApi::typeCreateStruct(const int count, const int* blocklens,
const MPI_Aint* indices, const MPI_Datatype* old_types,
MPI_Datatype* newtype)
{
int new_ind[count];
auto new_ind = std::make_unique<int[]>(count);
for (int i=0; i < count; ++i){
new_ind[i] = indices[i];
}
return typeCreateStruct(count, blocklens, new_ind, old_types, newtype);
return typeCreateStruct(count, blocklens, new_ind.get(), old_types, newtype);
}

//
Expand Down
12 changes: 7 additions & 5 deletions src/sst/elements/mask-mpi/mpi_comm/mpi_comm_cart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Questions? Contact sst-macro-help@sandia.gov
#include <mpi_comm/mpi_comm_cart.h>
#include <mercury/common/errors.h>

#include <memory>

namespace SST::MASKMPI {

MpiCommCart::MpiCommCart(
Expand Down Expand Up @@ -96,26 +98,26 @@ MpiCommCart::shift(int dir, int dis)
"mpicomm_cart::shift: dir %d is too big for dims %d",
dir, dims_.size());
}
int coords[dims_.size()];
set_coords(rank_, coords);
auto coords = std::make_unique<int[]>(dims_.size());
set_coords(rank_, coords.get());
coords[dir] += dis;

if (coords[dir] >= dims_[dir]) {
if (periods_[dir]) {
coords[dir] = coords[dir] % dims_[dir];
return rank(coords);
return rank(coords.get());
} else {
return MpiComm::proc_null;
}
} else if (coords[dir] < 0) {
if (periods_[dir]) {
coords[dir] = (dims_[dir] + coords[dir]) % dims_[dir];
return rank(coords);
return rank(coords.get());
} else {
return MpiComm::proc_null;
}
} else {
return rank(coords);
return rank(coords.get());
}

}
Expand Down
9 changes: 5 additions & 4 deletions src/sst/elements/zodiac/zsirius.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "zsirius.h"

#include <assert.h>
#include <memory>

#include "sst/core/params.h"

Expand Down Expand Up @@ -97,11 +98,11 @@ void ZodiacSiriusTraceReader::setup() {

eventQ = new std::queue<ZodiacEvent*>();

char trace_name[trace_file.length() + 20];
snprintf(trace_name, trace_file.length() + 20, "%s.%d", trace_file.c_str(), rank);
auto trace_name = std::make_unique<char[]>(trace_file.length() + 20);
snprintf(trace_name.get(), trace_file.length() + 20, "%s.%d", trace_file.c_str(), rank);

printf("Opening trace file: %s\n", trace_name);
trace = new SiriusReader(trace_name, rank, 64, eventQ, verbosityLevel);
printf("Opening trace file: %s\n", trace_name.get());
trace = new SiriusReader(trace_name.get(), rank, 64, eventQ, verbosityLevel);
trace->setOutput(&zOut);

int count = trace->generateNextEvents();
Expand Down
Loading