Skip to content

Commit

Permalink
more fix on conditional compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
bozhang-hpc committed Sep 30, 2024
1 parent e72bc53 commit caf0eee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions include/gspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ struct ds_gspace {
/* Pending object descriptors for draining. */
struct list_head obj_desc_drain_list;

#ifdef DSPACES_HAVE_FILE_STORAGE
/* List of object data for swap out */
struct list_head ls_od_list;
#endif // DSPACES_HAVE_FILE_STORAGE

int rank;
int size_sp;
Expand Down
9 changes: 4 additions & 5 deletions include/ss_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,19 @@ struct global_dimension {
struct coord sizes;
};

#ifdef DSPACES_HAVE_FILE_STORAGE
struct flat_od_list_info {
struct list_head entry;
int usecnt;
};
#endif // DSPACES_HAVE_FILE_STORAGE

struct obj_data {
struct list_head obj_entry;

#ifdef DSPACES_HAVE_FILE_STORAGE
struct flat_od_list_info flat_list_entry;
#endif // DSPACES_HAVE_FILE_STORAGE

obj_descriptor obj_desc;

Expand All @@ -90,11 +94,6 @@ struct obj_data {

/* Flag to mark if we should free this data object. */
unsigned int f_free : 1;

#ifdef DSPACES_HAVE_FILE_STORAGE
/* Reference to the flat od list in local storage; Used for advanced swap policy */
struct obj_data_ptr_flat_list_entry* ls_od_entry;
#endif // DSPACES_HAVE_FILE_STORAGE
};

struct gdim_list_entry {
Expand Down
5 changes: 4 additions & 1 deletion src/dspaces-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ static int dsg_alloc(dspaces_provider_t server, const char *conf_name,
goto err_free;
}

#ifdef DSPACES_HAVE_FILE_STORAGE
INIT_LIST_HEAD(&dsg_l->ls_od_list);
#endif // DSPACES_HAVE_FILE_STORAGE

// proxy storage
dsg_l->ps = ls_alloc(server->conf.max_versions);
Expand Down Expand Up @@ -2262,7 +2264,9 @@ static void get_rpc(hg_handle_t handle)
DEBUG_OUT("found source data object from staging memory\n");
ssd_copy(od, from_obj);
DEBUG_OUT("copied object data\n");
#ifdef DSPACES_HAVE_FILE_STORAGE
from_obj->flat_list_entry.usecnt++;
#endif // DSPACES_HAVE_FILE_STORAGE
}
ABT_mutex_unlock(server->ls_mutex);

Expand Down Expand Up @@ -2327,7 +2331,6 @@ static void get_rpc(hg_handle_t handle)
out.len = csize;
/* If we read the od back from the swap space,
* then we keep it in the staging memory */
struct obj_data_ptr_flat_list_entry *od_flat_entry;
if(from_obj) {
obj_data_free(od);
}
Expand Down

0 comments on commit caf0eee

Please sign in to comment.