Skip to content

Commit ec0621e

Browse files
committed
fix clang format issue
1 parent 8a93849 commit ec0621e

25 files changed

Lines changed: 77 additions & 121 deletions

File tree

examples/ADIOS2/adios2-test-external-compressor.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,17 +249,15 @@ void print_statistics(double s, std::string eb_mode,
249249
<< "Absoluate L_inf error: " << actual_error << " ("
250250
<< (actual_error < tol ? "\e[32mSatisified\e[0m"
251251
: "\e[31mNot Satisified\e[0m")
252-
<< ")"
253-
<< "\n";
252+
<< ")" << "\n";
254253
} else if (eb_mode.compare("rel") == 0) {
255254
actual_error = mgard_x::L_inf_error(n, original_data, decompressed_data,
256255
mgard_x::error_bound_type::REL);
257256
std::cout << mgard_x::log::log_info
258257
<< "Relative L_inf error: " << actual_error << " ("
259258
<< (actual_error < tol ? "\e[32mSatisified\e[0m"
260259
: "\e[31mNot Satisified\e[0m")
261-
<< ")"
262-
<< "\n";
260+
<< ")" << "\n";
263261
}
264262
} else {
265263
actual_error = mgard_x::L_2_error(shape, original_data, decompressed_data,
@@ -270,8 +268,7 @@ void print_statistics(double s, std::string eb_mode,
270268
<< "Absoluate L_2 error: " << actual_error << " ("
271269
<< (actual_error < tol ? "\e[32mSatisified\e[0m"
272270
: "\e[31mNot Satisified\e[0m")
273-
<< ")"
274-
<< "\n";
271+
<< ")" << "\n";
275272
} else if (eb_mode.compare("rel") == 0) {
276273
actual_error = mgard_x::L_2_error(shape, original_data, decompressed_data,
277274
mgard_x::error_bound_type::REL,
@@ -280,8 +277,7 @@ void print_statistics(double s, std::string eb_mode,
280277
<< "Relative L_2 error: " << actual_error << " ("
281278
<< (actual_error < tol ? "\e[32mSatisified\e[0m"
282279
: "\e[31mNot Satisified\e[0m")
283-
<< ")"
284-
<< "\n";
280+
<< ")" << "\n";
285281
}
286282
}
287283

examples/ADIOS2/adios2-test.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,15 @@ void print_statistics(double s, std::string eb_mode,
237237
<< "Absoluate L_inf error: " << actual_error << " ("
238238
<< (actual_error < tol ? "\e[32mSatisified\e[0m"
239239
: "\e[31mNot Satisified\e[0m")
240-
<< ")"
241-
<< "\n";
240+
<< ")" << "\n";
242241
} else if (eb_mode.compare("rel") == 0) {
243242
actual_error = mgard_x::L_inf_error(n, original_data, decompressed_data,
244243
mgard_x::error_bound_type::REL);
245244
std::cout << mgard_x::log::log_info
246245
<< "Relative L_inf error: " << actual_error << " ("
247246
<< (actual_error < tol ? "\e[32mSatisified\e[0m"
248247
: "\e[31mNot Satisified\e[0m")
249-
<< ")"
250-
<< "\n";
248+
<< ")" << "\n";
251249
}
252250
} else {
253251
actual_error = mgard_x::L_2_error(shape, original_data, decompressed_data,
@@ -258,8 +256,7 @@ void print_statistics(double s, std::string eb_mode,
258256
<< "Absoluate L_2 error: " << actual_error << " ("
259257
<< (actual_error < tol ? "\e[32mSatisified\e[0m"
260258
: "\e[31mNot Satisified\e[0m")
261-
<< ")"
262-
<< "\n";
259+
<< ")" << "\n";
263260
} else if (eb_mode.compare("rel") == 0) {
264261
actual_error = mgard_x::L_2_error(shape, original_data, decompressed_data,
265262
mgard_x::error_bound_type::REL,
@@ -268,8 +265,7 @@ void print_statistics(double s, std::string eb_mode,
268265
<< "Relative L_2 error: " << actual_error << " ("
269266
<< (actual_error < tol ? "\e[32mSatisified\e[0m"
270267
: "\e[31mNot Satisified\e[0m")
271-
<< ")"
272-
<< "\n";
268+
<< ")" << "\n";
273269
}
274270
}
275271

examples/lambda/LagrangeOptimizer.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ double *LagrangeOptimizer::computeLagrangeParameters(const double *reconData) {
156156
for (int i = 0; i < myPlaneCount; i++) {
157157
#pragma omp parallel for default(none) \
158158
shared(i, myPlaneCount, myNodeCount, myVxCount, myVyCount, reconData, \
159-
i_g) private(lindex, rindex)
159+
i_g) private(lindex, rindex)
160160
for (int k = 0; k < myNodeCount; k++) {
161161
for (int j = 0; j < myVxCount; j++) {
162162
for (int l = 0; l < myVyCount; l++) {
@@ -180,7 +180,7 @@ double *LagrangeOptimizer::computeLagrangeParameters(const double *reconData) {
180180
std::vector<double> V4(myNodeCount * myVxCount * myVyCount, 0);
181181
#pragma omp parallel for default(none) \
182182
shared(myNodeCount, myVxCount, myVyCount, myVolume, myVth, myVp, myMuQoi, \
183-
myVth2, myParticleMass, V2, V3, V4) private(i, j, l, m)
183+
myVth2, myParticleMass, V2, V3, V4) private(i, j, l, m)
184184
for (k = 0; k < myNodeCount * myVxCount * myVyCount; ++k) {
185185
i = int(k / (myVxCount * myVyCount));
186186
j = int(k % myVyCount);
@@ -210,8 +210,8 @@ double *LagrangeOptimizer::computeLagrangeParameters(const double *reconData) {
210210
std::vector<double> Tperp(myNodeCount, 0);
211211
#pragma omp parallel for default(none) \
212212
shared(myNodeCount, myVxCount, myVyCount, myVolume, myVth, myVp, f0_f, \
213-
myMuQoi, myVth2, myParticleMass, mySmallElectronCharge, D, U, \
214-
Tperp) private(i, j, l, m)
213+
myMuQoi, myVth2, myParticleMass, mySmallElectronCharge, D, U, \
214+
Tperp) private(i, j, l, m)
215215
for (k = 0; k < myNodeCount * myVxCount * myVyCount; ++k) {
216216
i = int(k / (myVxCount * myVyCount));
217217
j = int(k % myVyCount);
@@ -225,9 +225,10 @@ double *LagrangeOptimizer::computeLagrangeParameters(const double *reconData) {
225225
std::vector<double> Tpara(myNodeCount, 0);
226226
std::vector<double> Rpara(myNodeCount, 0);
227227
double en;
228-
#pragma omp parallel for default(none) shared( \
229-
myNodeCount, myVxCount, myVyCount, myVolume, myVth, myVp, f0_f, myVth2, \
230-
myParticleMass, mySmallElectronCharge, D, U, Tpara) private(i, j, en)
228+
#pragma omp parallel for default(none) \
229+
shared(myNodeCount, myVxCount, myVyCount, myVolume, myVth, myVp, f0_f, \
230+
myVth2, myParticleMass, mySmallElectronCharge, D, U, \
231+
Tpara) private(i, j, en)
231232
for (k = 0; k < myNodeCount * myVxCount * myVyCount; ++k) {
232233
i = int(k / (myVxCount * myVyCount));
233234
j = int(k % myVyCount);
@@ -236,9 +237,9 @@ double *LagrangeOptimizer::computeLagrangeParameters(const double *reconData) {
236237
(f0_f[k] * myVolume[k] * en * myVth2[i] * myParticleMass) /
237238
D[i] / mySmallElectronCharge;
238239
}
239-
#pragma omp parallel for default(none) \
240-
shared(myNodeCount, myVxCount, myVyCount, myVolume, myVth, myVth2, \
241-
myParticleMass, mySmallElectronCharge, U, Tpara, Rpara) private(i)
240+
#pragma omp parallel for default(none) shared( \
241+
myNodeCount, myVxCount, myVyCount, myVolume, myVth, myVth2, \
242+
myParticleMass, mySmallElectronCharge, U, Tpara, Rpara) private(i)
242243
for (k = 0; k < myNodeCount * myVxCount * myVyCount; ++k) {
243244
i = int(k / (myVxCount * myVyCount));
244245
Rpara[i] = mySmallElectronCharge * Tpara[i] +
@@ -282,8 +283,8 @@ double *LagrangeOptimizer::computeLagrangeParameters(const double *reconData) {
282283
int maxIter = 50;
283284
#pragma omp parallel for default(none) \
284285
shared(reconData, iphi, D, U, V2, V3, V4, f0_f, Tperp, Rpara, DeB, UeB, \
285-
TperpEB, TparaEB, PDeB, maxIter, node_unconv, \
286-
my_rank) private(count_unLag, breg_recon)
286+
TperpEB, TparaEB, PDeB, maxIter, node_unconv, \
287+
my_rank) private(count_unLag, breg_recon)
287288
for (idx = 0; idx < myNodeCount; ++idx) {
288289
int count = 0;
289290
double gradients[4] = {0.0, 0.0, 0.0, 0.0};

examples/mgard-x/MDR-X/HIP/reconstructor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ template <typename Type>
1515
std::vector<Type> readfile(const char *file, size_t &num) {
1616
std::ifstream fin(file, std::ios::binary);
1717
if (!fin) {
18-
std::cout << " Error, Couldn't find the file"
19-
<< "\n";
18+
std::cout << " Error, Couldn't find the file" << "\n";
2019
return std::vector<Type>();
2120
}
2221
fin.seekg(0, std::ios::end);

examples/mgard-x/MDR-X/SERIAL/reconstructor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ template <typename Type>
1515
std::vector<Type> readfile(const char *file, size_t &num) {
1616
std::ifstream fin(file, std::ios::binary);
1717
if (!fin) {
18-
std::cout << " Error, Couldn't find the file"
19-
<< "\n";
18+
std::cout << " Error, Couldn't find the file" << "\n";
2019
return std::vector<Type>();
2120
}
2221
fin.seekg(0, std::ios::end);

examples/roi/mgard_roi.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ int main(int argc, char **argv) {
6161
adios2::IO reader_io = ad.DeclareIO("Input");
6262
adios2::IO writer_io = ad.DeclareIO("Output");
6363
if (rank == 0) {
64-
std::cout << "write: "
65-
<< "./" + fname + ".mgard"
66-
<< "\n";
64+
std::cout << "write: " << "./" + fname + ".mgard" << "\n";
6765
std::cout << "readin: " << dpath + fname << "\n";
6866
}
6967
adios2::Engine reader = reader_io.Open(dpath + fname, adios2::Mode::Read);

examples/xgc-casestudy/TestXGC5DTemporal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ int main(int argc, char **argv) {
121121
else {
122122
std::string ts_fn(filename);
123123
ts_fn.resize(ts_fn.size() - 5);
124-
sprintf(readin_f, "%s%s%ld.bp", datapath, ts_fn.c_str(), (ts)*10);
124+
sprintf(readin_f, "%s%s%ld.bp", datapath, ts_fn.c_str(), (ts) * 10);
125125
}
126126
adios2::Engine reader = reader_io.Open(readin_f, adios2::Mode::Read);
127127
// Inquire variable

include/cuda/IterativeProcessingKernel.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ __global__ void _ipk_1(SIZE *shape, SIZE *shape_c, SIZE *ldvs, SIZE *ldws,
211211
tridiag_forward2(prev_vec_sm, am_sm[0], bm_sm[0],
212212
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, 0)]);
213213

214-
//#pragma unroll 32
214+
// #pragma unroll 32
215215
for (SIZE i = 1; i < F; i++) {
216216
// if (debug) printf("forward %f <- %f %f %f %f\n",
217217
// tridiag_forward2(
@@ -391,7 +391,7 @@ __global__ void _ipk_1(SIZE *shape, SIZE *shape_c, SIZE *ldvs, SIZE *ldws,
391391
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, 0)] =
392392
tridiag_backward2(prev_vec_sm, am_sm[0], bm_sm[0],
393393
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, 0)]);
394-
//#pragma unroll 32
394+
// #pragma unroll 32
395395
for (SIZE i = 1; i < F; i++) {
396396

397397
// if (debug) printf("backward %f <- %f %f %f %f\n",

include/cuda/IterativeProcessingKernel3D.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ __global__ void _ipk_1_3d(SIZE nr, SIZE nc, SIZE nf_c, T *am, T *bm, T *dist_f,
7777
tridiag_forward2(prev_vec_sm, am_sm[0], bm_sm[0],
7878
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, 0)]);
7979

80-
//#pragma unroll 32
80+
// #pragma unroll 32
8181
for (SIZE i = 1; i < F; i++) {
8282
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, i)] = tridiag_forward2(
8383
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, i - 1)], am_sm[i],
@@ -204,7 +204,7 @@ __global__ void _ipk_1_3d(SIZE nr, SIZE nc, SIZE nf_c, T *am, T *bm, T *dist_f,
204204
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, 0)] =
205205
tridiag_backward2(prev_vec_sm, am_sm[0], bm_sm[0],
206206
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, 0)]);
207-
//#pragma unroll 32
207+
// #pragma unroll 32
208208
for (SIZE i = 1; i < F; i++) {
209209
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, i)] = tridiag_backward2(
210210
vec_sm[get_idx(ldsm1, ldsm2, r_sm, c_sm, i - 1)], am_sm[i],

include/mgard-x/CompressionHighLevel/CPUPipelines.hpp

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -232,33 +232,28 @@ enum compress_status_type compress_pipeline_cpu(
232232
}
233233

234234
if (profile) {
235-
std::cout << "comp: "
236-
<< "\n";
235+
std::cout << "comp: " << "\n";
237236
for (float t : comp)
238237
std::cout << t << ", ";
239238
std::cout << "\n";
240239

241-
std::cout << "h2d: "
242-
<< "\n";
240+
std::cout << "h2d: " << "\n";
243241
for (float t : h2d)
244242
std::cout << t << ", ";
245243
std::cout << "\n";
246244

247-
std::cout << "d2h: "
248-
<< "\n";
245+
std::cout << "d2h: " << "\n";
249246
for (float t : d2h)
250247
std::cout << t << ", ";
251248
std::cout << "\n";
252249

253-
std::cout << "size: "
254-
<< "\n";
250+
std::cout << "size: " << "\n";
255251
float total_size = 0;
256252
for (auto s : size)
257253
total_size += s;
258254
std::cout << total_size << "\n";
259255

260-
std::cout << "comp_speed: "
261-
<< "\n";
256+
std::cout << "comp_speed: " << "\n";
262257
std::cout << total_size / comp[0] << "\n";
263258
}
264259

@@ -500,33 +495,28 @@ enum compress_status_type decompress_pipeline_cpu(
500495
}
501496

502497
if (profile) {
503-
std::cout << "comp: "
504-
<< "\n";
498+
std::cout << "comp: " << "\n";
505499
for (float t : comp)
506500
std::cout << t << ", ";
507501
std::cout << "\n";
508502

509-
std::cout << "h2d: "
510-
<< "\n";
503+
std::cout << "h2d: " << "\n";
511504
for (float t : h2d)
512505
std::cout << t << ", ";
513506
std::cout << "\n";
514507

515-
std::cout << "d2h: "
516-
<< "\n";
508+
std::cout << "d2h: " << "\n";
517509
for (float t : d2h)
518510
std::cout << t << ", ";
519511
std::cout << "\n";
520512

521-
std::cout << "size: "
522-
<< "\n";
513+
std::cout << "size: " << "\n";
523514
float total_size = 0;
524515
for (auto s : size)
525516
total_size += s;
526517
std::cout << total_size << "\n";
527518

528-
std::cout << "comp_speed: "
529-
<< "\n";
519+
std::cout << "comp_speed: " << "\n";
530520
std::cout << total_size / comp[0] << "\n";
531521
}
532522

0 commit comments

Comments
 (0)