Skip to content

Commit 5a6e943

Browse files
hyunjuoohHyunju Ohjeanbezgithub-actions[bot]
authored
Removing PDC macro (#189)
* Removing gres option for ctest * Removing gres option from scripts * Update check for core * Remove PDC macro * Committing clang-format changes --------- Co-authored-by: Hyunju Oh <hjoh16@login15.chn.perlmutter.nersc.gov> Co-authored-by: Jean Luca Bez <jlbez@lbl.gov> Co-authored-by: github-actions <github-actions[bot]@users.noreply.github.com>
1 parent 0f326da commit 5a6e943

File tree

11 files changed

+121
-123
lines changed

11 files changed

+121
-123
lines changed

src/api/pdc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ PDC_class_create(const char *pdc_name)
6767

6868
FUNC_ENTER(NULL);
6969

70-
p = PDC_MALLOC(struct _pdc_class);
70+
p = (struct _pdc_class *)PDC_malloc(sizeof(struct _pdc_class));
7171
if (!p)
7272
PGOTO_ERROR(FAIL, "PDC class property memory allocation failed\n");
7373

@@ -89,7 +89,7 @@ PDCinit(const char *pdc_name)
8989

9090
FUNC_ENTER(NULL);
9191

92-
if (NULL == (pdc_id_list_g = PDC_CALLOC(1, struct pdc_id_list)))
92+
if (NULL == (pdc_id_list_g = (struct pdc_id_list *)PDC_calloc(1, sizeof(struct pdc_id_list))))
9393
PGOTO_ERROR(FAIL, "PDC global id list: memory allocation failed");
9494

9595
if (PDC_class_init() < 0)
@@ -130,7 +130,7 @@ PDC_class__close(struct _pdc_class *p)
130130
#endif
131131

132132
free(p->name);
133-
p = PDC_FREE(struct _pdc_class, p);
133+
p = (struct _pdc_class *)(intptr_t)PDC_free(p);
134134

135135
FUNC_LEAVE(ret_value);
136136
}
@@ -214,7 +214,7 @@ PDCclose(pdcid_t pdcid)
214214

215215
PDC_class_end();
216216

217-
pdc_id_list_g = PDC_FREE(struct pdc_id_list, pdc_id_list_g);
217+
pdc_id_list_g = (struct pdc_id_list *)(intptr_t)PDC_free(pdc_id_list_g);
218218

219219
// Finalize METADATA
220220
PDC_Client_finalize();

src/api/pdc_analysis/pdc_analysis.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@ PDCobj_analysis_register(char *func, pdcid_t iterIn, pdcid_t iterOut)
453453
if ((ftnPtr = ftnHandle) == NULL)
454454
PGOTO_ERROR(FAIL, "Analysis function lookup failed");
455455

456-
if ((thisFtn = PDC_MALLOC(struct _pdc_region_analysis_ftn_info)) == NULL)
456+
if ((thisFtn = (struct _pdc_region_analysis_ftn_info *)PDC_malloc(
457+
sizeof(struct _pdc_region_analysis_ftn_info))) == NULL)
457458
PGOTO_ERROR(FAIL, "PDC register_obj_analysis memory allocation failed");
458459

459460
thisFtn->ftnPtr = (int (*)())ftnPtr;

src/api/pdc_obj/pdc_cont.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,24 @@ PDCcont_create(const char *cont_name, pdcid_t cont_prop_id)
6161

6262
FUNC_ENTER(NULL);
6363

64-
p = PDC_MALLOC(struct _pdc_cont_info);
64+
p = (struct _pdc_cont_info *)PDC_malloc(sizeof(struct _pdc_cont_info));
6565
if (!p)
6666
PGOTO_ERROR(0, "PDC container memory allocation failed");
6767

68-
p->cont_info_pub = PDC_MALLOC(struct pdc_cont_info);
68+
p->cont_info_pub = (struct pdc_cont_info *)PDC_malloc(sizeof(struct pdc_cont_info));
6969
if (!p->cont_info_pub)
7070
PGOTO_ERROR(0, "PDC pub container memory allocation failed");
7171
p->cont_info_pub->name = strdup(cont_name);
7272

