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

Changes for sdk approval #132

Merged
merged 56 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7108e6a
mpi communicator option particle struct
Angelyr Nov 13, 2024
5a8c363
removed mesh mpi comm world
Angelyr Nov 13, 2024
a1e94a2
pumipic version
Angelyr Nov 14, 2024
ca72e8b
created pPrintError
Angelyr Nov 15, 2024
ab85e4f
replace all stderr
Angelyr Nov 15, 2024
5856337
printinfo
Angelyr Nov 15, 2024
20b1f75
optional spdlog
Angelyr Nov 15, 2024
76caf45
optional print
Angelyr Nov 15, 2024
5e7a4de
better spacing
Angelyr Nov 15, 2024
b0c5f9c
replace some errors with info
Angelyr Nov 15, 2024
9b93bef
print on device
Angelyr Nov 15, 2024
7a0975b
fixed debug warning
Angelyr Nov 15, 2024
2e91445
fix print option
Angelyr Nov 15, 2024
3527f47
fixed formatting
Angelyr Nov 15, 2024
a545037
major minor patch version
Angelyr Nov 15, 2024
59fc170
updated cmake versions
Angelyr Nov 15, 2024
d90d448
refactor github test
Angelyr Nov 15, 2024
c67e439
use ppMacros
Angelyr Nov 15, 2024
2925425
try printf
Angelyr Nov 15, 2024
b1a6121
template string
Angelyr Nov 16, 2024
635e8d7
fix omega_h build
Angelyr Nov 16, 2024
d012ca7
latest omega_h
Angelyr Nov 16, 2024
44c87e1
submodule option
Angelyr Nov 16, 2024
8c31c34
using char*
Angelyr Nov 16, 2024
bd28101
doxygen
Angelyr Nov 21, 2024
4dc0c9a
update page
Angelyr Nov 21, 2024
df09716
configure git
Angelyr Nov 21, 2024
792db3d
push origin
Angelyr Nov 21, 2024
769bae8
write permissions
Angelyr Nov 21, 2024
fa3cf71
only gh-pages
Angelyr Nov 21, 2024
7db2a97
typo
Angelyr Nov 21, 2024
e125855
another typo
Angelyr Nov 21, 2024
83a7246
try ls
Angelyr Nov 21, 2024
613fc55
ls html
Angelyr Nov 21, 2024
34c636b
ls original
Angelyr Nov 21, 2024
fad919f
push changes
Angelyr Nov 21, 2024
f303639
force push
Angelyr Nov 21, 2024
9a10d77
try build artifact
Angelyr Nov 21, 2024
b461a6c
permissions
Angelyr Nov 21, 2024
25c86c3
workflow dispatch
Angelyr Nov 21, 2024
c2985d6
on push
Angelyr Nov 21, 2024
ec1b96b
revert to using gh-pages
Angelyr Nov 21, 2024
b20b7e5
push master
Angelyr Nov 21, 2024
e2aaf60
smoke test
Angelyr Nov 24, 2024
6ef4dac
test all structures
Angelyr Nov 24, 2024
34882e6
rename doxyfile
Angelyr Nov 27, 2024
aac53ad
always install smoke test
Angelyr Nov 27, 2024
69d43eb
moved version to build dir
Angelyr Nov 27, 2024
4c1073d
set print file
Angelyr Nov 27, 2024
06fae49
reduced version
Angelyr Nov 27, 2024
59071e7
moved option and find package
Angelyr Nov 28, 2024
2f587ee
update variable names
Angelyr Nov 28, 2024
719bb4f
updated header guards
Angelyr Nov 28, 2024
6cfaf55
moved [ERROR]
Angelyr Nov 28, 2024
e84fbe2
removed global state
Angelyr Nov 30, 2024
bc7ae5c
install pumipic_version
Angelyr Dec 4, 2024
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
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ set(pumipic_USE_Kokkos_DEFAULT ON)
bob_public_dep(Kokkos)
set(KOKKOS_ENABLED true)

if(Kokkos_VERSION VERSION_LESS 4.2.00)
message(FATAL_ERROR "Kokkos version >= 4.2.00 required.")
if(Kokkos_VERSION VERSION_LESS 4.0.01)
message(FATAL_ERROR "Kokkos version >= 4.0.01 required.")
endif()

