From 04a4f7e31fa9d2019ddcd5b77de56d1c117a2d0e Mon Sep 17 00:00:00 2001 From: Danny Auble <da@llnl.gov> Date: Wed, 20 Oct 2004 15:25:44 +0000 Subject: [PATCH] smap is almost ready for configuration mode to work --- src/partition_allocator/partition_allocator.c | 6 +++--- src/smap/configure_functions.c | 17 +++++++---------- src/smap/smap.c | 1 - 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/partition_allocator/partition_allocator.c b/src/partition_allocator/partition_allocator.c index 6e09489c009..4efd2daf300 100644 --- a/src/partition_allocator/partition_allocator.c +++ b/src/partition_allocator/partition_allocator.c @@ -1127,7 +1127,7 @@ int main(int argc, char** argv) // int i; // for (i=0; i<8; i++){ // _print_pa_system(); - if (!allocate_part(request, &results)){ + if (allocate_part(request, &results)){ printf("allocate success for %d%d%d\n", geo[0], geo[1], geo[2]); // _print_results(results); @@ -1135,8 +1135,8 @@ int main(int argc, char** argv) } // } - if (!allocate_part(request, &results)){ - printf("allocate success for %d%d%d\n", + if (allocate_part(request, &results)){ + printf("I allocated it success for %d%d%d\n", geo[0], geo[1], geo[2]); // _print_results(results); list_destroy(results); diff --git a/src/smap/configure_functions.c b/src/smap/configure_functions.c index 38eff52c56a..90f7a0a6ece 100644 --- a/src/smap/configure_functions.c +++ b/src/smap/configure_functions.c @@ -48,6 +48,7 @@ void get_command(void) List results; pa_request_t * request; + pa_init(); text_height = smap_info_ptr->text_win->_maxy; // - smap_info_ptr->text_win->_begy; text_width = smap_info_ptr->text_win->_maxx; // - smap_info_ptr->text_win->_begx; text_starty = smap_info_ptr->text_win->_begy; @@ -87,13 +88,9 @@ void get_command(void) endwin(); exit(0); } else if (!strncmp(com->str, "resume", 6)) { - mvwprintw(smap_info_ptr->text_win, - smap_info_ptr->ycord, - smap_info_ptr->xcord, "%s", com->str); + mvwprintw(smap_info_ptr->text_win, smap_info_ptr->ycord, smap_info_ptr->xcord, "%s", com->str); } else if (!strncmp(com->str, "drain", 5)) { - mvwprintw(smap_info_ptr->text_win, - smap_info_ptr->ycord, - smap_info_ptr->xcord, "%s", com->str); + mvwprintw(smap_info_ptr->text_win, smap_info_ptr->ycord, smap_info_ptr->xcord, "%s", com->str); } else if (!strncmp(com->str, "create", 6)) { /*defaults*/ geo[0] = -1; @@ -106,8 +103,7 @@ void get_command(void) i=6; /*********/ - mvwprintw(smap_info_ptr->text_win, smap_info_ptr->ycord, - smap_info_ptr->xcord, "%s", com->str); + mvwprintw(smap_info_ptr->text_win, smap_info_ptr->ycord, smap_info_ptr->xcord, "%s", com->str); while(com->str[i]!='\0') { while(com->str[i-1]!=' ' && com->str[i]!='\0') { @@ -131,6 +127,7 @@ void get_command(void) force_contig=false; i+=5; } + } if(!i2) { @@ -150,13 +147,13 @@ void get_command(void) } new_pa_request(&request, geo, i, rotate, elongate, force_contig, torus); if (!allocate_part(request, &results)){ - printf("allocate success for %d%d%d\n", + printf("allocate failure for %d%d%d\n", geo[0], geo[1], geo[2]); list_destroy(results); } + } - } else if (!strncmp(com->str, "save", 4)) { mvwprintw(smap_info_ptr->text_win, smap_info_ptr->ycord, diff --git a/src/smap/smap.c b/src/smap/smap.c index 48990a9cf0e..c946c916e66 100644 --- a/src/smap/smap.c +++ b/src/smap/smap.c @@ -142,7 +142,6 @@ int main(int argc, char *argv[]) box(smap_info_ptr->text_win, 0, 0); wrefresh(smap_info_ptr->text_win); wrefresh(smap_info_ptr->grid_win); - partition_allocator_init(); while (!end) { _get_option(); -- GitLab