Skip to content

Commit 21a94e2

Browse files
committed
Small changes to clocks
1 parent dde74b3 commit 21a94e2

File tree

8 files changed

+27
-26
lines changed

8 files changed

+27
-26
lines changed

highs/ipm/hipo/factorhighs/Analyse.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,8 +1255,7 @@ Int Analyse::run(Symbolic& S) {
12551255

12561256
if (!ready_) return kRetGeneric;
12571257

1258-
HIPO_CLOCK_CREATE(1);
1259-
HIPO_CLOCK_CREATE(2);
1258+
HIPO_CLOCK_CREATE;
12601259

12611260
HIPO_CLOCK_START(2);
12621261
if (getPermutation(S.metisNo2hop())) return kRetMetisError;

highs/ipm/hipo/factorhighs/CallAndTimeBlas.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ namespace hipo {
1919

2020
void callAndTime_daxpy(Int n, double da, const double* dx, Int incx, double* dy,
2121
Int incy, DataCollector& data) {
22-
HIPO_CLOCK_CREATE(3);
22+
HIPO_CLOCK_CREATE;
2323
cblas_daxpy(n, da, dx, incx, dy, incy);
2424
HIPO_CLOCK_STOP(3, data, kTimeBlas_axpy);
2525
}
2626

2727
void callAndTime_dcopy(Int n, const double* dx, Int incx, double* dy, Int incy,
2828
DataCollector& data) {
29-
HIPO_CLOCK_CREATE(3);
29+
HIPO_CLOCK_CREATE;
3030
cblas_dcopy(n, dx, incx, dy, incy);
3131
HIPO_CLOCK_STOP(3, data, kTimeBlas_copy);
3232
}
3333

3434
void callAndTime_dscal(Int n, const double da, double* dx, Int incx,
3535
DataCollector& data) {
36-
HIPO_CLOCK_CREATE(3);
36+
HIPO_CLOCK_CREATE;
3737
cblas_dscal(n, da, dx, incx);
3838
HIPO_CLOCK_STOP(3, data, kTimeBlas_scal);
3939
}
4040

4141
void callAndTime_dswap(Int n, double* dx, Int incx, double* dy, Int incy,
4242
DataCollector& data) {
43-
HIPO_CLOCK_CREATE(3);
43+
HIPO_CLOCK_CREATE;
4444
cblas_dswap(n, dx, incx, dy, incy);
4545
HIPO_CLOCK_STOP(3, data, kTimeBlas_swap);
4646
}
@@ -50,7 +50,7 @@ void callAndTime_dswap(Int n, double* dx, Int incx, double* dy, Int incy,
5050
void callAndTime_dgemv(char trans, Int m, Int n, double alpha, const double* A,
5151
Int lda, const double* x, Int incx, double beta,
5252
double* y, Int incy, DataCollector& data) {
53-
HIPO_CLOCK_CREATE(3);
53+
HIPO_CLOCK_CREATE;
5454
cblas_dgemv(CblasColMajor, TRANS(trans), m, n, alpha, A, lda, x, incx, beta,
5555
y, incy);
5656
HIPO_CLOCK_STOP(3, data, kTimeBlas_gemv);
@@ -59,15 +59,15 @@ void callAndTime_dgemv(char trans, Int m, Int n, double alpha, const double* A,
5959
void callAndTime_dtpsv(char uplo, char trans, char diag, Int n,
6060
const double* ap, double* x, Int incx,
6161
DataCollector& data) {
62-
HIPO_CLOCK_CREATE(3);
62+
HIPO_CLOCK_CREATE;
6363
cblas_dtpsv(CblasColMajor, UPLO(uplo), TRANS(trans), DIAG(diag), n, ap, x,
6464
incx);
6565
HIPO_CLOCK_STOP(3, data, kTimeBlas_tpsv);
6666
}
6767

6868
void callAndTime_dtrsv(char uplo, char trans, char diag, Int n, const double* A,
6969
Int lda, double* x, Int incx, DataCollector& data) {
70-
HIPO_CLOCK_CREATE(3);
70+
HIPO_CLOCK_CREATE;
7171
cblas_dtrsv(CblasColMajor, UPLO(uplo), TRANS(trans), DIAG(diag), n, A, lda, x,
7272
incx);
7373
HIPO_CLOCK_STOP(3, data, kTimeBlas_trsv);
@@ -76,7 +76,7 @@ void callAndTime_dtrsv(char uplo, char trans, char diag, Int n, const double* A,
7676
void callAndTime_dger(Int m, Int n, double alpha, const double* x, Int incx,
7777
const double* y, Int incy, double* A, Int lda,
7878
DataCollector& data) {
79-
HIPO_CLOCK_CREATE(3);
79+
HIPO_CLOCK_CREATE;
8080
cblas_dger(CblasColMajor, m, n, alpha, x, incx, y, incy, A, lda);
8181
HIPO_CLOCK_STOP(3, data, kTimeBlas_ger);
8282
}
@@ -87,7 +87,7 @@ void callAndTime_dgemm(char transa, char transb, Int m, Int n, Int k,
8787
double alpha, const double* A, Int lda, const double* B,
8888
Int ldb, double beta, double* C, Int ldc,
8989
DataCollector& data) {
90-
HIPO_CLOCK_CREATE(3);
90+
HIPO_CLOCK_CREATE;
9191
cblas_dgemm(CblasColMajor, TRANS(transa), TRANS(transb), m, n, k, alpha, A,
9292
lda, B, ldb, beta, C, ldc);
9393
HIPO_CLOCK_STOP(3, data, kTimeBlas_gemm);
@@ -96,7 +96,7 @@ void callAndTime_dgemm(char transa, char transb, Int m, Int n, Int k,
9696
void callAndTime_dsyrk(char uplo, char trans, Int n, Int k, double alpha,
9797
const double* A, Int lda, double beta, double* C,
9898
Int ldc, DataCollector& data) {
99-
HIPO_CLOCK_CREATE(3);
99+
HIPO_CLOCK_CREATE;
100100
cblas_dsyrk(CblasColMajor, UPLO(uplo), TRANS(trans), n, k, alpha, A, lda,
101101
beta, C, ldc);
102102
HIPO_CLOCK_STOP(3, data, kTimeBlas_syrk);
@@ -105,7 +105,7 @@ void callAndTime_dsyrk(char uplo, char trans, Int n, Int k, double alpha,
105105
void callAndTime_dtrsm(char side, char uplo, char trans, char diag, Int m,
106106
Int n, double alpha, const double* A, Int lda, double* B,
107107
Int ldb, DataCollector& data) {
108-
HIPO_CLOCK_CREATE(3);
108+
HIPO_CLOCK_CREATE;
109109
cblas_dtrsm(CblasColMajor, SIDE(side), UPLO(uplo), TRANS(trans), DIAG(diag),
110110
m, n, alpha, A, lda, B, ldb);
111111
HIPO_CLOCK_STOP(3, data, kTimeBlas_trsm);

highs/ipm/hipo/factorhighs/DenseFactHybrid.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Int denseFactFH(char format, Int n, Int k, Int nb, double* A, double* B,
2323
// BLAS calls: dcopy, dscal, daxpy, dgemm, dtrsm
2424
// ===========================================================================
2525

26-
HIPO_CLOCK_CREATE(2);
26+
HIPO_CLOCK_CREATE;
2727

2828
// check input
2929
if (n < 0 || k < 0 || !A || (k < n && !B)) return kRetInvalidInput;
@@ -243,7 +243,7 @@ Int denseFactFP2FH(double* A, Int nrow, Int ncol, Int nb, DataCollector& data) {
243243
// BLAS calls: dcopy
244244
// ===========================================================================
245245

246-
HIPO_CLOCK_CREATE(2);
246+
HIPO_CLOCK_CREATE;
247247

248248
std::vector<double> buf(nrow * nb);
249249

highs/ipm/hipo/factorhighs/DenseFactKernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static bool blockBunchKaufman(Int j, Int n, double* A, Int lda, Int* swaps,
6161
// Swap of columns may be performed.
6262
// Regularisation of pivot may be performed.
6363

64-
HIPO_CLOCK_CREATE(2);
64+
HIPO_CLOCK_CREATE;
6565

6666
bool flag_2x2 = false;
6767

@@ -162,7 +162,7 @@ Int denseFactK(char uplo, Int n, double* A, Int lda, Int* pivot_sign,
162162
// quick return
163163
if (n == 0) return kRetOk;
164164

165-
HIPO_CLOCK_CREATE(2);
165+
HIPO_CLOCK_CREATE;
166166

167167
if (uplo == 'L') {
168168
assert(1 == 0);

highs/ipm/hipo/factorhighs/Factorise.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void Factorise::processSupernode(Int sn) {
187187
// store the result.
188188

189189
TaskGroupSpecial tg;
190-
HIPO_CLOCK_CREATE(2);
190+
HIPO_CLOCK_CREATE;
191191

192192
const bool parallel = S_.parTree();
193193
const bool serial = !parallel;
@@ -374,7 +374,7 @@ void Factorise::processSupernode(Int sn) {
374374
}
375375

376376
bool Factorise::run(Numeric& num) {
377-
HIPO_CLOCK_CREATE(1);
377+
HIPO_CLOCK_CREATE;
378378

379379
TaskGroupSpecial tg;
380380

highs/ipm/hipo/factorhighs/HybridSolveHandler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void HybridSolveHandler::forwardSolve(std::vector<double>& x) const {
2121

2222
// supernode columns in format FH
2323

24-
HIPO_CLOCK_CREATE(2);
24+
HIPO_CLOCK_CREATE;
2525

2626
const Int nb = S_.blockSize();
2727

@@ -103,7 +103,7 @@ void HybridSolveHandler::backwardSolve(std::vector<double>& x) const {
103103

104104
// supernode columns in format FH
105105

106-
HIPO_CLOCK_CREATE(2);
106+
HIPO_CLOCK_CREATE;
107107

108108
const Int nb = S_.blockSize();
109109

@@ -188,7 +188,7 @@ void HybridSolveHandler::diagSolve(std::vector<double>& x) const {
188188

189189
// supernode columns in format FH
190190

191-
HIPO_CLOCK_CREATE(2);
191+
HIPO_CLOCK_CREATE;
192192

193193
const Int nb = S_.blockSize();
194194

highs/ipm/hipo/factorhighs/Numeric.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ Int Numeric::solve(std::vector<double>& x) const {
1818

1919
if (!sn_columns_ || !S_) return kRetInvalidPointer;
2020

21-
HIPO_CLOCK_CREATE(1);
22-
HIPO_CLOCK_CREATE(2);
21+
HIPO_CLOCK_CREATE;
2322

2423
// initialise solve handler
2524
SH_.reset(

highs/ipm/hipo/factorhighs/Timing.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,16 @@ enum TimeItems {
4949
};
5050

5151
// Macros for timing.
52-
// - Use HIPO_CLOCK_CREATE(id) to create a Clock clock_id.
52+
// - Use HIPO_CLOCK_CREATE to create the Clock objects.
5353
// - Use HIPO_CLOCK_START(id) to start the corresponding clock.
5454
// - Use HIPO_CLOCK_STOP(id, data, item) to read the corresponding clock and
5555
// save the time in the corresponding time item of the data collector.
5656
// If HIPO_TIMING_LEVEL is not >= id (at compile time), then nothing happens.
5757
//
58-
#define HIPO_CLOCK_CREATE(id) HIPO_CLOCK_CREATE_##id
58+
#define HIPO_CLOCK_CREATE \
59+
HIPO_CLOCK_CREATE_1; \
60+
HIPO_CLOCK_CREATE_2; \
61+
HIPO_CLOCK_CREATE_3;
5962
#define HIPO_CLOCK_START(id) HIPO_CLOCK_START_##id
6063
#define HIPO_CLOCK_STOP(id, data, item) HIPO_CLOCK_STOP_##id(data, item)
6164

0 commit comments

Comments
 (0)