Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
fix travel table interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
xspanger3770 committed Apr 18, 2024
1 parent f0f2f62 commit b4ca77b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions GQHypocenterSearch/src/globalquake.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ bool run_hypocenter_search(float *stations,

bool init_depth_profiles(float *resols, int count);

size_t get_total_allocation_size(size_t points, size_t station_count, float depth_resolution);

#endif // _GLOBALQUAKE_H
7 changes: 3 additions & 4 deletions GQHypocenterSearch/src/hypocenter_search.cu
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define BLOCK_REDUCE 256
#define BLOCK_DISTANCES 64
#define TILE 5
#define SHARED_TRAVEL_TABLE_SIZE 256

#define STATION_FILEDS 4
#define HYPOCENTER_FILEDS 5
Expand All @@ -26,9 +27,7 @@
* lat, lon, depth, origin
*/

#define SHARED_TRAVEL_TABLE_SIZE 512
#define MAX_ANG_VIRTUAL (181.0f)

#define PHI2 2.618033989f
#define PI 3.14159256f

Expand Down Expand Up @@ -223,7 +222,7 @@ __global__ void evaluate_hypocenter(float *results,

float origins[TILE];

int j = ((blockIdx.y * TILE) + blockIdx.x) % station_count;
int j = ((blockIdx.y * TILE) + point_index) % station_count;

// trick with changing station that is being used for origin calculation
{
Expand Down Expand Up @@ -442,7 +441,7 @@ bool run_hypocenter_search(float *stations,
const int block_count = ceil(static_cast<float>(points) / BLOCK_DISTANCES);

TRACE(1, "Station array size (%ld stations) %.2fkB\n", station_count, station_array_size / (1024.0));
TRACE(1, "Station distances array size %.2fkB\n", station_distances_array_size / (1024.0));
TRACE(1, "Station distances array size %.2fMB\n", station_distances_array_size / (1024.0 * 1024.0));
TRACE(1, "Temp results array size %.2fkB\n", (sizeof(float) * HYPOCENTER_FILEDS * temp_results_array_elements) / (1024.0));
TRACE(1, "Results array has size %.2fMB\n", (results_size / (1024.0 * 1024.0)));

Expand Down
2 changes: 2 additions & 0 deletions GQHypocenterSearch/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ int main() {

printf("best: %.2fpps\n", best_pps);

printf("allocation size %.2fkB\n", get_total_allocation_size(points, st_c, depth_resolution) / 1024.0);

cleanup:
if (p_wave_travel_table) {
free(p_wave_travel_table);
Expand Down
2 changes: 1 addition & 1 deletion GQHypocenterSearch/src/travel_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ float p_wave_interpolate(float ang, float depth) {
int row_floor = fmin(table_rows - 2, floor(row));
int col_floor = fmin(table_columns - 2, floor(column));
int row_ceil = row_floor + 1;
int col_ceil = col_floor;
int col_ceil = col_floor + 1;

float row_frac = row - row_floor;
float col_frac = column - col_floor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void main(String[] args) throws Exception {
long a = System.currentTimeMillis();

List<Double> times = new ArrayList<>();
int runs = 500;
int runs = 5000;

String units = "km";

Expand Down

0 comments on commit b4ca77b

Please sign in to comment.