Example #1
0
bool colvarparse::get_keyval(std::string const &conf,
                             char const *key,
                             bool &value,
                             bool const &def_value,
                             Parse_Mode const parse_mode)
{
  std::string data;
  bool b_found = false, b_found_any = false;
  size_t save_pos = 0, found_count = 0;

  do {
    std::string data_this = "";
    b_found = key_lookup(conf, key, data_this, save_pos);
    if (b_found) {
      if (!b_found_any)
        b_found_any = true;
      found_count++;
      data = data_this;
    }
  } while (b_found);

  if (found_count > 1)
    cvm::log("Warning: found more than one instance of \""+
             std::string(key)+"\".\n");

  if (data.size()) {
    if ( (data == std::string("on")) ||
         (data == std::string("yes")) ||
         (data == std::string("true")) ) {
      value = true;
    } else if ( (data == std::string("off")) ||
                (data == std::string("no")) ||
                (data == std::string("false")) ) {
      value = false;
    } else
      cvm::fatal_error("Error: boolean values only are allowed "
                       "for \""+std::string(key)+"\".\n");
    if (parse_mode != parse_silent) {
      cvm::log("# "+std::string(key)+" = "+
               (value ? "on" : "off")+"\n");
    }
  } else {

    if (b_found_any) {
      if (parse_mode != parse_silent) {
        cvm::log("# "+std::string(key)+" = on\n");
      }
      value = true;
    } else {
      value = def_value;
      if (parse_mode != parse_silent) {
        cvm::log("# "+std::string(key)+" = "+
                 (def_value ? "on" : "off")+" [default]\n");
      }
    }
  }

  return b_found_any;
}
Example #2
0
int
heim_w32_delete_key(HEIM_PRIV_thread_key key)
{
    tls_keys *key_defs;
    size_t dtor_idx;

    key_lookup(key, &key_defs, &dtor_idx, NULL);
    if (key_defs == NULL)
        return EINVAL;
    key_defs->keys_dtors[dtor_idx] = DEAD_KEY;
    return 0;
}
colvar::distance_z::distance_z(std::string const &conf)
  : cvc(conf)
{
  function_type = "distance_z";
  b_inverse_gradients = true;
  b_Jacobian_derivative = true;
  x.type(colvarvalue::type_scalar);

  // TODO detect PBC from MD engine (in simple cases)
  // and then update period in real time
  if (period != 0.0)
    b_periodic = true;

  if ((wrap_center != 0.0) && (period == 0.0)) {
    cvm::error("Error: wrapAround was defined in a distanceZ component,"
                " but its period has not been set.\n");
    return;
  }

  parse_group(conf, "main", main);
  parse_group(conf, "ref", ref1);
  atom_groups.push_back(&main);
  atom_groups.push_back(&ref1);
  // this group is optional
  parse_group(conf, "ref2", ref2, true);

  if (ref2.size()) {
    atom_groups.push_back(&ref2);
    cvm::log("Using axis joining the centers of mass of groups \"ref\" and \"ref2\"");
    fixed_axis = false;
    if (key_lookup(conf, "axis"))
      cvm::log("Warning: explicit axis definition will be ignored!");
  } else {
    if (get_keyval(conf, "axis", axis, cvm::rvector(0.0, 0.0, 1.0))) {
      if (axis.norm2() == 0.0) {
        cvm::error("Axis vector is zero!");
        return;
      }
      if (axis.norm2() != 1.0) {
        axis = axis.unit();
        cvm::log("The normalized axis is: "+cvm::to_str(axis)+".\n");
      }
    }
    fixed_axis = true;
  }

  if (get_keyval(conf, "forceNoPBC", b_no_PBC, false)) {
    cvm::log("Computing distance using absolute positions (not minimal-image)");
  }
  if (get_keyval(conf, "oneSiteSystemForce", b_1site_force, false)) {
    cvm::log("Computing system force on group \"main\" only");
  }
}
colvar::distance_z::distance_z(std::string const &conf)
  : cvc(conf)
{
  function_type = "distance_z";
  provide(f_cvc_inv_gradient);
  provide(f_cvc_Jacobian);
  enable(f_cvc_com_based);
  x.type(colvarvalue::type_scalar);

  // TODO detect PBC from MD engine (in simple cases)
  // and then update period in real time
  if (period != 0.0)
    b_periodic = true;

  if ((wrap_center != 0.0) && (period == 0.0)) {
    cvm::error("Error: wrapAround was defined in a distanceZ component,"
                " but its period has not been set.\n");
    return;
  }

  main = parse_group(conf, "main");
  ref1 = parse_group(conf, "ref");
  // this group is optional
  ref2 = parse_group(conf, "ref2", true);

  if (ref2 && ref2->size()) {
    cvm::log("Using axis joining the centers of mass of groups \"ref\" and \"ref2\"");
    fixed_axis = false;
    if (key_lookup(conf, "axis"))
      cvm::log("Warning: explicit axis definition will be ignored!");
  } else {
    if (get_keyval(conf, "axis", axis, cvm::rvector(0.0, 0.0, 1.0))) {
      if (axis.norm2() == 0.0) {
        cvm::error("Axis vector is zero!");
        return;
      }
      if (axis.norm2() != 1.0) {
        axis = axis.unit();
        cvm::log("The normalized axis is: "+cvm::to_str(axis)+".\n");
      }
    }
    fixed_axis = true;
  }

  if (get_keyval(conf, "forceNoPBC", b_no_PBC, false)) {
    cvm::log("Computing distance using absolute positions (not minimal-image)");
  }

  init_total_force_params(conf);

}
void colvar::cvc::parse_group (std::string const &conf, 
                               char const *group_key,
                               cvm::atom_group &group,
                               bool optional)
{
  if (key_lookup (conf, group_key)) {
    group.parse (conf, group_key);
  } else {
    if (! optional) {
      cvm::fatal_error ("Error: definition for atom group \""+
                      std::string (group_key)+"\" not found.\n");
    }
  }
}
Example #6
0
static struct key *key_get(const struct keychain *keychain, uint32_t index)
{
	struct key *key;

