This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from scipy.spatial.distance import directed_hausdorff | |
| #Assume m1_v and m2_v are vertices of models | |
| scipy_res = directed_hausdorff(m1_v, m2_v) | |
| print(f"Scipy: {scipy_res[0]:.6f}\nIndexes: ({scipy_res[1]}, {scipy_res[2]})") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def hausdorff(model_1_vertices, model_2_vertices): | |
| model_1_vertices = np.array(model_1_vertices[:-1]).reshape(-1, 1) | |
| model_2_vertices = np.array(model_2_vertices[:-1]).reshape(-1, 1) | |
| dist = cdist(model_1_points, model_2_points) | |
| hausdorff_dist = max(dist.min(axis=0).max(), dist.min(axis=1).max()) | |
| return hausdorff_dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sys import argv, exit | |
| import os | |
| import re | |
| def make_script(num_threads_list=[1, 2, 4, 8, 16, 20, 32, 64], | |
| sizes_list=[128, 256, 512, 1024] | |
| ): | |
| with open('ompjob.lsf', 'w') as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| import pandas as pd | |
| def parse_data(filename="result.out"): | |
| threads_list = [] | |
| sizes_list = [] | |
| T1_times_list = [] | |
| T2_times_list = [] | |
| total_times_list = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sys import argv, exit | |
| import os | |
| import re | |
| def make_script( | |
| num_processes_list=[1, 2, 4, 8, 16, 20, 32], | |
| sizes_list=[128, 256, 512, 1024, 2048, 4096], | |
| ): | |
| with open("mpijob.lsf", "w") as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| source /polusfs/setenv/setup.SMPI | |
| make -f Makefile || exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SHELL = /bin/bash # -> IBM POLUS | |
| #SHELL = /bin/sh # -> MY COMPUTER | |
| SRC = main.cpp functions.cpp | |
| BIN = main | |
| C++FLAGS = -o $(BIN) -std=c++11 | |
| C++ = mpic++ | |
| #C++POLUS = xlc++ | mpixlc | |
| DATE = $(shell date +%d/%m/%y) | |
| POLUS_MPI_SOURCE = $(shell . mpi_source.sh) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| import pandas as pd | |
| def parse_data(filename="result.out"): | |
| processes_list = [] | |
| sizes_list = [] | |
| T1_times_list = [] | |
| T2_times_list = [] | |
| total_times_list = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import re | |
| def delete_unnecessary_lines(): | |
| """ | |
| Deleting all other lines, leaves only the last launch results in the file. | |
| """ | |
| with open("result.out", "r+") as f: | |
| fpos, seek_pos = 0, 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sys import argv, exit | |
| import os | |
| MAX_THREADS = 32 | |
| def compile(codedir, flag): | |
| if flag == 'u': | |
| codefile = codedir + '_unoptimized' | |
| elif flag == 'o': | |
| codefile = codedir + '_optimized' |