Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
weinbe2 committed Aug 11, 2023
1 parent 461d6fe commit c162881
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
9 changes: 5 additions & 4 deletions include/qio_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ void read_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, c
void write_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[]);
void read_spinor_field(const char *filename, void *V[], QudaPrecision precision, const int *X, QudaSiteSubset subset,
QudaParity parity, int nColor, int nSpin, int Nvec, int argc, char *argv[]);
void write_spinor_field(const char *filename, const void *V[], QudaPrecision precision, const int *X, QudaSiteSubset subset,
QudaParity parity, int nColor, int nSpin, int Nvec, int argc, char *argv[], bool partfile = false);
void write_spinor_field(const char *filename, const void *V[], QudaPrecision precision, const int *X,
QudaSiteSubset subset, QudaParity parity, int nColor, int nSpin, int Nvec, int argc,
char *argv[], bool partfile = false);
#else
inline void read_gauge_field(const char *, void *[], QudaPrecision, const int *, int, char *[])
{
Expand All @@ -25,8 +26,8 @@ inline void read_spinor_field(const char *, void *[], QudaPrecision, const int *
printf("QIO support has not been enabled\n");
exit(-1);
}
inline void write_spinor_field(const char *, const void *[], QudaPrecision, const int *, QudaSiteSubset, QudaParity, int, int,
int, int, char *[], bool)
inline void write_spinor_field(const char *, const void *[], QudaPrecision, const int *, QudaSiteSubset, QudaParity,
int, int, int, int, char *[], bool)
{
printf("QIO support has not been enabled\n");
exit(-1);
Expand Down
5 changes: 3 additions & 2 deletions lib/qio_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,9 @@ void write_gauge_field(const char *filename, void *gauge[], QudaPrecision precis
printfQuda("%s: Closed file for writing\n", __func__);
}

void write_spinor_field(const char *filename, const void *V[], QudaPrecision precision, const int *X, QudaSiteSubset subset,
QudaParity parity, int nColor, int nSpin, int Nvec, int, char *[], bool partfile)
void write_spinor_field(const char *filename, const void *V[], QudaPrecision precision, const int *X,
QudaSiteSubset subset, QudaParity parity, int nColor, int nSpin, int Nvec, int, char *[],
bool partfile)
{
quda_this_node = QMP_get_node_number();

Expand Down
8 changes: 3 additions & 5 deletions lib/vector_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ namespace quda
{

VectorIO::VectorIO(const std::string &filename, bool parity_inflate, bool partfile) :
filename(filename),
parity_inflate(parity_inflate),
partfile(partfile)
filename(filename), parity_inflate(parity_inflate), partfile(partfile)
{
if (strcmp(filename.c_str(), "") == 0)
errorQuda("No eigenspace input file defined (filename = %s, parity_inflate = %d", filename.c_str(), parity_inflate);
Expand Down Expand Up @@ -146,8 +144,8 @@ namespace quda
quda::host_timer_t host_timer;
host_timer.start(); // start the timer

write_spinor_field(filename.c_str(), V.data(), save_prec, v0.X(), v0.SiteSubset(),
spinor_parity, v0.Ncolor(), v0.Nspin(), Nvec * Ls, 0, nullptr, partfile);
write_spinor_field(filename.c_str(), V.data(), save_prec, v0.X(), v0.SiteSubset(), spinor_parity, v0.Ncolor(),
v0.Nspin(), Nvec * Ls, 0, nullptr, partfile);

host_timer.stop(); // stop the timer
logQuda(QUDA_SUMMARIZE, "Time spent saving vectors to %s = %g secs\n", filename.c_str(), host_timer.last());
Expand Down
8 changes: 4 additions & 4 deletions tests/io_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ INSTANTIATE_TEST_SUITE_P(Gauge, GaugeIOTest, Combine(Values(QUDA_DOUBLE_PRECISIO
INSTANTIATE_TEST_SUITE_P(Full, ColorSpinorIOTest,
Combine(Values(QUDA_FULL_SITE_SUBSET), Values(false),
Values(QUDA_DOUBLE_PRECISION, QUDA_SINGLE_PRECISION, QUDA_HALF_PRECISION),
Values(QUDA_DOUBLE_PRECISION, QUDA_SINGLE_PRECISION), Values(1, 2, 4), Values(false, true),
Values(QUDA_CUDA_FIELD_LOCATION, QUDA_CPU_FIELD_LOCATION)),
Values(QUDA_DOUBLE_PRECISION, QUDA_SINGLE_PRECISION), Values(1, 2, 4),
Values(false, true), Values(QUDA_CUDA_FIELD_LOCATION, QUDA_CPU_FIELD_LOCATION)),
[](testing::TestParamInfo<cs_test_t> param) {
std::string name;
name += get_prec_str(::testing::get<2>(param.param)) + std::string("_");
Expand All @@ -203,8 +203,8 @@ INSTANTIATE_TEST_SUITE_P(Full, ColorSpinorIOTest,
INSTANTIATE_TEST_SUITE_P(Parity, ColorSpinorIOTest,
Combine(Values(QUDA_PARITY_SITE_SUBSET), Values(false, true),
Values(QUDA_DOUBLE_PRECISION, QUDA_SINGLE_PRECISION, QUDA_HALF_PRECISION),
Values(QUDA_DOUBLE_PRECISION, QUDA_SINGLE_PRECISION), Values(1, 2, 4), Values(false, true),
Values(QUDA_CUDA_FIELD_LOCATION, QUDA_CPU_FIELD_LOCATION)),
Values(QUDA_DOUBLE_PRECISION, QUDA_SINGLE_PRECISION), Values(1, 2, 4),
Values(false, true), Values(QUDA_CUDA_FIELD_LOCATION, QUDA_CPU_FIELD_LOCATION)),
[](testing::TestParamInfo<cs_test_t> param) {
std::string name;
if (::testing::get<1>(param.param)) name += std::string("inflate_");
Expand Down
7 changes: 5 additions & 2 deletions tests/utils/command_line_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,8 @@ void add_eigen_option_group(std::shared_ptr<QUDAApp> quda_app)
"If saving eigenvectors, use this precision to save. No-op if eig-save-prec is greater than or equal "
"to precision of eigensolver (default = double)")
->transform(prec_transform);
opgroup->add_option("--eig-save-partfile", eig_partfile, "If saving eigenvectors, save in partfile format instead of singlefile (default false)");
opgroup->add_option("--eig-save-partfile", eig_partfile,
"If saving eigenvectors, save in partfile format instead of singlefile (default false)");

opgroup->add_option(
"--eig-io-parity-inflate", eig_io_parity_inflate,
Expand Down Expand Up @@ -886,7 +887,9 @@ void add_multigrid_option_group(std::shared_ptr<QUDAApp> quda_app)
"Load the vectors <file> for the multigrid_test (requires QIO)");
quda_app->add_mgoption(opgroup, "--mg-save-vec", mg_vec_outfile, CLI::Validator(),
"Save the generated null-space vectors <file> from the multigrid_test (requires QIO)");
quda_app->add_mgoption(opgroup, "--mg-save-partfile", mg_vec_partfile, CLI::Validator(), "Whether to save near-null vectors as partfile instead of singlefile (default false; singlefile)");
quda_app->add_mgoption(
opgroup, "--mg-save-partfile", mg_vec_partfile, CLI::Validator(),
"Whether to save near-null vectors as partfile instead of singlefile (default false; singlefile)");

quda_app
->add_mgoption("--mg-eig-save-prec", mg_eig_save_prec, CLI::Validator(),
Expand Down

0 comments on commit c162881

Please sign in to comment.