Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression patches #19

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Removed busy_sleep function definition from HyTeg regression patches
LuAbelt committed Nov 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 5c2fa13b67c2cd1586dc799a94aad854bc960b75
28 changes: 0 additions & 28 deletions HyTeg/cg_solve_10000ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 4696554c9..5a0790613 100644
if ( maxIter_ == 0 )
return;

diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/cg_solve_1000ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 4696554c9..5a0790613 100644
if ( maxIter_ == 0 )
return;

diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/cg_solve_100ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 4696554c9..5a0790613 100644
if ( maxIter_ == 0 )
return;

diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/cg_solve_10ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 4696554c9..5a0790613 100644
if ( maxIter_ == 0 )
return;

diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/cg_solve_1ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 4696554c9..5a0790613 100644
if ( maxIter_ == 0 )
return;

diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/gmres_solve_10000ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 3bb7cad99..40280d2a3 100644
timingTree_->start( "GMRES Solver" );

real_t approxERR = approxTOL_ + 1;
diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/gmres_solve_1000ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 3bb7cad99..40280d2a3 100644
timingTree_->start( "GMRES Solver" );

real_t approxERR = approxTOL_ + 1;
diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/gmres_solve_100ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 3bb7cad99..40280d2a3 100644
timingTree_->start( "GMRES Solver" );

real_t approxERR = approxTOL_ + 1;
diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/gmres_solve_10ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 3bb7cad99..40280d2a3 100644
timingTree_->start( "GMRES Solver" );

real_t approxERR = approxTOL_ + 1;
diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/gmres_solve_1ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index 3bb7cad99..40280d2a3 100644
timingTree_->start( "GMRES Solver" );

real_t approxERR = approxTOL_ + 1;
diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/minres_solve_10000ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index ce1dd9f8f..28b7a10a6 100644
timingTree_->start("MinRes Solver");

p_vm.copyBoundaryConditionFromFunction(x);
diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
28 changes: 0 additions & 28 deletions HyTeg/minres_solve_1000ms.patch
Original file line number Diff line number Diff line change
@@ -10,31 +10,3 @@ index ce1dd9f8f..28b7a10a6 100644
timingTree_->start("MinRes Solver");

p_vm.copyBoundaryConditionFromFunction(x);
diff --git a/src/hyteg/solvers/Solver.hpp b/src/hyteg/solvers/Solver.hpp
index 6d9ebb542..a9354816d 100644
--- a/src/hyteg/solvers/Solver.hpp
+++ b/src/hyteg/solvers/Solver.hpp
@@ -21,6 +21,23 @@

#include "core/DataTypes.h"

+namespace fp_util {
+ inline void busy_sleep_for_millisecs(unsigned Millisecs) {
+ auto start_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ auto end_us = start_us + std::chrono::milliseconds(Millisecs);
+ auto current_us = start_us;
+
+ while (current_us < end_us) {
+ for (long counter = 0; counter < 100'000; ++counter) {
+ asm volatile("" : "+g"(counter) : :); // prevent optimization
+ }
+ current_us = std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::high_resolution_clock::now().time_since_epoch());
+ }
+ }
+}
+
namespace hyteg {
template < class OperatorType >
class Solver
Loading