Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3eb840d
TRQ-1582. This had already been fixed in trunk but I'm just removing …
Jan 18, 2013
94d7b67
Merge https://github.com/actorquedeveloper/torque
Jan 18, 2013
5ec3791
Merge https://github.com/actorquedeveloper/torque
Jan 21, 2013
b108ae3
Fix some formatting and two scaffolding issues that have somehow slip…
Jan 21, 2013
0505bb7
Fix the Makefile for req_deletearray's test directory so that it link…
Jan 22, 2013
eee46c7
Add STDIN.* files to .gitignore.
Jan 22, 2013
19d8a59
Merge pull request #3 from adaptivecomputing/master
actorquedeveloper Jan 22, 2013
3ff0702
Do some cleanup on some functions - don't examine a queue object whil…
Jan 22, 2013
dc3b4c5
Fix some Makefile.ams so that make check runs correctly.
Jan 22, 2013
e889f26
Merge https://github.com/actorquedeveloper/torque
Jan 22, 2013
ac06f84
Fix a problem with a unit test for mom_comm.c. I think this was cause…
Jan 22, 2013
b191093
Fix for TRQ-1447: Deadlock in server under load...
elicha Jan 22, 2013
af48f3e
Fixed compiling error.
elicha Jan 22, 2013
0d55616
Fix up some of the unit testing code.
Jan 22, 2013
d4478b2
Fix bugzilla #225 - add support for the mppdepth directive
Jan 22, 2013
400947f
Fix a deadlock introduced by the mutex managing code in job_route()
Jan 22, 2013
de79a03
Fix two problems with the unit testing.
Jan 22, 2013
6964331
Fix two more problems in the unit tests.
Jan 22, 2013
a6e9343
Fix one more error with the scaffolding.
Jan 23, 2013
c569b11
No longer attempt to unit test the tools directory.
Jan 23, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -454,3 +454,4 @@ tmporig
tmpfile
src/lib/Libutils/test/u_mutex_mgr/test_u_mutex_mgr
src/resmom/linux/test/cpuset/test_cpuset
STDIN.*
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ c - crash b - bug fix e - enhancement f - new feature n - note

4.1.5
b - For cray: make sure that reservations are released when jobs are requeued. TRQ-1572.
b - For cray: support the mppdepth directive. Bugzilla #225.

4.1.4
e - When in cray mode, write physmem and availmem in addition to totmem so that
Expand Down
6 changes: 1 addition & 5 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ endif

SUBDIRS = include test lib $(SERVER_DIRS) $(MOM_DIRS) $(CLIENTS_DIRS) $(GUI_DIRS) $(PAM_DIRS) $(DRMAA_DIRS)

if HAVE_CHECK
SUBDIRS += test
endif

install_mom:
for dir in $(MOM_DIRS) lib ;do (cd $$dir && $(MAKE) install);done

Expand All @@ -62,7 +58,7 @@ install_pam:
install_drmaa:
for dir in $(DRMAA_DIRS) ;do (cd $$dir && $(MAKE) install);done

CHECK_DIRS = server resmom momctl lib cmds tools
CHECK_DIRS = test server resmom momctl lib cmds tools