7373
id_info = PDC_find_id(cont_prop_id);
7474
cont_prop = (struct _pdc_cont_prop *)(id_info->obj_ptr);
7575

76-
p->cont_pt = PDC_CALLOC(1, struct _pdc_cont_prop);
76+
p->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop));
7777
if (!p->cont_pt)
7878
PGOTO_ERROR(0, "PDC container prop memory allocation failed");
7979
memcpy(p->cont_pt, cont_prop, sizeof(struct _pdc_cont_prop));
8080

81-
p->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class);
81+
p->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class));
8282
if (!p->cont_pt->pdc)
8383
PGOTO_ERROR(0, "PDC container pdc class memory allocation failed");
8484
if (cont_prop->pdc->name)
@@ -110,24 +110,24 @@ PDCcont_create_col(const char *cont_name, pdcid_t cont_prop_id)
110110

111111
FUNC_ENTER(NULL);
112112

113-
p = PDC_MALLOC(struct _pdc_cont_info);
113+
p = (struct _pdc_cont_info *)PDC_malloc(sizeof(struct _pdc_cont_info));
114114
if (!p)
115115
PGOTO_ERROR(0, "PDC container memory allocation failed");
116116

117-
p->cont_info_pub = PDC_MALLOC(struct pdc_cont_info);
117+
p->cont_info_pub = (struct pdc_cont_info *)PDC_malloc(sizeof(struct pdc_cont_info));
118118
if (!p->cont_info_pub)
119119
PGOTO_ERROR(0, "PDC pub container memory allocation failed");
120120
p->cont_info_pub->name = strdup(cont_name);
121121

122122
id_info = PDC_find_id(cont_prop_id);
123123
cont_prop = (struct _pdc_cont_prop *)(id_info->obj_ptr);
124124

125-
p->cont_pt = PDC_CALLOC(1, struct _pdc_cont_prop);
125+
p->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop));
126126
if (!p->cont_pt)
127127
PGOTO_ERROR(0, "PDC container prop memory allocation failed");
128128
memcpy(p->cont_pt, cont_prop, sizeof(struct _pdc_cont_prop));
129129

130-
p->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class);
130+
p->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class));
131131
if (!p->cont_pt->pdc)
132132
PGOTO_ERROR(0, "PDC container pdc class memory allocation failed");
133133
if (cont_prop->pdc->name)
@@ -157,11 +157,11 @@ PDC_cont_create_local(pdcid_t pdc, const char *cont_name, uint64_t cont_meta_id)
157157

158158
FUNC_ENTER(NULL);
159159

160-
p = PDC_MALLOC(struct _pdc_cont_info);
160+
p = (struct _pdc_cont_info *)PDC_malloc(sizeof(struct _pdc_cont_info));
161161
if (!p)
162162
PGOTO_ERROR(0, "PDC container memory allocation failed");
163163

164-
p->cont_info_pub = PDC_MALLOC(struct pdc_cont_info);
164+
p->cont_info_pub = (struct pdc_cont_info *)PDC_malloc(sizeof(struct pdc_cont_info));
165165
if (!p)
166166
PGOTO_ERROR(0, "PDC container memory allocation failed");
167167
p->cont_info_pub->name = strdup(cont_name);
@@ -171,12 +171,12 @@ PDC_cont_create_local(pdcid_t pdc, const char *cont_name, uint64_t cont_meta_id)
171171

172172
id_info = PDC_find_id(cont_prop_id);
173173
cont_prop = (struct _pdc_cont_prop *)(id_info->obj_ptr);
174-
p->cont_pt = PDC_CALLOC(1, struct _pdc_cont_prop);
174+
p->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop));
175175
if (!p->cont_pt)
176176
PGOTO_ERROR(0, "PDC container prop memory allocation failed");
177177
memcpy(p->cont_pt, cont_prop, sizeof(struct _pdc_cont_prop));
178178

179-
p->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class);
179+
p->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class));
180180
if (!p->cont_pt->pdc)
181181
PGOTO_ERROR(0, "PDC container pdc class memory allocation failed");
182182

