Skip to content

New test macros and code cleanup #261

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

Open
wants to merge 41 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4d9b0d1
checkpoint
TheAssembler1 May 17, 2025
8125f9c
Committing clang-format changes
github-actions[bot] May 17, 2025
81f481d
some tests
TheAssembler1 May 19, 2025
00e1e10
Committing clang-format changes
github-actions[bot] May 19, 2025
679c7b7
checkpoint
TheAssembler1 May 19, 2025
2f3eb90
Merge branch 'tests_logging' of https://github.com/TheAssembler1/pdc …
TheAssembler1 May 19, 2025
0fc3d12
open_obj uses new test macros
TheAssembler1 May 19, 2025
b44c9c9
Committing clang-format changes
github-actions[bot] May 19, 2025
4b40fa9
read_obj uses TASSERT
TheAssembler1 May 20, 2025
2464440
read_obj uses TASSERT
TheAssembler1 May 20, 2025
83affeb
Committing clang-format changes
github-actions[bot] May 20, 2025
5ae5fb9
cont_del and cont_getid use test macros
TheAssembler1 May 22, 2025
067456d
convert more tests to use macros
TheAssembler1 May 22, 2025
fcdc46e
convert more tests to macros
TheAssembler1 May 22, 2025
7fb7e77
Committing clang-format changes
github-actions[bot] May 22, 2025
b608c28
Merge branch 'develop' into tests_logging
TheAssembler1 May 22, 2025
0850fb4
merge with develop
TheAssembler1 May 23, 2025
405652d
Committing clang-format changes
github-actions[bot] May 23, 2025
1e748df
clang format
TheAssembler1 May 23, 2025
03c667d
Merge branch 'tests_logging' of https://github.com/TheAssembler1/pdc …
TheAssembler1 May 23, 2025
dc354cb
use test helper in cont_info and cont_add_del
TheAssembler1 May 23, 2025
9205a44
more tests use macros
TheAssembler1 May 23, 2025
f76f502
Committing clang-format changes
github-actions[bot] May 23, 2025
a8d56eb
use tests macros in more tests
TheAssembler1 May 23, 2025
5fce006
Merge branch 'tests_logging' of https://github.com/TheAssembler1/pdc …
TheAssembler1 May 23, 2025
0860a1f
use PGOTO* macros instead of goto
TheAssembler1 May 24, 2025
a57f653
clang format
TheAssembler1 May 24, 2025
eeb17fd
more log fixes
TheAssembler1 May 24, 2025
53e96cb
logging cleanup and more usage of test macros
TheAssembler1 May 24, 2025
ee43c43
Committing clang-format changes
github-actions[bot] May 24, 2025
f32a4ed
clang format and fix CMakeLists for tests
TheAssembler1 May 24, 2025
56d18ba
Merge branch 'tests_logging' of https://github.com/TheAssembler0/pdc …
TheAssembler1 May 24, 2025
a5491c8
use tests macros in transfer overlap 2D/3D
TheAssembler1 May 31, 2025
7e41a97
use TASSERT in more tests
TheAssembler1 May 31, 2025
81dff7f
Committing clang-format changes
github-actions[bot] May 31, 2025
22a28e6
use test asserts
TheAssembler1 May 31, 2025
27ed3d6
all tests on the CI use TASSERT
TheAssembler1 May 31, 2025
84d4a3f
Merge branch 'tests_logging' of https://github.com/TheAssembler1/pdc …
TheAssembler1 May 31, 2025
b073df8
fix printing and newlines in tests
TheAssembler1 May 31, 2025
aa4b529
print time, file name, function name, and line number in debug print
TheAssembler1 Jun 2, 2025
8b03059
merge and clang format
TheAssembler1 Jun 3, 2025
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
306 changes: 170 additions & 136 deletions examples/C_plus_plus_example/multidataset_plugin.cc

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions examples/C_plus_plus_example/region_transfer_1D_append.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
#include <string.h>
#include "multidataset_plugin.h"

#define DATA_SIZE 128
#define DATA_SIZE 128
#define ARRAY_SIZE 10