.PHONY: cleancheck
cleancheck:
Expand Down
2 changes: 2 additions & 0 deletions src/include/alps_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
#define DEFAULT_APBASIL_PATH "/usr/bin/apbasil"
#define DEFAULT_APBASIL_PROTOCOL "1.0"
#define APBASIL_QUERY "echo \"<?xml version='1.0'?><BasilRequest protocol='%s' method='QUERY' type='INVENTORY'></BasilRequest>\" | %s"
#define APBASIL_RESERVE_PARAM_BEGIN_DEPTH "<ReserveParam architecture='XT' width='%d' nppn='%d' mppdepth='%d'><NodeParamArray><NodeParam>"
#define APBASIL_RESERVE_PARAM_BEGIN_DEPTH_SANS_NPPN "<ReserveParam architecture='XT' width='%d' mppdepth='%d'><NodeParamArray><NodeParam>"
#define APBASIL_RESERVE_PARAM_BEGIN "<ReserveParam architecture='XT' width='%d' nppn='%d'><NodeParamArray><NodeParam>"
#define APBASIL_RESERVE_PARAM_BEGIN_SANS_NPPN "<ReserveParam architecture='XT' width='%d'><NodeParamArray><NodeParam>"
#define APBASIL_RESERVE_PARAM_END "</NodeParam></NodeParamArray></ReserveParam>"
Expand Down
2 changes: 1 addition & 1 deletion src/include/alps_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int get_alps_statuses(struct pbsnode *parent, struct batch_request *preq, int *b

int destroy_alps_reservation(char *reservation_id, char *apbasil_path, char *apbasil_protocol);

int create_alps_reservation(char *exec_hosts, char *username, char *jobid, char *apbasil_path, char *apbasil_protocol, long long pagg_id, int use_nppn, char **reservation_id);
int create_alps_reservation(char *exec_hosts, char *username, char *jobid, char *apbasil_path, char *apbasil_protocol, long long pagg_id, int use_nppn, int mppdepth, char **reservation_id);

int find_error_type(xmlNode *node);

Expand Down
2 changes: 1 addition & 1 deletion src/include/track_alps_reservations.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extern reservation_holder alps_reservations;

void initialize_alps_reservations();

int create_alps_reservation(job *pjob);
int track_alps_reservation(job *pjob);
int remove_alps_reservation(char *rsv_id);
int is_orphaned(char *rsv_id);
int already_recorded(char *rsv_id);
Expand Down
3 changes: 3 additions & 0 deletions src/lib/Libcmds/test/cnt2server/scaffolding.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

int pbs_errno = 0;

extern "C"
{
int pbs_connect(char *server_name_ptr)
{
fprintf(stderr, "The call to pbs_connect needs to be mocked!!\n");
Expand All @@ -29,3 +31,4 @@ char *pbs_strerror(
{
return(NULL);
}
}
3 changes: 3 additions & 0 deletions src/lib/Libcmds/test/prt_job_err/scaffolding.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

int pbs_errno = 0;

extern "C"
{
char *pbs_geterrmsg(int connect)
{
fprintf(stderr, "The call to get_server needs to be mocked!!\n");
exit(1);
}
}
36 changes: 18 additions & 18 deletions src/lib/Libifl/trq_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,24 +229,24 @@ void *process_svr_conn(
void *sock)

{
char *className = (char *)"trqauthd";
int rc = PBSE_NONE;
char *server_name = NULL;
int server_port = 0;
int auth_type = 0;
char *user_name = NULL;
int user_sock = 0;
char *error_msg = NULL;
char *send_message = NULL;
int send_len = 0;
char *trq_server_addr = NULL;
int trq_server_addr_len = 0;
int disconnect_svr = TRUE;
int svr_sock = 0;
int msg_len = 0;
int debug_mark = 0;
int local_socket = *(int *)sock;
char msg_buf[1024];
const char *className = "trqauthd";
int rc = PBSE_NONE;
char *server_name = NULL;
int server_port = 0;
int auth_type = 0;
char *user_name = NULL;
int user_sock = 0;
char *error_msg = NULL;
char *send_message = NULL;
int send_len = 0;
char *trq_server_addr = NULL;
int trq_server_addr_len = 0;
int disconnect_svr = TRUE;
int svr_sock = 0;
int msg_len = 0;
int debug_mark = 0;
int local_socket = *(int *)sock;
char msg_buf[1024];

/* incoming message format is:
* trq_system_len|trq_system|trq_port|Validation_type|user_len|user|psock|
Expand Down
15 changes: 3 additions & 12 deletions src/lib/Libutils/test/u_hash_map_structs/u_hash_map_structs_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ START_TEST(test_hash_print)
memmgr_destroy(&mm);
}
END_TEST

/* Testing this involves forcing this to exit - causing a failure. Don't test.
START_TEST(test_add_or_exit)
{
job_data *the_map = NULL;
Expand All @@ -153,7 +153,7 @@ START_TEST(test_add_or_exit)
calloc_fail = 1;
hash_add_or_exit(&mm, &the_map, name, value, var_type);
}
END_TEST
END_TEST */

START_TEST(test_hash_add_hash)
{
Expand Down Expand Up @@ -208,7 +208,7 @@ Suite *u_hash_map_structs_suite(void)
tcase_add_test(tc_core, test_hash_add_item_null);
tcase_add_test(tc_core, test_hash_add_item_add_find_add_find_del_cnt_del_find);
tcase_add_test(tc_core, test_hash_print);
tcase_add_exit_test(tc_core, test_add_or_exit, 1);
/*tcase_add_exit_test(tc_core, test_add_or_exit, 1);*/
tcase_add_test(tc_core, test_hash_add_hash);

suite_add_tcase(s, tc_core);
Expand All @@ -217,15 +217,6 @@ Suite *u_hash_map_structs_suite(void)

void rundebug()
{
job_data *the_map = NULL;
memmgr *mm = NULL;
const char *name = "simple_val";
char value[] = "should fail";
int var_type = 4;
memmgr_init(&mm, 0);
calloc_fail = 1;
hash_add_or_exit(&mm, &the_map, name, value, var_type);
memmgr_destroy(&mm);
}

int main(void)
Expand Down
1 change: 1 addition & 0 deletions src/lib/Libutils/u_hash_map_structs.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ void hash_add_or_exit(
const char *name, /* I - The item being added to the hashmap */
const char *val, /* I - Sets the value of variable */
int var_type) /* I - Sets the type of the variable */

{
if (hash_add_item(mm, head, name, val, var_type, SET) == FALSE)
{
Expand Down
33 changes: 24 additions & 9 deletions src/resmom/alps_reservations.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ int save_current_reserve_param(
dynamic_string *command,
dynamic_string *node_list,
unsigned int width,
int nppn)
int nppn,
int mppdepth)

{
char buf[MAXLINE * 2];
Expand All @@ -189,9 +190,19 @@ int save_current_reserve_param(
/* print out the current reservation param element */
/* place everything up to the node list */
if (nppn == -1)
snprintf(buf, sizeof(buf), APBASIL_RESERVE_PARAM_BEGIN_SANS_NPPN, width);
{
if (mppdepth == 0)
snprintf(buf, sizeof(buf), APBASIL_RESERVE_PARAM_BEGIN_SANS_NPPN, width);
else
snprintf(buf, sizeof(buf), APBASIL_RESERVE_PARAM_BEGIN_DEPTH_SANS_NPPN, width, mppdepth);
}
else
snprintf(buf, sizeof(buf), APBASIL_RESERVE_PARAM_BEGIN, width, nppn);
{
if (mppdepth == 0)
snprintf(buf, sizeof(buf), APBASIL_RESERVE_PARAM_BEGIN, width, nppn);
else
snprintf(buf, sizeof(buf), APBASIL_RESERVE_PARAM_BEGIN_DEPTH, width, nppn, mppdepth);
}

rc = append_dynamic_string(command, buf);

Expand All @@ -213,6 +224,7 @@ int create_reserve_params_from_host_req_list(

resizable_array *host_req_list, /* I */
int use_nppn, /* I */
int mppdepth, /* I */
dynamic_string *command) /* O */

{
Expand All @@ -238,7 +250,7 @@ int create_reserve_params_from_host_req_list(
if (use_nppn == FALSE)
nppn = -1;

save_current_reserve_param(command, node_list, width, nppn);
save_current_reserve_param(command, node_list, width, nppn, mppdepth);

return(PBSE_NONE);
} /* END create_reserve_params_from_host_req_list() */
Expand All @@ -249,6 +261,7 @@ int create_reserve_params_from_host_req_list(
int create_reserve_params_from_multi_req_list(

char *multi_req_list, /* I */
int mppdepth, /* I */
dynamic_string *command) /* O */

{
Expand All @@ -275,7 +288,7 @@ int create_reserve_params_from_multi_req_list(
nppn = atoi(tok);

width = nppn * node_count;
save_current_reserve_param(command, node_list, width, nppn);
save_current_reserve_param(command, node_list, width, nppn, mppdepth);
}

return(PBSE_NONE);
Expand All @@ -292,6 +305,7 @@ dynamic_string *get_reservation_command(
char *apbasil_path,
char *apbasil_protocol,
char *multi_req_list,
int mppdepth,
int use_nppn)

{
Expand All @@ -310,12 +324,12 @@ dynamic_string *get_reservation_command(

if (multi_req_list == NULL)
{
create_reserve_params_from_host_req_list(host_req_list, use_nppn, command);
create_reserve_params_from_host_req_list(host_req_list, use_nppn, mppdepth, command);
}
else
{
/* no need to account for use_nppn here, this path always should */
create_reserve_params_from_multi_req_list(multi_req_list, command);
create_reserve_params_from_multi_req_list(multi_req_list, mppdepth, command);
}

free_dynamic_string(node_list);
Expand Down Expand Up @@ -660,6 +674,7 @@ int create_alps_reservation(
char *apbasil_protocol,
long long pagg_id_value,
int use_nppn,
int mppdepth,
char **reservation_id)

{
Expand All @@ -685,13 +700,13 @@ int create_alps_reservation(
return(PBSE_NONE);
}

command = get_reservation_command(host_req_list, user, jobid, apbasil_path, apbasil_protocol, NULL, use_nppn);
command = get_reservation_command(host_req_list, user, jobid, apbasil_path, apbasil_protocol, NULL, use_nppn, mppdepth);

free_resizable_array(host_req_list);
}
else
{
command = get_reservation_command(NULL, user, jobid, apbasil_path, apbasil_protocol, exec_hosts, use_nppn);
command = get_reservation_command(NULL, user, jobid, apbasil_path, apbasil_protocol, exec_hosts, use_nppn, mppdepth);
}

free(user);
Expand Down
8 changes: 8 additions & 0 deletions src/resmom/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,7 @@ int blcr_restart_job(
if (is_login_node == TRUE)
{
int use_nppn = TRUE;
int mppdepth = 0;
resource *pres = find_resc_entry(
&pjob->ji_wattr[JOB_ATR_resource],
find_resc_def(svr_resc_def, "procs", svr_resc_size));
Expand All @@ -1890,13 +1891,20 @@ int blcr_restart_job(
(pres->rs_value.at_val.at_long != 0))
use_nppn = FALSE;

pres = find_resc_entry(&pjob->ji_wattr[JOB_ATR_resource],
find_resc_def(svr_resc_def, "mppdepth", svr_resc_size));
if ((pres != NULL) &&
(pres->rs_value.at_val.at_long != 0))
mppdepth = pres->rs_value.at_val.at_long;

if (create_alps_reservation(pjob->ji_wattr[JOB_ATR_exec_host].at_val.at_str,
pjob->ji_wattr[JOB_ATR_job_owner].at_val.at_str,
pjob->ji_qs.ji_jobid,
apbasil_path,
apbasil_protocol,
pagg,
use_nppn,
mppdepth,
&rsv_id) != PBSE_NONE)
{
snprintf(log_buffer, sizeof(log_buffer),
Expand Down
4 changes: 2 additions & 2 deletions src/resmom/mom_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ int task_save(
task *ptask) /* I */

{
job *pjob = ptask->ti_job;
job *pjob;
int fds;
int i;
int TaskID = 0;
Expand Down Expand Up @@ -8468,7 +8468,7 @@ received_node *get_received_node_entry(

/* initialize the received node struct */
rn->statuses = get_dynamic_string(MAXLINE,NULL);
strncpy(rn->hostname, hostname, sizeof(rn->hostname) - 1);
snprintf(rn->hostname, sizeof(rn->hostname), "%s", hostname);

if (rn->statuses == NULL)
{
Expand Down
10 changes: 10 additions & 0 deletions src/resmom/start_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2884,6 +2884,7 @@ void handle_reservation(
if (is_login_node == TRUE)
{
char *exec_str;
int mppdepth = 0;

if (pjob->ji_wattr[JOB_ATR_multi_req_alps].at_val.at_str != NULL)
exec_str = pjob->ji_wattr[JOB_ATR_multi_req_alps].at_val.at_str;
Expand All @@ -2898,13 +2899,22 @@ void handle_reservation(
(pres->rs_value.at_val.at_long != 0))
use_nppn = FALSE;

pres = find_resc_entry(
&pjob->ji_wattr[JOB_ATR_resource],
find_resc_def(svr_resc_def, "mppdepth", svr_resc_size));

if ((pres != NULL) &&
(pres->rs_value.at_val.at_long != 0))
mppdepth = pres->rs_value.at_val.at_long;

j = create_alps_reservation(exec_str,
pjob->ji_wattr[JOB_ATR_job_owner].at_val.at_str,
pjob->ji_qs.ji_jobid,
apbasil_path,
apbasil_protocol,
pagg,
use_nppn,
mppdepth,
&rsv_id);

if (rsv_id != NULL)
Expand Down
6 changes: 3 additions & 3 deletions src/resmom/test/alps_reservations/test_alps_reservations.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ char *alps_rsv_outputs[] = {
(char *)"tom"};

resizable_array *parse_exec_hosts(char *exec_hosts);
dynamic_string *get_reservation_command(resizable_array *, char *, char *, char *, char *, char *, int);
dynamic_string *get_reservation_command(resizable_array *, char *, char *, char *, char *, char *, int, int);
int parse_reservation_output(char *, char **);
int execute_reservation(char *, char **);
int confirm_reservation(char *, char *, long long, char *, char *);
Expand Down Expand Up @@ -141,7 +141,7 @@ START_TEST(get_reservation_command_test)
char *nppn;
int ppn;

apbasil_command = get_reservation_command(hrl, uname, jobids[0], NULL, apbasil_protocol, NULL,0);
apbasil_command = get_reservation_command(hrl, uname, jobids[0], NULL, apbasil_protocol, NULL, 0, 0);

snprintf(buf, sizeof(buf), "Username '%s' not found in command '%s'", uname, apbasil_command->str);
fail_unless(strstr(apbasil_command->str, uname) != NULL, buf);
Expand All @@ -157,7 +157,7 @@ START_TEST(get_reservation_command_test)
free_dynamic_string(apbasil_command);

hrl = parse_exec_hosts(eh3);
apbasil_command = get_reservation_command(hrl, uname, jobids[1], apbasil_path, apbasil_protocol, NULL,1);
apbasil_command = get_reservation_command(hrl, uname, jobids[1], apbasil_path, apbasil_protocol, NULL, 0, 1);

reserve_param = strstr(apbasil_command->str, "ReserveParam ");
reserve_param2 = strstr(reserve_param + 1, "ReserveParam ");
Expand Down
Loading