Skip to content

Draft: 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

Draft
wants to merge 32 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 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
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
1 change: 1 addition & 0 deletions src/api/include/pdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "pdc_prop.h"
#include "pdc_cont.h"
#include "pdc_logger.h"
#include "pdc_client_connect.h"

#ifdef ENABLE_MPI
#include "pdc_mpi.h"
Expand Down
12 changes: 3 additions & 9 deletions src/api/pdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ PDC_class_init()

/* Initialize the atom group for the container property IDs */
if (PDC_register_type(PDC_CLASS, (PDC_free_t)PDC_class__close) < 0)
PGOTO_ERROR(FAIL, "unable to initialize pdc class interface");
PGOTO_ERROR(FAIL, "Unable to initialize pdc class interface");

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand All @@ -69,15 +68,14 @@ PDC_class_create(const char *pdc_name)

p = (struct _pdc_class *)PDC_malloc(sizeof(struct _pdc_class));
if (!p)
PGOTO_ERROR(FAIL, "PDC class property memory allocation failed\n");
PGOTO_ERROR(FAIL, "PDC class property memory allocation failed");

p->name = strdup(pdc_name);
pdcid = PDC_id_register(PDC_CLASS, p);
p->local_id = pdcid;
ret_value = pdcid;

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand Down Expand Up @@ -116,7 +114,6 @@ PDCinit(const char *pdc_name)
ret_value = pdcid;

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand Down Expand Up @@ -148,7 +145,6 @@ PDC_class_close(pdcid_t pdc)
PGOTO_ERROR(FAIL, "PDC: problem of freeing id");

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand All @@ -160,10 +156,9 @@ PDC_class_end()
FUNC_ENTER(NULL);

if (PDC_destroy_type(PDC_CLASS) < 0)
PGOTO_ERROR(FAIL, "unable to destroy pdc class interface");
PGOTO_ERROR(FAIL, "Unable to destroy pdc class interface");

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand Down Expand Up @@ -221,6 +216,5 @@ PDCclose(pdcid_t pdcid)
PDC_Client_finalize();

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,27 +206,22 @@ hg_proc_analysis_ftn_in_t(hg_proc_t proc, void *data)
analysis_ftn_in_t *struct_data = (analysis_ftn_in_t *)data;
ret = hg_proc_hg_const_string_t(proc, &struct_data->ftn_name);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_hg_const_string_t(proc, &struct_data->loadpath);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->local_obj_id);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->iter_in);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->iter_out);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
return ret;
Expand All @@ -239,112 +234,90 @@ hg_proc_obj_data_iterator_in_t(hg_proc_t proc, void *data)
obj_data_iterator_in_t *struct_data = (obj_data_iterator_in_t *)data;
ret = hg_proc_uint64_t(proc, &struct_data->client_iter_id);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->object_id);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->reg_id);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->sliceCount);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->sliceNext);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->sliceResetCount);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->elementsPerSlice);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->slicePerBlock);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->elementsPerPlane);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->elementsPerBlock);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->skipCount);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->element_size);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->srcBlockCount);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->contigBlockSize);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->totalElements);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->ndim);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->dims_0);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->dims_1);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->dims_2);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->dims_3);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_int32_t(proc, &struct_data->storageinfo);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_int32_t(proc, &struct_data->server_id);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
return ret;
Expand All @@ -358,7 +331,6 @@ hg_proc_analysis_ftn_out_t(hg_proc_t proc, void *data)

ret = hg_proc_uint64_t(proc, &struct_data->remote_ftn_id);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
return ret;
Expand All @@ -372,22 +344,18 @@ hg_proc_obj_data_iterator_out_t(hg_proc_t proc, void *data)

ret = hg_proc_uint64_t(proc, &struct_data->server_iter_id);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->client_iter_id);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_uint64_t(proc, &struct_data->server_region_id);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
ret = hg_proc_int32_t(proc, &struct_data->ret);
if (ret != HG_SUCCESS) {
// HG_LOG_ERROR("Proc error");
return ret;
}
return ret;
Expand Down
19 changes: 6 additions & 13 deletions src/api/pdc_analysis/pdc_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ iterator_init(pdcid_t objectId, pdcid_t reg_id, int blocks, struct _pdc_iterator
iter->contigBlockSize = obj_elementsPerSlice * element_size;
}
else
PGOTO_ERROR(-1, "Error: object (%" PRIu64 ") has not been initalized correctly!", objectId);
PGOTO_ERROR(FAIL, "Error: Object (%" PRIu64 ") has not been initalized correctly", objectId);