	key = key_lookup(keychain, index);

	if (key)
		return key;

	key = key_new();
	key->index = index;
	listnode_add_sort(keychain->key, key);

	return key;
}
int  main()
{
	key_int_installer();

    /* variables */
    char  key;  		/* an input key */

    int   buffer_ptr = 0;	/* the buffer pointer */



    /* infinite loop processing input */
    while(TRUE)  {

        /* wait for a key to be ready */
	while (!key_available());


	/* have keypad input - get the key */
	key = key_lookup();
	/* and store the key */
	key_buffer[buffer_ptr++] = key;

	/* make sure buffer pointer stays in range */
	if (buffer_ptr >= BUFFER_SIZE)
	    buffer_ptr -= BUFFER_SIZE;


	/* check if there is still a key available (shouldn't be) */
	if (key_available())  {

	    /* if there is a key available now, it's an error */
	    /* put ? in the buffer and update the buffer pointer */
	    key_buffer[buffer_ptr++] = '?';
	    /* make sure pointer stays in range */
	    if (buffer_ptr >= BUFFER_SIZE)
	        buffer_ptr -= BUFFER_SIZE;
        }
    }


    /* done with main (never should get here), return 0 */
    return  0;

}
Example #8
0
void colvar::cvc::parse_group (std::string const &conf,
                               char const *group_key,
                               cvm::atom_group &group,
                               bool optional)
{
  if (key_lookup (conf, group_key)) {
    if (group.parse (conf, group_key) != COLVARS_OK) {
      cvm::error ("Error parsing definition for atom group \""+
                         std::string (group_key)+"\".\n");
      return;
    }
  } else {
    if (! optional) {
      cvm::error ("Error: definition for atom group \""+
                      std::string (group_key)+"\" not found.\n");
      return;
    }
  }
}
Example #9
0
cvm::atom_group *colvar::cvc::parse_group(std::string const &conf,
                                          char const *group_key,
                                          bool optional)
{
  cvm::atom_group *group = NULL;

  if (key_lookup(conf, group_key)) {
    group = new cvm::atom_group;
    group->key = group_key;

    if (b_try_scalable) {
      // TODO rewrite this logic in terms of dependencies
      if (is_available(f_cvc_scalable_com) && is_available(f_cvc_com_based)) {
        enable(f_cvc_scalable_com);
        enable(f_cvc_scalable);
        group->enable(f_ag_scalable_com);
        group->enable(f_ag_scalable);
      }

      // TODO check for other types of parallelism here

      if (is_enabled(f_cvc_scalable)) {
        cvm::log("Will enable scalable calculation for group \""+group->key+"\".\n");
      } else {
        cvm::log("Scalable calculation is not available for group \""+group->key+"\" with the current configuration.\n");
      }
    }

    if (group->parse(conf) == COLVARS_OK) {
      atom_groups.push_back(group);
    } else {
      cvm::error("Error parsing definition for atom group \""+
                         std::string(group_key)+"\".\n");
    }
  } else {
    if (! optional) {
      cvm::error("Error: definition for atom group \""+
                      std::string(group_key)+"\" not found.\n");
    }
  }
  return group;
}
Example #10
0
int
heim_w32_setspecific(HEIM_PRIV_thread_key key, void *value)
{
    void **new_values;
    size_t new_num;
    void (*dtor)(void *);
    size_t i;

#if !defined(WIN32)
    (void) pthread_setspecific(pt_key, DEAD_KEY);
#endif

    key_lookup(key, NULL, NULL, &dtor);
    if (dtor == NULL)
        return EINVAL;

    if (key >= values.values_num) {
        if (values.values_num == 0) {
            values.values = NULL;
            new_num = 8;
        } else {
            new_num = (values.values_num + values.values_num / 2);
        }
        new_values = realloc(values.values, sizeof(void *) * new_num);
        if (new_values == NULL)
            return ENOMEM;
        for (i = values.values_num; i < new_num; i++)
            new_values[i] = NULL;
        values.values = new_values;
        values.values_num = new_num;
    }

    assert(key < values.values_num);

    if (values.values[key] != NULL && dtor != NULL && dtor != DEAD_KEY)
        dtor(values.values[key]);

    values.values[key] = value;
    return 0;
}
Example #11
0
bool colvarparse::get_key_string_value(std::string const &conf,
                                       char const *key, std::string &data)
{
  bool b_found = false, b_found_any = false;
  size_t save_pos = 0, found_count = 0;

  do {
    std::string data_this = "";
    b_found = key_lookup(conf, key, &data_this, &save_pos);
    if (b_found) {
      if (!b_found_any)
        b_found_any = true;
      found_count++;
      data = data_this;
    }
  } while (b_found);

  if (found_count > 1) {
    cvm::error("Error: found more than one instance of \""+
               std::string(key)+"\".\n", INPUT_ERROR);
  }

  return b_found_any;
}
Example #12
0
/*
 * lookup a key given a key ID from userspace with a given permissions mask
 * - don't create special keyrings unless so requested
 * - partially constructed keys aren't found unless requested
 */
