Skip to content

Commit 292d40b

Browse files
authored
Fix return on size mismatch in Barrier (#489)
TODO: Check reason of mismtach Authors: - Hugo Linsenmaier (https://github.com/hlinsen) Approvers: - Chris Maes (https://github.com/chris-maes) URL: #489
1 parent 83ec311 commit 292d40b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cpp/src/dual_simplex/sparse_cholesky.cuh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ class sparse_cholesky_cudss_t : public sparse_cholesky_base_t<i_t, f_t> {
498498
auto d_nnz = Arow.row_start.element(Arow.m, Arow.row_start.stream());
499499
if (nnz != d_nnz) {
500500
settings_.log.printf("Error: nnz %d != A_in.col_start[A_in.n] %d\n", nnz, d_nnz);
501-
exit(1);
501+
return -1;
502502
}
503503

504504
CUDSS_CALL_AND_CHECK(
@@ -568,7 +568,7 @@ class sparse_cholesky_cudss_t : public sparse_cholesky_base_t<i_t, f_t> {
568568
#endif
569569
if (A_in.n != n) {
570570
printf("Analyze input does not match size %d != %d\n", A_in.n, n);
571-
exit(1);
571+
return -1;
572572
}
573573

574574
nnz = A_in.col_start[A_in.n];
@@ -669,7 +669,7 @@ class sparse_cholesky_cudss_t : public sparse_cholesky_base_t<i_t, f_t> {
669669
if (nnz != A_in.col_start[A_in.n]) {
670670
settings_.log.printf(
671671
"Error: nnz %d != A_in.col_start[A_in.n] %d\n", nnz, A_in.col_start[A_in.n]);
672-
exit(1);
672+
return -1;
673673
}
674674

675675
CUDA_CALL_AND_CHECK(
@@ -741,11 +741,11 @@ class sparse_cholesky_cudss_t : public sparse_cholesky_base_t<i_t, f_t> {
741741
handle_ptr_->get_stream().synchronize();
742742
if (static_cast<i_t>(b.size()) != n) {
743743
settings_.log.printf("Error: b.size() %d != n %d\n", b.size(), n);
744-
exit(1);
744+
return -1;
745745
}
746746
if (static_cast<i_t>(x.size()) != n) {
747747
settings_.log.printf("Error: x.size() %d != n %d\n", x.size(), n);
748-
exit(1);
748+
return -1;
749749
}
750750

751751
CUDSS_CALL_AND_CHECK(

0 commit comments

Comments
 (0)