iter->element_size = element_size;
iter->objectId = objectId;
Expand Down Expand Up @@ -248,7 +248,6 @@ iterator_init(pdcid_t objectId, pdcid_t reg_id, int blocks, struct _pdc_iterator
ret_value = 0;

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand All @@ -272,7 +271,6 @@ PDCobj_data_block_iterator_create(pdcid_t obj_id, pdcid_t reg_id, int contig_blo
PGOTO_ERROR(0, "Unable to register a new iterator");

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand Down Expand Up @@ -338,7 +336,7 @@ PDC_get_argv0_()
shellcmd = fopen(procpath, "r");
if (shellcmd == NULL) {
procpath = (char *)PDC_free(procpath);
PGOTO_ERROR(NULL, "fopen failed!");
PGOTO_ERROR(NULL, "fopen failed");
}
else {
cmdLength = fread(fullPath, 1, sizeof(fullPath), shellcmd);
Expand Down Expand Up @@ -373,12 +371,11 @@ PDC_get_argv0_()
}
}
if (_argv0 == NULL)
PGOTO_ERROR(NULL, "ERROR: Unable to resolve user application name!");
PGOTO_ERROR(NULL, "Unable to resolve user application name");

ret_value = _argv0;

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand Down Expand Up @@ -408,7 +405,6 @@ PDC_get_realpath(char *fname, char *app_path)
ret_value = strdup(fullPath);

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand Down Expand Up @@ -449,7 +445,7 @@ PDCobj_analysis_register(char *func, pdcid_t iterIn, pdcid_t iterOut)
//
loadpath = PDC_get_realpath(analyislibrary, applicationDir);
if (PDC_get_ftnPtr_((const char *)userdefinedftn, (const char *)loadpath, &ftnHandle) < 0)
PGOTO_ERROR(FAIL, "PDC_get_ftnPtr_ returned an error!");
PGOTO_ERROR(FAIL, "PDC_get_ftnPtr_ returned an error");

if ((ftnPtr = ftnHandle) == NULL)
PGOTO_ERROR(FAIL, "Analysis function lookup failed");
Expand Down Expand Up @@ -494,7 +490,7 @@ PDCobj_analysis_register(char *func, pdcid_t iterIn, pdcid_t iterOut)

// Add to our own list of analysis functions
if (PDC_add_analysis_ptr_to_registry_(thisFtn) < 0)
PGOTO_ERROR(FAIL, "PDC unable to register analysis function!");
PGOTO_ERROR(FAIL, "PDC unable to register analysis function");

done:
if (applicationDir)
Expand All @@ -504,7 +500,6 @@ PDCobj_analysis_register(char *func, pdcid_t iterIn, pdcid_t iterOut)
if (loadpath)
loadpath = (char *)PDC_free(loadpath);

fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand All @@ -528,7 +523,6 @@ PDCobj_data_getSliceCount(pdcid_t iter)
}

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand Down Expand Up @@ -559,7 +553,7 @@ PDCobj_data_getNextBlock(pdcid_t iter, void **nextBlock, size_t *dims)
if ((thisIter->srcNext = PDC_Server_get_region_data_ptr(thisIter->objectId)) == NULL)
thisIter->srcNext = PDC_malloc(thisIter->totalElements * thisIter->element_size);
if ((thisIter->srcStart = thisIter->srcNext) == NULL)
PGOTO_ERROR(0, "==PDC_ANALYSIS_SERVER: Unable to allocate iterator storage");
PGOTO_ERROR(0, "Unable to allocate iterator storage");

thisIter->srcNext += thisIter->startOffset + thisIter->skipCount;
}
Expand Down Expand Up @@ -628,7 +622,6 @@ PDCobj_data_getNextBlock(pdcid_t iter, void **nextBlock, size_t *dims)
}

done:
fflush(stdout);
FUNC_LEAVE(ret_value);
}

Expand Down
Loading
Loading