int
main(int argc, char **argv)
{
int rank = 0, size = 1;
int ret_value = 0;
int *data;
int i;
char data_name[1024];
int rank = 0, size = 1;
int ret_value = 0;
int *data;
int i;
char data_name[1024];

// create a pdc
#ifdef ENABLE_MPI
Expand All @@ -52,21 +52,21 @@ main(int argc, char **argv)

init_multidataset();

data = (int*) malloc(sizeof(int) * DATA_SIZE);
for ( i = 0; i < DATA_SIZE; ++i ) {
data = (int *)malloc(sizeof(int) * DATA_SIZE);
for (i = 0; i < DATA_SIZE; ++i) {
data[i] = i;
}
sprintf(data_name, "data0_%d", rank);

LOG_INFO("rank %d C++ example for writing %d lists of arrays with size %d\n", rank, ARRAY_SIZE, DATA_SIZE);
for ( i = 0; i < ARRAY_SIZE; ++i ) {
LOG_INFO("C++ example for writing %d lists of arrays with size %d\n", rank, ARRAY_SIZE, DATA_SIZE);
for (i = 0; i < ARRAY_SIZE; ++i) {
register_multidataset_request_append(data_name, 0, data, sizeof(int) * DATA_SIZE, H5T_NATIVE_CHAR);
}

sprintf(data_name, "data1_%d", rank);

LOG_INFO("rank %d C++ example for writing %d lists of arrays with size %d\n", rank, ARRAY_SIZE, DATA_SIZE);
for ( i = 0; i < ARRAY_SIZE; ++i ) {
LOG_INFO("C++ example for writing %d lists of arrays with size %d\n", rank, ARRAY_SIZE, DATA_SIZE);
for (i = 0; i < ARRAY_SIZE; ++i) {
register_multidataset_request_append(data_name, 0, data, sizeof(int) * DATA_SIZE, H5T_NATIVE_CHAR);
}
flush_multidatasets();
Expand Down
6 changes: 3 additions & 3 deletions examples/obj_get_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ main(int argc, char **argv)
sprintf(cont_name, "c%d", rank);
cont = PDCcont_create(cont_name, cont_prop);
if (cont > 0) {
LOG_INFO("Rank %d Create a container %s\n", rank, cont_name);
LOG_INFO("Created a container %s\n", cont_name);
}
else {
LOG_ERROR("Failed to create container");
Expand All @@ -74,7 +74,7 @@ main(int argc, char **argv)
sprintf(obj_name1, "o1_%d", rank);
obj1 = PDCobj_put_data(obj_name1, (void *)data, 16 * sizeof(double), cont);
if (obj1 > 0) {
LOG_INFO("Rank %d Put data to %s\n", rank, obj_name1);
LOG_INFO("Put data to %s\n", obj_name1);
}
else {
LOG_ERROR("Failed to put data into object");
Expand All @@ -85,7 +85,7 @@ main(int argc, char **argv)
sprintf(obj_name2, "o2_%d", rank);
obj2 = PDCobj_put_data(obj_name2, (void *)data, 128 * sizeof(double), cont);
if (obj2 > 0) {
LOG_INFO("Rank %d Put data to %s\n", rank, obj_name2);
LOG_INFO("Put data to %s\n", rank, obj_name2);
}
else {
LOG_ERROR("Failed to put data into object");
Expand Down
50 changes: 25 additions & 25 deletions examples/region_transfer_2D.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ main(int argc, char **argv)
LOG_INFO("Create a container property\n");
}
else {
LOG_ERROR("Failed to create container property");
LOG_ERROR("Failed to create container property\n");
ret_value = 1;
}
// create a container
Expand All @@ -78,7 +78,7 @@ main(int argc, char **argv)
LOG_INFO("Create a container c1\n");
}
else {
LOG_ERROR("Failed to create container");
LOG_ERROR("Failed to create container\n");
ret_value = 1;
}
// create an object property
Expand All @@ -87,13 +87,13 @@ main(int argc, char **argv)
LOG_INFO("Create an object property\n");
}
else {
LOG_ERROR("Failed to create object property");
LOG_ERROR("Failed to create object property\n");
ret_value = 1;
}

ret = PDCprop_set_obj_type(obj_prop, PDC_INT);
if (ret != SUCCEED) {
LOG_ERROR("Failed to set obj type");
LOG_ERROR("Failed to set obj type\n");
ret_value = 1;
}
PDCprop_set_obj_dims(obj_prop, 2, dims);
Expand All @@ -109,7 +109,7 @@ main(int argc, char **argv)
LOG_INFO("Create an object o1\n");
}
else {
LOG_ERROR("Failed to create object");
LOG_ERROR("Failed to create object\n");
ret_value = 1;
}
// create second object
Expand All @@ -119,7 +119,7 @@ main(int argc, char **argv)
LOG_INFO("Create an object o2\n");
}
else {
LOG_ERROR("Failed to create object");
LOG_ERROR("Failed to create object\n");
ret_value = 1;
}

Expand All @@ -143,19 +143,19 @@ main(int argc, char **argv)
PDCregion_transfer_close(transfer_request);

if (PDCregion_close(reg) < 0) {
LOG_ERROR("Failed to close local region");
LOG_ERROR("Failed to close local region\n");
ret_value = 1;
}
else {
LOG_INFO("successfully closed local region");
LOG_INFO("successfully closed local region\n");
}

if (PDCregion_close(reg_global) < 0) {
LOG_ERROR("Failed to close global region");
LOG_ERROR("Failed to close global region\n");
ret_value = 1;
}
else {
LOG_INFO("successfully closed global region");
LOG_INFO("successfully closed global region\n");
}

offset[0] = 0;
Expand Down Expand Up @@ -183,65 +183,65 @@ main(int argc, char **argv)
}
}
if (PDCregion_close(reg) < 0) {
LOG_ERROR("Failed to close local region");
LOG_ERROR("Failed to close local region\n");
ret_value = 1;
}
else {
LOG_INFO("successfully local region");
LOG_INFO("successfully local region\n");
}