struct key *lookup_user_key(key_serial_t id, int create, int partial,
			    key_perm_t perm)
{
	struct task_struct *tsk = current;
	unsigned long flags;
	struct key *key;
	int ret;

	key = ERR_PTR(-ENOKEY);

	switch (id) {
	case KEY_SPEC_THREAD_KEYRING:
		if (!tsk->thread_keyring) {
			if (!create)
				goto error;

			ret = install_thread_keyring(tsk);
			if (ret < 0) {
				key = ERR_PTR(ret);
				goto error;
			}
		}

		key = tsk->thread_keyring;
		atomic_inc(&key->usage);
		break;

	case KEY_SPEC_PROCESS_KEYRING:
		if (!tsk->signal->process_keyring) {
			if (!create)
				goto error;

			ret = install_process_keyring(tsk);
			if (ret < 0) {
				key = ERR_PTR(ret);
				goto error;
			}
		}

		key = tsk->signal->process_keyring;
		atomic_inc(&key->usage);
		break;

	case KEY_SPEC_SESSION_KEYRING:
		if (!tsk->signal->session_keyring) {
			/* always install a session keyring upon access if one
			 * doesn't exist yet */
			ret = install_session_keyring(
			       tsk, tsk->user->session_keyring);
			if (ret < 0)
				goto error;
		}

		spin_lock_irqsave(&tsk->sighand->siglock, flags);
		key = tsk->signal->session_keyring;
		atomic_inc(&key->usage);
		spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
		break;

	case KEY_SPEC_USER_KEYRING:
		key = tsk->user->uid_keyring;
		atomic_inc(&key->usage);
		break;

	case KEY_SPEC_USER_SESSION_KEYRING:
		key = tsk->user->session_keyring;
		atomic_inc(&key->usage);
		break;

	case KEY_SPEC_GROUP_KEYRING:
		/* group keyrings are not yet supported */
		key = ERR_PTR(-EINVAL);
		goto error;

	default:
		key = ERR_PTR(-EINVAL);
		if (id < 1)
			goto error;

		key = key_lookup(id);
		if (IS_ERR(key))
			goto error;
		break;
	}

	/* check the status and permissions */
	if (perm) {
		ret = key_validate(key);
		if (ret < 0)
			goto invalid_key;
	}

	ret = -EIO;
	if (!partial && !(key->flags & KEY_FLAG_INSTANTIATED))
		goto invalid_key;

	ret = -EACCES;
	if (!key_permission(key, perm))
		goto invalid_key;

 error:
	return key;

 invalid_key:
	key_put(key);
	key = ERR_PTR(ret);
	goto error;

} /* end lookup_user_key() */
Example #13
0
int cvm::atom_group::parse(std::string const &conf)
{
  std::string group_conf;

  // TODO move this to the cvc class constructor/init

  // save_delimiters is set to false for this call, because "conf" is
  // not the config string of this group, but of its parent object
  // (which has already taken care of the delimiters)
  save_delimiters = false;
  key_lookup(conf, key.c_str(), group_conf, dummy_pos);
  // restoring the normal value, because we do want keywords checked
  // inside "group_conf"
  save_delimiters = true;

  if (group_conf.size() == 0) {
    cvm::error("Error: atom group \""+key+
               "\" is set, but has no definition.\n",
               INPUT_ERROR);
    return COLVARS_ERROR;
  }

  cvm::increase_depth();

  cvm::log("Initializing atom group \""+key+"\".\n");

  description = "atom group " + key;

  // whether or not to include messages in the log
  // colvarparse::Parse_Mode mode = parse_silent;
  // {
  //   bool b_verbose;
  //   get_keyval (group_conf, "verboseOutput", b_verbose, false, parse_silent);
  //   if (b_verbose) mode = parse_normal;
  // }
  // colvarparse::Parse_Mode mode = parse_normal;

  int parse_error = COLVARS_OK;

  {
    std::string numbers_conf = "";
    size_t pos = 0;
    while (key_lookup(group_conf, "atomNumbers", numbers_conf, pos)) {
      parse_error |= add_atom_numbers(numbers_conf);
      numbers_conf = "";
    }
  }

  {
    std::string index_group_name;
    if (get_keyval(group_conf, "indexGroup", index_group_name)) {
      // use an index group from the index file read globally
      parse_error |= add_index_group(index_group_name);
    }
  }

  {
    std::string range_conf = "";
    size_t pos = 0;
    while (key_lookup(group_conf, "atomNumbersRange",
                      range_conf, pos)) {
      parse_error |= add_atom_numbers_range(range_conf);
      range_conf = "";
    }
  }

  {
    std::vector<std::string> psf_segids;
    get_keyval(group_conf, "psfSegID", psf_segids, std::vector<std::string>());
    std::vector<std::string>::iterator psii;
    for (psii = psf_segids.begin(); psii < psf_segids.end(); ++psii) {
      if ( (psii->size() == 0) || (psii->size() > 4) ) {
        cvm::error("Error: invalid PSF segment identifier provided, \""+
                   (*psii)+"\".\n", INPUT_ERROR);
      }
    }

    std::string range_conf = "";
    size_t pos = 0;
    size_t range_count = 0;
    psii = psf_segids.begin();
    while (key_lookup(group_conf, "atomNameResidueRange",
                      range_conf, pos)) {
      range_count++;
      if (psf_segids.size() && (range_count > psf_segids.size())) {
        cvm::error("Error: more instances of \"atomNameResidueRange\" than "
                   "values of \"psfSegID\".\n", INPUT_ERROR);
      } else {
        parse_error |= add_atom_name_residue_range(psf_segids.size() ?
          *psii : std::string(""), range_conf);
        if (psf_segids.size()) psii++;
      }
      range_conf = "";
    }
  }

  {
    // read the atoms from a file
    std::string atoms_file_name;
    if (get_keyval(group_conf, "atomsFile", atoms_file_name, std::string(""))) {

      std::string atoms_col;
      if (!get_keyval(group_conf, "atomsCol", atoms_col, std::string(""))) {
        cvm::error("Error: parameter atomsCol is required if atomsFile is set.\n",
                   INPUT_ERROR);
      }

      double atoms_col_value;
      bool const atoms_col_value_defined = get_keyval(group_conf, "atomsColValue", atoms_col_value, 0.0);
      if (atoms_col_value_defined && (!atoms_col_value)) {
        cvm::error("Error: atomsColValue, if provided, must be non-zero.\n", INPUT_ERROR);
      }

      cvm::load_atoms(atoms_file_name.c_str(), *this, atoms_col, atoms_col_value);
    }
  }

  // Catch any errors from all the initialization steps above
  if (parse_error || cvm::get_error()) return (parse_error || cvm::get_error());

  // checks of doubly-counted atoms have been handled by add_atom() already

  if (get_keyval(group_conf, "dummyAtom", dummy_atom_pos, cvm::atom_pos())) {
    b_dummy = true;
    // note: atoms_ids.size() is used here in lieu of atoms.size(),
    // which can be empty for scalable groups
    if (atoms_ids.size()) {
      cvm::error("Error: cannot set up group \""+
                 key+"\" as a dummy atom "
                 "and provide it with atom definitions.\n", INPUT_ERROR);
    }
  } else {
    b_dummy = false;

    if (!(atoms_ids.size())) {
      cvm::error("Error: no atoms defined for atom group \""+
                 key+"\".\n", INPUT_ERROR);
    }

    // whether these atoms will ever receive forces or not
    bool enable_forces = true;
    // disableForces is deprecated
    if (get_keyval(group_conf, "enableForces", enable_forces, true)) {
      noforce = !enable_forces;
    } else {
      get_keyval(group_conf, "disableForces", noforce, false, colvarparse::parse_silent);
    }
  }

  if (is_enabled(f_ag_scalable) && !b_dummy) {
    index = (cvm::proxy)->init_atom_group(atoms_ids);
  }

  parse_error |= parse_fitting_options(group_conf);

  // TODO move this to colvarparse object
  check_keywords(group_conf, key.c_str());
  if (cvm::get_error()) {
    cvm::error("Error setting up atom group \""+key+"\".");
    return COLVARS_ERROR;
  }

  // Calculate all required properties (such as total mass)
  setup();

  if (cvm::debug())
    cvm::log("Done initializing atom group \""+key+"\".\n");

  cvm::log("Atom group \""+key+"\" defined, "+
            cvm::to_str(atoms_ids.size())+" atoms initialized: total mass = "+
	    cvm::to_str(total_mass)+", total charge = "+
            cvm::to_str(total_charge)+".\n");

  cvm::decrease_depth();

  return (cvm::get_error() ? COLVARS_ERROR : COLVARS_OK);
}
Example #14
0
/*
 * lookup a key given a key ID from userspace with a given permissions mask
 * - don't create special keyrings unless so requested
 * - partially constructed keys aren't found unless requested
 */
