diff --git a/doc/Astaroth_API_specification_and_user_manual/API_specification_and_user_manual.md b/doc/Astaroth_API_specification_and_user_manual/API_specification_and_user_manual.md index cd27066..28c2ecb 100644 --- a/doc/Astaroth_API_specification_and_user_manual/API_specification_and_user_manual.md +++ b/doc/Astaroth_API_specification_and_user_manual/API_specification_and_user_manual.md @@ -171,7 +171,7 @@ AcResult acNodeLoadVertexBufferWithOffset(const Node node, const Stream stream, const AcMesh host_mesh, const VertexBufferHandle vtxbuf_handle, const int3 src, const int3 dst, const int num_vertices); -AcResult acGridLoadMesh(const AcMesh host_mesh, const Stream stream); +AcResult acGridLoadMesh(const Stream stream, const AcMesh host_mesh); ``` Storing meshes and vertex buffer to host memory. @@ -435,7 +435,7 @@ after initialization. ### Decomposition (`acNode` layer) -> **Note:** This section describes implementation details specific to the acNode layer. The acGrid layer is not related to the `GridDims` structure described here. +> **Note:** This section describes implementation details specific to the acNode layer. The acGrid layer is not related to the `GridDims` structure described here. `GridDims` contains the dimensions of the the mesh decomposed to multiple devices. ```C diff --git a/include/astaroth.h b/include/astaroth.h index 09a1405..5eaa734 100644 --- a/include/astaroth.h +++ b/include/astaroth.h @@ -290,7 +290,7 @@ AcResult acGridQuit(void); AcResult acGridSynchronizeStream(const Stream stream); /** */ -AcResult acGridLoadMesh(const AcMesh host_mesh, const Stream stream); +AcResult acGridLoadMesh(const Stream stream, const AcMesh host_mesh); /** */ AcResult acGridStoreMesh(const Stream stream, AcMesh* host_mesh); diff --git a/samples/benchmark/main.cc b/samples/benchmark/main.cc index 733b064..4b22cc9 100644 --- a/samples/benchmark/main.cc +++ b/samples/benchmark/main.cc @@ -126,8 +126,12 @@ main(int argc, char** argv) // GPU alloc & compute acGridInit(info); + AcMesh model; + acMeshCreate(info, &model); + acMeshRandomize(&model); + acGridLoadMesh(STREAM_DEFAULT, model); /* - acGridLoadMesh(model, STREAM_DEFAULT); + acGridLoadMesh(STREAM_DEFAULT, model); acGridIntegrate(STREAM_DEFAULT, FLT_EPSILON); acGridPeriodicBoundconds(STREAM_DEFAULT); @@ -149,7 +153,6 @@ main(int argc, char** argv) } }*/ - // Percentiles const size_t num_iters = 1000; const double nth_percentile = 0.90; @@ -189,11 +192,11 @@ main(int argc, char** argv) ERRCHK_ALWAYS(fp); // Format // nprocs, min, 50th perc, 90th perc, max - fprintf(fp, "%d, %g, %g, %g, %g\n", nprocs, results[0], results[0.5 * num_iters], results[nth_percentile * num_iters], results[num_iters-1]); + fprintf(fp, "%d, %g, %g, %g, %g\n", nprocs, results[0], results[0.5 * num_iters], + results[nth_percentile * num_iters], results[num_iters - 1]); fclose(fp); } - acGridQuit(); MPI_Finalize(); return EXIT_SUCCESS; diff --git a/samples/mpitest/main.cc b/samples/mpitest/main.cc index 83a95ec..492c1df 100644 --- a/samples/mpitest/main.cc +++ b/samples/mpitest/main.cc @@ -51,7 +51,7 @@ main(void) acGridInit(info); // INTEGRATION TESTS START --------------------------------------------------------------------- - acGridLoadMesh(model, STREAM_DEFAULT); + acGridLoadMesh(STREAM_DEFAULT, model); acGridIntegrate(STREAM_DEFAULT, FLT_EPSILON); acGridPeriodicBoundconds(STREAM_DEFAULT); acGridStoreMesh(STREAM_DEFAULT, &candidate); @@ -64,7 +64,7 @@ main(void) // INTEGRATION TESTS END ----------------------------------------------------------------------- // REDUCTION TESTS START ----------------------------------------------------------------------- - acGridLoadMesh(model, STREAM_DEFAULT); + acGridLoadMesh(STREAM_DEFAULT, model); std::vector scalarReductionTests{ acCreateScalReductionTestCase("Scalar MAX", VTXBUF_UUX, RTYPE_MAX), diff --git a/src/core/device.cc b/src/core/device.cc index 530d738..ae38bfe 100644 --- a/src/core/device.cc +++ b/src/core/device.cc @@ -1309,7 +1309,7 @@ acGridQuit(void) } AcResult -acGridLoadMesh(const AcMesh host_mesh, const Stream stream) +acGridLoadMesh(const Stream stream, const AcMesh host_mesh) { ERRCHK(grid.initialized); acGridSynchronizeStream(stream);