if (PDCregion_close(reg_global) < 0) {
LOG_ERROR("Failed to close global region");
LOG_ERROR("Failed to close global region\n");
ret_value = 1;
}
else {
LOG_INFO("successfully closed global region");
LOG_INFO("successfully closed global region\n");
}

// close object
if (PDCobj_close(obj1) < 0) {
LOG_ERROR("Failed to close object o1");
LOG_ERROR("Failed to close object o1\n");
ret_value = 1;
}
else {
LOG_INFO("Successfully closed object o1");
LOG_INFO("Successfully closed object o1\n");
}
if (PDCobj_close(obj2) < 0) {
LOG_ERROR("Failed to close object o2");
LOG_ERROR("Failed to close object o2\n");
ret_value = 1;
}
else {
LOG_INFO("Successfully closed object o2");
LOG_INFO("Successfully closed object o2\n");
}
// close a container
if (PDCcont_close(cont) < 0) {
LOG_ERROR("Failed to close container c1");
LOG_ERROR("Failed to close container c1\n");
ret_value = 1;
}
else {
LOG_INFO("Successfully closed container c1");
LOG_INFO("Successfully closed container c1\n");
}
// close a object property
if (PDCprop_close(obj_prop) < 0) {
LOG_ERROR("Failed to close property");
LOG_ERROR("Failed to close property\n");
ret_value = 1;
}
else {
LOG_INFO("Successfully closed object property");
LOG_INFO("Successfully closed object property\n");
}
// close a container property
if (PDCprop_close(cont_prop) < 0) {
LOG_ERROR("Failed to close property");
LOG_ERROR("Failed to close property\n");
ret_value = 1;
}
else {
LOG_INFO("Successfully closed container property");
LOG_INFO("Successfully closed container property\n");
}
free(data);
free(data_read);
// close pdc
if (PDCclose(pdc) < 0) {
LOG_ERROR("Failed to close PDC");
LOG_ERROR("Failed to close PDC\n");
ret_value = 1;
}
#ifdef ENABLE_MPI
Expand Down
Loading
Loading