@@ -222,11 +222,11 @@ PDC_cont_close(struct _pdc_cont_info *cp)
222222
FUNC_ENTER(NULL);
223223

224224
free((void *)(cp->cont_info_pub->name));
225-
cp->cont_info_pub = PDC_FREE(struct pdc_cont_info, cp->cont_info_pub);
225+
cp->cont_info_pub = (struct pdc_cont_info *)(intptr_t)PDC_free(cp->cont_info_pub);
226226
free(cp->cont_pt->pdc->name);
227-
cp->cont_pt->pdc = PDC_FREE(struct _pdc_class, cp->cont_pt->pdc);
228-
cp->cont_pt = PDC_FREE(struct _pdc_cont_prop, cp->cont_pt);
229-
cp = PDC_FREE(struct _pdc_cont_info, cp);
227+
cp->cont_pt->pdc = (struct _pdc_class *)(intptr_t)PDC_free(cp->cont_pt->pdc);
228+
cp->cont_pt = (struct _pdc_cont_prop *)(intptr_t)PDC_free(cp->cont_pt);
229+
cp = (struct _pdc_cont_info *)(intptr_t)PDC_free(cp);
230230

231231
FUNC_LEAVE(ret_value);
232232
}
@@ -321,25 +321,25 @@ PDC_cont_get_info(pdcid_t cont_id)
321321
PGOTO_ERROR(NULL, "cannot locate object");
322322

323323
info = (struct _pdc_cont_info *)(id_info->obj_ptr);
324-
ret_value = PDC_CALLOC(1, struct _pdc_cont_info);
324+
ret_value = (struct _pdc_cont_info *)PDC_calloc(1, sizeof(struct _pdc_cont_info));
325325
if (ret_value)
326326
memcpy(ret_value, info, sizeof(struct _pdc_cont_info));
327327
else
328328
PGOTO_ERROR(NULL, "cannot allocate ret_value");
329329

330-
ret_value->cont_info_pub = PDC_CALLOC(1, struct pdc_cont_info);
330+
ret_value->cont_info_pub = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info));
331331
if (ret_value->cont_info_pub)
332332
memcpy(ret_value->cont_info_pub, info->cont_info_pub, sizeof(struct pdc_cont_info));
333333

334334
if (info->cont_info_pub->name)
335335
ret_value->cont_info_pub->name = strdup(info->cont_info_pub->name);
336336

337-
ret_value->cont_pt = PDC_MALLOC(struct _pdc_cont_prop);
337+
ret_value->cont_pt = (struct _pdc_cont_prop *)PDC_malloc(sizeof(struct _pdc_cont_prop));
338338
if (ret_value->cont_pt)
339339
memcpy(ret_value->cont_pt, info->cont_pt, sizeof(struct _pdc_cont_prop));
340340
else
341341
PGOTO_ERROR(NULL, "cannot allocate ret_value->cont_pt");
342-
ret_value->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class);
342+
ret_value->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class));
343343
if (ret_value->cont_pt->pdc) {
344344
ret_value->cont_pt->pdc->local_id = info->cont_pt->pdc->local_id;
345345
if (info->cont_pt->pdc->name)
@@ -366,7 +366,7 @@ PDCcont_get_info(const char *cont_name)
366366

367367
tmp = PDC_cont_get_info(cont_id);
368368

369-
ret_value = PDC_CALLOC(1, struct pdc_cont_info);
369+
ret_value = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info));
370370
if (!ret_value)
371371
PGOTO_ERROR(NULL, "cannot allocate memory");
372372

@@ -440,7 +440,7 @@ PDCcont_iter_get_info(cont_handle *chandle)
440440
if (info == NULL)
441441
PGOTO_ERROR(NULL, "PDC container info memory allocation failed");
442442

443-
ret_value = PDC_CALLOC(1, struct pdc_cont_info);
443+
ret_value = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info));
444444
if (!ret_value)
445445
PGOTO_ERROR(NULL, "failed to allocate memory");
446446

0 commit comments

Comments
 (0)