Skip to content

Commit

Permalink
moved [ERROR]
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelyr committed Nov 28, 2024
1 parent 719bb4f commit 6cfaf55
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions particle_structs/src/cabm/cabm.hpp
Original file line number Diff line number Diff line change
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) {
printError( "[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 {printError( "[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
2 changes: 1 addition & 1 deletion particle_structs/src/csr/CSR.hpp
Original file line number Diff line number Diff line change
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) {
printError( "[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/dps/dps.hpp
Original file line number Diff line number Diff line change
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) {
printError( "[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 @@ -410,7 +410,7 @@ namespace pumipic {
Mirror<MSpace>* copy() {reportError(); return NULL;}

private:
void reportError() const {printError( "[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;
}
printError( "[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>();
}

printError( "[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) ) {
printError( "[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
2 changes: 1 addition & 1 deletion particle_structs/src/scs/SellCSigma.h
Original file line number Diff line number Diff line change
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) {
printError( "[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
2 changes: 1 addition & 1 deletion particle_structs/src/support/MemberTypeLibraries.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ namespace pumipic {
});
auto hasFailed_h = deviceToHost(hasFailed);
if( hasFailed_h(0) ) {
printError( "[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
8 changes: 4 additions & 4 deletions src/pumipic_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace pumipic {
if (comm->rank() == 0) {
if (!Omega_h::filesystem::exists(dir)) {
if (!Omega_h::filesystem::create_directory(dir)) {
printError( "[ERROR] Failed to create directory %s\n", dir);
printError("Failed to create directory %s\n", dir);
return;
}
}
Expand All @@ -70,7 +70,7 @@ namespace pumipic {
//Write file for the pumipic mesh data
std::ofstream out_str(ppm_file);
if (!out_str) {
printError( "[ERROR] Failed to open file %s\n", ppm_file);
printError("Failed to open file %s\n", ppm_file);
return;
}
#ifdef OMEGA_H_USE_ZLIB
Expand Down Expand Up @@ -122,7 +122,7 @@ namespace pumipic {
sprintf(dir, "%s_%d.ppm", path, comm->size());

if (!Omega_h::filesystem::exists(dir)) {
printError( "[ERROR] Directory %s does not exist\n", dir);
printError("Directory %s does not exist\n", dir);
return;
}

Expand All @@ -136,7 +136,7 @@ namespace pumipic {

std::ifstream in_str(ppm_file);
if (!in_str) {
printError( "[ERROR] Cannot open file %s\n", ppm_file);
printError("Cannot open file %s\n", ppm_file);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/pumipic_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace pumipic {
while (dot >=0 && partition_filename[dot] != '.')
--dot;
if (dot < 0) {
printError( "[ERROR] Filename provided has no extension (%s)", partition_filename);
printError("Filename provided has no extension (%s)", partition_filename);
throw std::runtime_error("Filename has no extension");
}
char* extension = partition_filename + dot + 1;
Expand Down Expand Up @@ -88,7 +88,7 @@ namespace pumipic {

}
else {
printError( "[ERROR] Only .ptn and .cpn partitions are supported");
printError("Only .ptn and .cpn partitions are supported");
throw std::runtime_error("Invalid partition file extension");
}
}
Expand Down
2 changes: 2 additions & 0 deletions support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/support>
$<INSTALL_INTERFACE:include>)

if(PUMIPIC_PRINT_ENABLED)
add_definitions(-DPUMIPIC_PRINT_ENABLED)
target_compile_definitions(support INTERFACE -DPUMIPIC_PRINT_ENABLED)
endif()

if (spdlog_FOUND)
add_definitions(-DPUMIPIC_SPDLOG_ENABLED)
target_compile_definitions(support INTERFACE -DPUMIPIC_SPDLOG_ENABLED)
target_link_libraries(support PUBLIC spdlog::spdlog)
endif()
Expand Down
4 changes: 2 additions & 2 deletions support/ppPrint.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ namespace pumipic {
}

template<typename... Args>
void printError(const char* fmt, const Args&... args) {
void printError(std::string fmt, const Args&... args) {
#if defined(PUMIPIC_SPDLOG_ENABLED) && defined(PUMIPIC_PRINT_ENABLED)
spdlog::error("{}", fmt::sprintf(fmt, args...));
#elif defined(PUMIPIC_PRINT_ENABLED)
fprintf(pp_stderr, fmt, args...);
fprintf(pp_stderr, ("[ERROR]"+fmt).c_str(), args...);
#endif
}

Expand Down
6 changes: 3 additions & 3 deletions support/ppTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ namespace pumipic {

void SetTimingVerbosity(int v) {
if (time_per_op.size() > 0) {
printError( "[ERROR] Cannot change timing verbosity after first call to RecordTime\n");
printError("Cannot change timing verbosity after first call to RecordTime\n");
return;
}
verbosity = v;
}

void EnableTiming() {
if (time_per_op.size() > 0) {
printError( "[ERROR] Cannot enable timing after first call to RecordTime\n");
printError("Cannot enable timing after first call to RecordTime\n");
return;
}
enable_timing = 1;
}
void DisableTiming() {
if (time_per_op.size() > 0) {
printError( "[ERROR] Cannot disable timing after first call to RecordTime\n");
printError("Cannot disable timing after first call to RecordTime\n");
return;
}
enable_timing = -1;
Expand Down

0 comments on commit 6cfaf55

Please sign in to comment.