- pd->userdata = NULL;
- pd->libdata = xbt_dict_new();
-
- xbt_dynar_foreach(_gras_procdata_fabrics,cursor,fab){
- int found = 0;
+ if (!pd->libdata) {
+ pd->userdata = NULL;
+ pd->libdata = xbt_set_new();
+ }
+
+ xbt_dynar_foreach(_gras_procdata_fabrics,cursor,fab){
+ volatile int found = 0;
+
+ if (cursor+1 <= xbt_set_length(pd->libdata)) {
+ DEBUG2("Skip fabric %d: there is already %ld libdata",
+ cursor, xbt_set_length(pd->libdata));
+ continue; /* allow to recall this function to get recently added fabrics */
+ }
+ DEBUG2("Go ahead for cursor %d, there is %ld libdata",
+ cursor,xbt_set_length(pd->libdata));