[mpich-discuss] Number processes/CPU in Hydra -hostlist

Yauheni Zelenko zelenko at cadence.com
Mon Jul 26 13:56:15 CDT 2010


Hi!

I want to suggest next patch which will allow to specify number of processes/CPU in -hostlist command line option in Hydra.

Goal is to provide similar functionality as Platform LSF's LSB_MCPU_HOSTS.

Host name and number of CPUs may be separated with colon or space.

Changes are in /home/zelenko/Installs/GCC4.4.0/mpich2-1.3a2.src/src/pm/hydra/ui/mpich/utils., hostlist_fn()

from:

    while (hostname) {
        status = HYDU_add_to_node_list(hostname, 1, &HYD_handle.node_list);
        HYDU_ERR_POP(status, "unable to add to node list\n");

        hostname = strtok(NULL, ",");
    }

to:

    while (hostname) {
	char* num_procs_str = NULL;
	int num_procs = 1;

	num_procs_str = strchr(hostname, ':');
	if (!num_procs_str)
	    num_procs_str = strchr(hostname, ' ');
	if (num_procs_str)
	    {
		*num_procs_str = '\0';
		num_procs_str++;
		num_procs = atoi(num_procs_str);
	    }
        status = HYDU_add_to_node_list(hostname, num_procs, &HYD_handle.node_list);
        HYDU_ERR_POP(status, "unable to add to node list\n");

        hostname = strtok(NULL, ",");
    }

Eugene.


More information about the mpich-discuss mailing list