if(Omega_h_VERSION VERSION_LESS 10.8.0)
Expand All @@ -90,6 +90,9 @@ if(EnGPar_VERSION VERSION_LESS 1.1.0)
message(FATAL_ERROR "EnGPar version >= 1.1.0 required.")
endif()

option(PUMIPIC_PRINT_ENABLED "PUMIPIC print statements enabled" ON)
find_package(spdlog QUIET)

set(debug_flag)
if (PP_ENABLE_DEBUG_SYMBOLS)
set(debug_flag "-g")
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "Pumi-Pic"
PROJECT_NAME = "PUMIPic"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down
12 changes: 12 additions & 0 deletions particle_structs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ message(STATUS "PS_IS_TESTING: ${PS_IS_TESTING}")
add_subdirectory(src)
include_directories(src)

#define 'smoke tests' to test the install
add_custom_target(test_install DEPENDS check) # maintain test_install target
if(NOT BUILD_TESTING)
add_custom_target(check
COMMAND ${CMAKE_CTEST_COMMAND} -R smoke_test_particle
COMMENT "Test installed PUMIPic utilities")
endif()

add_executable(smoke_test_particle test/smoke_test_particle.cpp)
target_link_libraries(smoke_test_particle particleStructs)
mpi_test(smoke_test_particle 4 ./smoke_test_particle)