key_ref_t lookup_user_key(struct task_struct *context, key_serial_t id,
			  int create, int partial, key_perm_t perm)
{
	key_ref_t key_ref, skey_ref;
	struct key *key;
	int ret;

	if (!context)
		context = current;

	key_ref = ERR_PTR(-ENOKEY);

	switch (id) {
	case KEY_SPEC_THREAD_KEYRING:
		if (!context->thread_keyring) {
			if (!create)
				goto error;

			ret = install_thread_keyring(context);
			if (ret < 0) {
				key = ERR_PTR(ret);
				goto error;
			}
		}

		key = context->thread_keyring;
		atomic_inc(&key->usage);
		key_ref = make_key_ref(key, 1);
		break;

	case KEY_SPEC_PROCESS_KEYRING:
		if (!context->signal->process_keyring) {
			if (!create)
				goto error;

			ret = install_process_keyring(context);
			if (ret < 0) {
				key = ERR_PTR(ret);
				goto error;
			}
		}

		key = context->signal->process_keyring;
		atomic_inc(&key->usage);
		key_ref = make_key_ref(key, 1);
		break;

	case KEY_SPEC_SESSION_KEYRING:
		if (!context->signal->session_keyring) {
			/* always install a session keyring upon access if one
			 * doesn't exist yet */
			ret = install_session_keyring(
				context, context->user->session_keyring);
			if (ret < 0)
				goto error;
		}

		rcu_read_lock();
		key = rcu_dereference(context->signal->session_keyring);
		atomic_inc(&key->usage);
		rcu_read_unlock();
		key_ref = make_key_ref(key, 1);
		break;

	case KEY_SPEC_USER_KEYRING:
		key = context->user->uid_keyring;
		atomic_inc(&key->usage);
		key_ref = make_key_ref(key, 1);
		break;

	case KEY_SPEC_USER_SESSION_KEYRING:
		key = context->user->session_keyring;
		atomic_inc(&key->usage);
		key_ref = make_key_ref(key, 1);
		break;

	case KEY_SPEC_GROUP_KEYRING:
		/* group keyrings are not yet supported */
		key = ERR_PTR(-EINVAL);
		goto error;

	case KEY_SPEC_REQKEY_AUTH_KEY:
		key = context->request_key_auth;
		if (!key)
			goto error;

		atomic_inc(&key->usage);
		key_ref = make_key_ref(key, 1);
		break;

	default:
		key_ref = ERR_PTR(-EINVAL);
		if (id < 1)
			goto error;

		key = key_lookup(id);
		if (IS_ERR(key)) {
			key_ref = ERR_PTR(PTR_ERR(key));
			goto error;
		}

		key_ref = make_key_ref(key, 0);

		/* check to see if we possess the key */
		skey_ref = search_process_keyrings(key->type, key,
						   lookup_user_key_possessed,
						   current);

		if (!IS_ERR(skey_ref)) {
			key_put(key);
			key_ref = skey_ref;
		}

		break;
	}

	/* check the status */
	if (perm) {
		ret = key_validate(key);
		if (ret < 0)
			goto invalid_key;
	}

	ret = -EIO;
	if (!partial && !test_bit(KEY_FLAG_INSTANTIATED, &key->flags))
		goto invalid_key;

	/* check the permissions */
	ret = key_task_permission(key_ref, context, perm);
	if (ret < 0)
		goto invalid_key;

error:
	return key_ref;

invalid_key:
	key_ref_put(key_ref);
	key_ref = ERR_PTR(ret);
	goto error;

} /* end lookup_user_key() */
void cvm::atom_group::parse (std::string const &conf,
                             char const        *key)
{
  std::string group_conf;

  // save_delimiters is set to false for this call, because "conf" is
  // not the config string of this group, but of its parent object
  // (which has already taken care of the delimiters)
  save_delimiters = false;
  key_lookup (conf, key, group_conf, dummy_pos);
  // restoring the normal value, because we do want keywords checked
  // inside "group_conf"
  save_delimiters = true;

  if (group_conf.size() == 0) {
    cvm::fatal_error ("Error: atom group \""+
                      std::string (key)+"\" is set, but "
                      "has no definition.\n");
  }

  cvm::increase_depth();

  cvm::log ("Initializing atom group \""+std::string (key)+"\".\n");

  // whether or not to include messages in the log
  // colvarparse::Parse_Mode mode = parse_silent;
  // {
  //   bool b_verbose;
  //   get_keyval (group_conf, "verboseOutput", b_verbose, false, parse_silent);
  //   if (b_verbose) mode = parse_normal;
  // }
  colvarparse::Parse_Mode mode = parse_normal;

  {
    //    std::vector<int> atom_indexes;
    std::string numbers_conf = "";
    size_t pos = 0;
    std::vector<int> atom_indexes;
    while (key_lookup (group_conf, "atomNumbers", numbers_conf, pos)) {
      if (numbers_conf.size()) {
        std::istringstream is (numbers_conf);
        int ia;
        while (is >> ia) {
          atom_indexes.push_back (ia);
        }
      }

      if (atom_indexes.size()) {
        this->reserve (this->size()+atom_indexes.size());
        for (size_t i = 0; i < atom_indexes.size(); i++) {
          this->push_back (cvm::atom (atom_indexes[i]));
        }
      } else
        cvm::fatal_error ("Error: no numbers provided for \""
                          "atomNumbers\".\n");

      atom_indexes.clear();
    }

    std::string index_group_name;
    if (get_keyval (group_conf, "indexGroup", index_group_name)) {
      // use an index group from the index file read globally
      std::list<std::string>::iterator names_i = cvm::index_group_names.begin();
      std::list<std::vector<int> >::iterator index_groups_i = cvm::index_groups.begin();
      for ( ; names_i != cvm::index_group_names.end() ; names_i++, index_groups_i++) {
        if (*names_i == index_group_name)
          break;
      }
      if (names_i == cvm::index_group_names.end()) {
        cvm::fatal_error ("Error: could not find index group "+
                          index_group_name+" among those provided by the index file.\n");
      }
      this->reserve (index_groups_i->size());
      for (size_t i = 0; i < index_groups_i->size(); i++) {
        this->push_back (cvm::atom ((*index_groups_i)[i]));
      }
    }
  }