- void *data;
-
- pd->userdata = NULL;
- pd->libdata = xbt_dict_new();
-
- xbt_dynar_foreach(_gras_procdata_fabrics,cursor,fab){
- int found = 0;
-
- xbt_assert1(fab.name,"Name of fabric #%d is NULL!",cursor);
- DEBUG1("Create the procdata for %s",fab.name);
+ xbt_set_elm_t elem;
+
+ 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)) {
+ XBT_DEBUG("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 */
+ }
+ XBT_DEBUG("Go ahead for cursor %d, there is %ld libdata",
+ cursor, xbt_set_length(pd->libdata));
+
+ xbt_assert(fab.name, "Name of fabric #%d is NULL!", cursor);
+ XBT_DEBUG("Create the procdata for %s", fab.name);