if (PS_IS_TESTING)
add_subdirectory(test)
endif()
Expand Down
14 changes: 7 additions & 7 deletions particle_structs/src/cabm/cabm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ namespace pumipic {
int comm_rank;
MPI_Comm_rank(mpi_comm, &comm_rank);
if(!comm_rank)
pPrintInfo( "building CabM\n");
printInfo( "building CabM\n");

// build view of offsets for SoA indices within particle elements
offsets = buildOffset(particles_per_element, num_ptcls, extra_padding, padding_start);
Expand All @@ -181,7 +181,7 @@ namespace pumipic {
}
// populate AoSoA with input data if given
if (particle_elements.size() > 0 && particle_info != NULL) {
if(!comm_rank) pPrintInfo( "initializing CabM data\n");
if(!comm_rank) printInfo( "initializing CabM data\n");
fillAoSoA(particle_elements, particle_info); // initialize data
}
}
Expand All @@ -202,7 +202,7 @@ namespace pumipic {
int comm_rank;
MPI_Comm_rank(input.mpi_comm, &comm_rank);
if(!comm_rank)
pPrintInfo( "building CabM for %s\n", name.c_str());
printInfo( "building CabM for %s\n", name.c_str());

// build view of offsets for SoA indices within particle elements
offsets = buildOffset(input.ppe, num_ptcls, extra_padding, padding_start);
Expand All @@ -222,7 +222,7 @@ namespace pumipic {
createGlobalMapping(input.e_gids, element_to_gid, element_gid_to_lid);
// populate AoSoA with input data if given
if (input.particle_elms.size() > 0 && input.p_info != NULL) {
if(!comm_rank) pPrintInfo( "initializing CabM data\n");
if(!comm_rank) printInfo( "initializing CabM data\n");
fillAoSoA(input.particle_elms, input.p_info); // initialize data
}
}
Expand Down Expand Up @@ -306,7 +306,7 @@ namespace pumipic {
ptr += sprintf(ptr, "Empty Elements <Tot %%> %d %.3f%%\n", num_empty_elements,
num_empty_elements * 100.0 / num_elems);

pPrintInfo("%s\n", buffer);
printInfo("%s\n", buffer);
}

template <class DataTypes, typename MemSpace>
Expand Down Expand Up @@ -375,7 +375,7 @@ namespace pumipic {
template <class MSpace>
typename CabM<DataTypes, MemSpace>::template Mirror<MSpace>* CabM<DataTypes, MemSpace>::copy() {
if (std::is_same<memory_space, typename MSpace::memory_space>::value) {
pPrintError( "[ERROR] Copy to same memory space not supported\n");
printError("Copy to same memory space not supported\n");
exit(EXIT_FAILURE);
}
Mirror<MSpace>* mirror_copy = new CabM<DataTypes, MSpace>();
Expand Down Expand Up @@ -478,7 +478,7 @@ namespace pumipic {
Mirror<MSpace>* copy() {reportError(); return NULL;}

private:
void reportError() const {pPrintError( "[ERROR] pumi-pic was built "
void reportError() const {printError( "pumi-pic was built "
"without Cabana so the CabM structure "
"can not be used\n");}
};
Expand Down
4 changes: 2 additions & 2 deletions particle_structs/src/csr/CSR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ namespace pumipic {
ptr += sprintf(ptr, "Number of Elements %d, Number of Particles %d, Capacity %d\n",
num_elems, num_ptcls, capacity_);

pPrintInfo("%s\n", buffer);
printInfo("%s\n", buffer);
}

template <class DataTypes, typename MemSpace>
Expand Down Expand Up @@ -269,7 +269,7 @@ namespace pumipic {
template <class MSpace>
typename CSR<DataTypes, MemSpace>::template Mirror<MSpace>* CSR<DataTypes, MemSpace>::copy() {
if (std::is_same<memory_space, typename MSpace::memory_space>::value) {
pPrintError( "[ERROR] Copy to same memory space not supported\n");
printError( "Copy to same memory space not supported\n");
exit(EXIT_FAILURE);
}
Mirror<MSpace>* mirror_copy = new CSR<DataTypes, MSpace>();
Expand Down
4 changes: 2 additions & 2 deletions particle_structs/src/csr/CSR_buildFns.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace pumipic {
MPI_Comm_rank(mpi_comm, &comm_rank);

if(!comm_rank)
pPrintInfo( "Building CSR\n");
printInfo( "Building CSR\n");

// SS1 allocate the offsets array and use an exclusive_scan (aka prefix sum)
// to fill the entries of the offsets array.
Expand All @@ -85,7 +85,7 @@ namespace pumipic {
// If particle info is provided then enter the information
lid_t given_particles = particle_elements.size();
if (given_particles > 0 && particle_info != NULL) {
if(!comm_rank) pPrintInfo( "initializing CSR data\n");
if(!comm_rank) printInfo( "initializing CSR data\n");
initCsrData(particle_elements, particle_info);
}

Expand Down
10 changes: 5 additions & 5 deletions particle_structs/src/dps/dps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace pumipic {
int comm_rank;
MPI_Comm_rank(mpi_comm, &comm_rank);
if(!comm_rank)
pPrintInfo( "building DPS\n");
printInfo( "building DPS\n");

// calculate num_soa_ from number of particles + extra padding
num_soa_ = Kokkos::ceil(Kokkos::ceil(double(num_ptcls)/AoSoA_t::vector_length)*(1+extra_padding));
Expand All @@ -145,7 +145,7 @@ namespace pumipic {
createGlobalMapping(element_gids, element_to_gid, element_gid_to_lid);
// populate AoSoA with input data if given
if (particle_elements.size() > 0 && particle_info != NULL) {
if(!comm_rank) pPrintInfo( "initializing DPS data\n");
if(!comm_rank) printInfo( "initializing DPS data\n");
fillAoSoA(particle_elements, particle_info, parentElms_); // fill aosoa with data
}
else
Expand Down Expand Up @@ -242,7 +242,7 @@ namespace pumipic {
template <class MSpace>
typename DPS<DataTypes, MemSpace>::template Mirror<MSpace>* DPS<DataTypes, MemSpace>::copy() {
if (std::is_same<memory_space, typename MSpace::memory_space>::value) {
pPrintError( "[ERROR] Copy to same memory space not supported\n");
printError( "Copy to same memory space not supported\n");
exit(EXIT_FAILURE);
}
Mirror<MSpace>* mirror_copy = new DPS<DataTypes, MSpace>();
Expand Down Expand Up @@ -291,7 +291,7 @@ namespace pumipic {
// Padded Cells
ptr += sprintf(ptr, "Padded Cells <Tot %%> %d %.3f%%\n", num_padded,
num_padded * 100.0 / capacity_);
pPrintInfo("%s\n", buffer);
printInfo("%s\n", buffer);
}

template <class DataTypes, typename MemSpace>
Expand Down Expand Up @@ -410,7 +410,7 @@ namespace pumipic {
Mirror<MSpace>* copy() {reportError(); return NULL;}

private:
void reportError() const {pPrintError( "[ERROR] pumi-pic was built "
void reportError() const {printError( "pumi-pic was built "
"without Cabana so the DPS structure "
"can not be used\n");}
};
Expand Down
4 changes: 2 additions & 2 deletions particle_structs/src/ps_for.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace pumipic {
dps->parallel_for(fn, s);
return;
}
pPrintError( "[ERROR] Structure does not support parallel for used on kernel %s\n",
printError("Structure does not support parallel for used on kernel %s\n",
s.c_str());
throw 1;
}
Expand All @@ -49,7 +49,7 @@ namespace pumipic {
return dps->template copy<MSpace>();
}

pPrintError( "[ERROR] Structure does not support copy\n");
printError("Structure does not support copy\n");
throw 1;
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion particle_structs/src/scs/SCS_rebuild.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ namespace pumipic {
});
auto hasInactivePtcls_h = deviceToHost(hasInactivePtcls);
if( hasInactivePtcls_h(0) ) {
pPrintError( "[ERROR] there are new particles being added that are marked"
printError( "there are new particles being added that are marked"
"as inactive (element id set to -1)\n");
exit(EXIT_FAILURE);
}
Expand Down
6 changes: 3 additions & 3 deletions particle_structs/src/scs/SellCSigma.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void SellCSigma<DataTypes, MemSpace>::construct(kkLidView ptcls_per_elem,
C_ = chooseChunkHeight(C_max, ptcls_per_elem);

if(!comm_rank)
pPrintInfo( "Building SCS with C: %d sigma: %d V: %d\n",C_,sigma,V_);
printInfo( "Building SCS with C: %d sigma: %d V: %d\n",C_,sigma,V_);
//Perform sorting
kkLidView ptcls;
kkLidView index;
Expand Down Expand Up @@ -337,7 +337,7 @@ template<class DataTypes, typename MemSpace>
template <class MSpace>
typename SellCSigma<DataTypes, MemSpace>::template Mirror<MSpace>* SellCSigma<DataTypes, MemSpace>::copy() {
if (std::is_same<memory_space, typename MSpace::memory_space>::value) {
pPrintError( "[ERROR] Copy to same memory space not supported\n");
printError("Copy to same memory space not supported\n");
exit(EXIT_FAILURE);
}
const auto cmax = maxChunk<MSpace>(C_max);
Expand Down Expand Up @@ -520,7 +520,7 @@ void SellCSigma<DataTypes, MemSpace>::printMetrics(MPI_Comm mpi_comm) const {
ptr += sprintf(ptr, "Empty Rows <Tot %%> %d %.3f\n", num_empty_elements,
num_empty_elements * 100.0 / numRows());

pPrintInfo("%s\n",buffer);
printInfo("%s\n",buffer);
}

template <class DataTypes, typename MemSpace>
Expand Down
4 changes: 2 additions & 2 deletions particle_structs/src/support/MemberTypeLibraries.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ namespace pumipic {
Kokkos::parallel_for(ps_indices.size(), KOKKOS_LAMBDA(const int& i) {
const int index = ps_indices(i);
if (index >= size || index < 0) {
pPrintInfo("[ERROR] copying view to view from %d to %d outside of [0-%d)\n", i, index, size);
printInfo("[ERROR] copying view to view from %d to %d outside of [0-%d)\n", i, index, size);
hasFailed(0) = 1;
}
CopyViewToView<T,Device>(dst, index, src, i);
});
auto hasFailed_h = deviceToHost(hasFailed);
if( hasFailed_h(0) ) {
pPrintError( "[ERROR] index out of range in view-to-view copy\n");
printError("index out of range in view-to-view copy\n");
exit(EXIT_FAILURE);
}
CopyViewsToViewsImpl<View, Types...>(dsts+1, srcs+1, ps_indices);
Expand Down
2 changes: 0 additions & 2 deletions particle_structs/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ function(make_test exename srcname)
target_link_libraries(${exename} particleStructs)
endfunction(make_test)

make_test(smoke_test_particle smoke_test_particle.cpp)

make_test(typeTest typeTest.cpp)

make_test(sortTest sortTest.cpp)
Expand Down
2 changes: 0 additions & 2 deletions particle_structs/test/testing.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
mpi_test(smoke_test_particle 4 ./smoke_test_particle)

mpi_test(type_test 1 ./typeTest)

mpi_test(sort_test 1 ./sortTest 5000)
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ set(SOURCES

configure_file(
pumipic_version.hpp.in
${CMAKE_CURRENT_SOURCE_DIR}/pumipic_version.hpp
pumipic_version.hpp
Angelyr marked this conversation as resolved.
Show resolved Hide resolved
)

add_library(pumipic-core ${SOURCES})
target_include_directories(pumipic-core INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
Expand Down
Loading