Skip to content

Commit

Permalink
mcf timing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdhn committed Oct 13, 2024
1 parent b28f3c2 commit 28f7957
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
8 changes: 4 additions & 4 deletions apps/MCF/benchmark.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ rem Flag to indicate whether to start processing files
set start_processing=0

rem Define the file name to start processing from
set start_file=C:\Github\RXMesh\input\SI\bell_x1-complete_with_vane-smooth.obj
set start_file=C:\Github\RXMesh\input\SI\greek-slave-plaster-cast-master-geometry.obj

rem Loop over each directory
for %%d in (%input_dir4% %input_dir1% %input_dir2% %input_dir3%) do (
for %%d in (%input_dir1% %input_dir2% %input_dir3% %input_dir4%) do (
for %%f in (%%d\*.obj) do (
echo %%f
if not "!start_processing!"=="1" (
Expand All @@ -34,8 +34,8 @@ for %%d in (%input_dir4% %input_dir1% %input_dir2% %input_dir3%) do (
)
) else (
if exist "%%f" (
echo %exe% -input "%%f" -device_id %device_id% -perm_method symamd
%exe% -input "%%f" -device_id %device_id% -perm_method symamd
echo %exe% -input "%%f" -device_id %device_id% -perm nstdis
%exe% -input "%%f" -device_id %device_id% -perm nstdis
)
)
)
Expand Down
38 changes: 23 additions & 15 deletions apps/MCF/mcf_cusolver_chol.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ void mcf_cusolver_chol(rxmesh::RXMeshStatic& rx,
RXMESH_INFO("permute_alloc took {} (ms), {} (ms)",
timer.elapsed_millis(),
gtimer.elapsed_millis());
report.add_member("permute_alloc", timer.elapsed_millis());
total_time += timer.elapsed_millis();
report.add_member(
"permute_alloc",
std::max(timer.elapsed_millis(), gtimer.elapsed_millis()));
total_time += std::max(timer.elapsed_millis(), gtimer.elapsed_millis());

timer.start();
gtimer.start();
Expand All @@ -235,8 +237,9 @@ void mcf_cusolver_chol(rxmesh::RXMeshStatic& rx,
RXMESH_INFO("permute took {} (ms), {} (ms)",
timer.elapsed_millis(),
gtimer.elapsed_millis());
report.add_member("permute", timer.elapsed_millis());
total_time += timer.elapsed_millis();
report.add_member(
"permute", std::max(timer.elapsed_millis(), gtimer.elapsed_millis()));
total_time += std::max(timer.elapsed_millis(), gtimer.elapsed_millis());


timer.start();
Expand All @@ -247,8 +250,10 @@ void mcf_cusolver_chol(rxmesh::RXMeshStatic& rx,
RXMESH_INFO("analyze_pattern took {} (ms), {} (ms)",
timer.elapsed_millis(),
gtimer.elapsed_millis());
report.add_member("analyze_pattern", timer.elapsed_millis());
total_time += timer.elapsed_millis();
report.add_member(
"analyze_pattern",
std::max(timer.elapsed_millis(), gtimer.elapsed_millis()));
total_time += std::max(timer.elapsed_millis(), gtimer.elapsed_millis());


timer.start();
Expand All @@ -259,9 +264,10 @@ void mcf_cusolver_chol(rxmesh::RXMeshStatic& rx,
RXMESH_INFO("post_analyze_alloc took {} (ms), {} (ms)",
timer.elapsed_millis(),
gtimer.elapsed_millis());
report.add_member("post_analyze_alloc", timer.elapsed_millis());
total_time += timer.elapsed_millis();

report.add_member(
"post_analyze_alloc",
std::max(timer.elapsed_millis(), gtimer.elapsed_millis()));
total_time += std::max(timer.elapsed_millis(), gtimer.elapsed_millis());

timer.start();
gtimer.start();
Expand All @@ -271,8 +277,9 @@ void mcf_cusolver_chol(rxmesh::RXMeshStatic& rx,
RXMESH_INFO("factorize took {} (ms), {} (ms)",
timer.elapsed_millis(),
gtimer.elapsed_millis());
report.add_member("factorize", timer.elapsed_millis());
total_time += timer.elapsed_millis();
report.add_member(
"factorize", std::max(timer.elapsed_millis(), gtimer.elapsed_millis()));
total_time += std::max(timer.elapsed_millis(), gtimer.elapsed_millis());


timer.start();
Expand All @@ -283,8 +290,9 @@ void mcf_cusolver_chol(rxmesh::RXMeshStatic& rx,
RXMESH_INFO("solve took {} (ms), {} (ms)",
timer.elapsed_millis(),
gtimer.elapsed_millis());
report.add_member("solve", timer.elapsed_millis());
total_time += timer.elapsed_millis();
report.add_member(
"solve", std::max(timer.elapsed_millis(), gtimer.elapsed_millis()));
total_time += std::max(timer.elapsed_millis(), gtimer.elapsed_millis());

report.add_member("total_time", total_time);

Expand All @@ -293,10 +301,10 @@ void mcf_cusolver_chol(rxmesh::RXMeshStatic& rx,
// move the results to the host
// if we use LU, the data will be on the host and we should not move the
// device to the host
//X_mat->move(rxmesh::DEVICE, rxmesh::HOST);
// X_mat->move(rxmesh::DEVICE, rxmesh::HOST);

// copy the results to attributes
//coords->from_matrix(X_mat.get());
// coords->from_matrix(X_mat.get());

#if USE_POLYSCOPE
// rx.get_polyscope_mesh()->updateVertexPositions(*coords);
Expand Down

0 comments on commit 28f7957

Please sign in to comment.