1
1

Add timing tests for the TM ras

This commit was SVN r12445.
Этот коммит содержится в:
Ralph Castain 2006-11-06 18:41:22 +00:00
родитель 68d9922f44
Коммит 884caeb2c7
3 изменённых файлов: 35 добавлений и 1 удалений

Просмотреть файл

@ -80,6 +80,7 @@ typedef struct orte_ras_base_t {
opal_list_t ras_available;
bool ras_available_valid;
orte_std_cntr_t ras_num_nodes;
bool timing;
} orte_ras_base_t;
ORTE_DECLSPEC extern orte_ras_base_t orte_ras_base;

Просмотреть файл

@ -132,6 +132,16 @@ int orte_ras_base_open(void)
return ORTE_SUCCESS;
}
/* check for timing tests */
param = mca_base_param_reg_int_name("orte", "timing",
"Request that critical timing loops be measured",
false, false, 0, &value);
if (value != 0) {
orte_ras_base.timing = true;
} else {
orte_ras_base.timing = false;
}
/* Open up all available components */
if (ORTE_SUCCESS !=
mca_base_components_open("ras", orte_ras_base.ras_output,

Просмотреть файл

@ -150,7 +150,13 @@ static int discover(opal_list_t* nodelist)
opal_list_t new_nodes;
tm_node_id *tm_node_ids;
char *hostname, *arch;
struct timeval start, stop;
/* check for timing request - get start time if so */
if (orte_ras_base.timing) {
gettimeofday(&start, NULL);
}
/* Ignore anything that the user already specified -- we're
getting nodes only from TM. */
@ -168,6 +174,15 @@ static int discover(opal_list_t* nodelist)
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* check for timing request - get stop time and report elapsed time if so */
if (orte_ras_base.timing) {
gettimeofday(&stop, NULL);
opal_output(0, "ras_tm: time to do nodeinfo is %ld usec",
(long int)((stop.tv_sec - start.tv_sec)*1000000 +
(stop.tv_usec - start.tv_usec)));
gettimeofday(&start, NULL);
}
/* Iterate through all the nodes and make an entry for each. TM
node ID's will never be duplicated, but they may end up
resolving to the same hostname (i.e., vcpu's on a single
@ -221,6 +236,15 @@ static int discover(opal_list_t* nodelist)
}
}
/* check for timing request - get stop time and report elapsed time if so */
if (orte_ras_base.timing) {
gettimeofday(&stop, NULL);
opal_output(0, "ras_tm: time to get hostnames is %ld usec",
(long int)((stop.tv_sec - start.tv_sec)*1000000 +
(stop.tv_usec - start.tv_usec)));
gettimeofday(&start, NULL);
}
/* Add these nodes to the registry, and return all the values */
opal_output(orte_ras_base.ras_output,
@ -236,7 +260,6 @@ static int discover(opal_list_t* nodelist)
}
/* All done */
if (ORTE_SUCCESS == ret) {
opal_output(orte_ras_base.ras_output,
"ras:tm:allocate:discover: success");