Skip to content

Commit

Permalink
prototype implementation of transfering PDC regions from one HPC cent…
Browse files Browse the repository at this point in the history
…er to another
  • Loading branch information
houjun committed Sep 24, 2024
1 parent 2e5de75 commit 1f97c28
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/api/pdc_obj/include/pdc_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,14 @@ perr_t PDCobj_get_tag(pdcid_t obj_id, char *tag_name, void **tag_value, pdc_var_
*/
perr_t PDCobj_del_tag(pdcid_t obj_id, char *tag_name);

/**
* Get object datatype
*
* \param obj_id [IN] Object ID
*
* \return PDC datatype
*/

pdc_var_type_t PDCobj_get_dtype(obj_id);

#endif /* PDC_OBJ_H */
20 changes: 19 additions & 1 deletion src/api/pdc_obj/pdc_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* perform publicly and display publicly, and to permit other to do so.
*/

#include "pdc_obj.h"
#include "pdc_utlist.h"
#include "pdc_config.h"
#include "pdc_malloc.h"
Expand All @@ -30,7 +31,6 @@
#include "pdc_cont_pkg.h"
#include "pdc_prop_pkg.h"
#include "pdc_obj_pkg.h"
#include "pdc_obj.h"
#include "pdc_interface.h"
#include "pdc_transforms_pkg.h"
#include "pdc_analysis_pkg.h"
Expand Down Expand Up @@ -1256,3 +1256,21 @@ PDCobj_del(pdcid_t obj_id)
// done:
FUNC_LEAVE(ret_value);
}

pdc_var_type_t PDCobj_get_dtype(pdcid_t obj_id)
{
struct _pdc_id_info * info;
struct _pdc_obj_info *object;
pdc_var_type_t dtype;

FUNC_ENTER(NULL);

info = PDC_find_id(obj_id);
if (info == NULL)
fprintf(stderr, "%s : cannnot find obj id @ line %d\n", __func__, __LINE__);

object = (struct _pdc_obj_info *)(info->obj_ptr);
dtype = object->obj_pt->obj_prop_pub->type;

return dtype;
}
2 changes: 2 additions & 0 deletions src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ set(PROGRAMS
pdc_import
pdc_export
pdc_ls
pdc_region_push
pdc_region_pull
)

add_library(cjson cjson/cJSON.c)
Expand Down

0 comments on commit 1f97c28

Please sign in to comment.