Skip to content
Snippets Groups Projects
Commit 64a35bf1 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

xt_config: Add flag operation to simplify setting of value.

parent f8b6cbcd
No related branches found
No related tags found
No related merge requests found
......@@ -257,10 +257,7 @@ void xt_config_set_sort_algorithm_by_id(Xt_config config, int algo)
void
xt_config_set_mem_saving(Xt_config config, int memconserve)
{
if (memconserve)
XT_CONFIG_SET_FORCE_NOSORT(config);
else
XT_CONFIG_UNSET_FORCE_NOSORT(config);
XT_CONFIG_SET_FORCE_NOSORT_BIT(config, memconserve);
}
int
......
......@@ -134,6 +134,10 @@ xt_config_get_exchange_new_by_comm(Xt_config config, MPI_Comm comm);
do { (config)->flags |= (uint32_t)xt_force_nosort; } while (0)
#define XT_CONFIG_UNSET_FORCE_NOSORT(config) \
do { (config)->flags &= ~(uint32_t)xt_force_nosort; } while (0)
#define XT_CONFIG_SET_FORCE_NOSORT_BIT(config, val) \
do { (config)->flags = ((config)->flags & \
~(uint32_t)xt_force_nosort) \
| ((uint32_t)(val != 0) << xt_force_nosort_bit_ofs); } while (0)
#define XT_CONFIG_GET_XMAP_STRIPING(config) \
(((config)->flags >> xt_force_xmap_striping_bit_ofs) & 3U)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment