mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=10097
This commit is contained in:
parent
ff321ea3e6
commit
a9183d00dc
|
@ -46,7 +46,7 @@ static int xpos = 100, ypos = 100;
|
|||
static int clicked_button;
|
||||
static int win=0;
|
||||
static bool glut_is_initialized = false;
|
||||
static jmp_buf jbuf; // longjump/setjump for exit/signal handler
|
||||
static jmp_buf jbuf; // longjump/setjump for exit/signal handler
|
||||
static struct sigaction original_signal_handler; // store previous ABRT signal-handler
|
||||
static void set_mode(int mode);
|
||||
static void restart(void);
|
||||
|
@ -54,7 +54,7 @@ static void boinc_glut_init(void);
|
|||
|
||||
static APP_INIT_DATA aid;
|
||||
|
||||
extern pthread_t graphics_thread; // thread info
|
||||
extern pthread_t graphics_thread; // thread info
|
||||
extern pthread_t worker_thread;
|
||||
|
||||
// possible longjmp-values to signal from where we jumped:
|
||||
|
@ -320,20 +320,28 @@ void restart() {
|
|||
//
|
||||
if (glut_is_initialized ) {
|
||||
#ifdef __APPLE__
|
||||
if (boinc_is_standalone())
|
||||
app_debug_msg("Assuming user pressed 'close'... means we're exiting now.\n");
|
||||
else
|
||||
app_debug_msg("Assuming user pressed 'quit'... means we're exiting now.\n");
|
||||
if (boinc_is_standalone()) {
|
||||
app_debug_msg(
|
||||
"Assuming user pressed 'close'... means we're exiting now.\n"
|
||||
);
|
||||
} else {
|
||||
app_debug_msg(
|
||||
"Assuming user pressed 'quit'... means we're exiting now.\n"
|
||||
);
|
||||
}
|
||||
|
||||
if (boinc_delete_file(LOCKFILE) != 0)
|
||||
if (boinc_delete_file(LOCKFILE) != 0) {
|
||||
perror ("Failed to remove lockfile..\n");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
#else
|
||||
if (boinc_is_standalone())
|
||||
{
|
||||
app_debug_msg("Assuming user pressed 'close'... means we're exiting now.\n");
|
||||
if (boinc_delete_file(LOCKFILE) != 0)
|
||||
if (boinc_is_standalone()) {
|
||||
app_debug_msg(
|
||||
"Assuming user pressed 'close'... means we're exiting now.\n"
|
||||
);
|
||||
if (boinc_delete_file(LOCKFILE) != 0) {
|
||||
perror ("Failed to remove lockfile..\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -367,10 +375,10 @@ void restart_sig(int /*signal_number*/) {
|
|||
fprintf(stderr, "Caught SIGABRT in non-graphics thread\n");
|
||||
app_debug_msg("Caught SIGABRT in non-graphics thread. Trying to call previous ABRT-handler...\n");
|
||||
if (sigaction(SIGABRT, &original_signal_handler, NULL)) {
|
||||
perror("Unable to restore SIGABRT signal handler in non-graphics thread\n");
|
||||
// what to do? call abort(3)?? call exit(nonzero)???
|
||||
// Here we just return.
|
||||
} else {
|
||||
perror("Unable to restore SIGABRT signal handler in non-graphics thread\n");
|
||||
// what to do? call abort(3)?? call exit(nonzero)???
|
||||
// Here we just return.
|
||||
} else {
|
||||
// we could conceivably try to call the old signal handler
|
||||
// directly. But this means checking how its flags/masks
|
||||
// are set, making sure it's not NULL (for no action) and so
|
||||
|
@ -422,30 +430,32 @@ void xwin_graphics_event_loop() {
|
|||
if (boinc_is_standalone()) {
|
||||
if (restarted) {
|
||||
while(1) {
|
||||
sleep(1); // assuming glutInit() failed: put graphics-thread to sleep
|
||||
sleep(1); // assuming glutInit() failed: put graphics-thread to sleep
|
||||
}
|
||||
} else {
|
||||
// open the graphics-window
|
||||
// open the graphics-window
|
||||
set_mode(MODE_WINDOW);
|
||||
glutTimerFunc(TIMER_INTERVAL_MSEC, timer_handler, 0);
|
||||
}
|
||||
} else {
|
||||
if (!glut_is_initialized) {
|
||||
#ifdef __APPLE__
|
||||
setMacPList();
|
||||
setMacPList();
|
||||
#endif
|
||||
set_mode(MODE_HIDE_GRAPHICS);
|
||||
while ( current_graphics_mode == MODE_HIDE_GRAPHICS ) {
|
||||
app_debug_msg ("Graphics-thread now waiting for client-message...\n");
|
||||
wait_for_initial_message();
|
||||
app_debug_msg ("got a graphics-message from client... \n");
|
||||
timer_handler(0);
|
||||
}
|
||||
} else
|
||||
set_mode(MODE_HIDE_GRAPHICS);
|
||||
while ( current_graphics_mode == MODE_HIDE_GRAPHICS ) {
|
||||
app_debug_msg(
|
||||
"Graphics-thread now waiting for client-message...\n"
|
||||
);
|
||||
wait_for_initial_message();
|
||||
app_debug_msg ("got a graphics-message from client... \n");
|
||||
timer_handler(0);
|
||||
}
|
||||
} else
|
||||
// here glut has been initialized previously
|
||||
// probably the user pressed window-'close'
|
||||
//
|
||||
set_mode(MODE_HIDE_GRAPHICS); // close any previously open windows
|
||||
set_mode(MODE_HIDE_GRAPHICS); // close any previously open windows
|
||||
}
|
||||
|
||||
// ok we should be ready & initialized by now to call glutMainLoop()
|
||||
|
@ -469,19 +479,19 @@ void app_debug_msg (const char* fmt, ...) {
|
|||
if (boinc_slotdir == NULL) {
|
||||
char *tmp, *ptr;
|
||||
if ((tmp = getcwd(NULL, 0)) == NULL) {
|
||||
perror ("failed to get working directory using getcwd()");
|
||||
boinc_slotdir = (char*)calloc(1, 20);
|
||||
strcpy( boinc_slotdir, "[unknown]");
|
||||
} else {
|
||||
if ( (ptr = strrchr(tmp, '/')) == NULL) {
|
||||
ptr = tmp;
|
||||
perror ("failed to get working directory using getcwd()");
|
||||
boinc_slotdir = (char*)calloc(1, 20);
|
||||
strcpy( boinc_slotdir, "[unknown]");
|
||||
} else {
|
||||
if ( (ptr = strrchr(tmp, '/')) == NULL) {
|
||||
ptr = tmp;
|
||||
} else {
|
||||
ptr ++;
|
||||
}
|
||||
boinc_slotdir = (char*)calloc(1, strlen(ptr)+1);
|
||||
strcpy(boinc_slotdir, ptr);
|
||||
free (tmp);
|
||||
}
|
||||
boinc_slotdir = (char*)calloc(1, strlen(ptr)+1);
|
||||
strcpy(boinc_slotdir, ptr);
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
vsnprintf (buffer, 5000, fmt, args);
|
||||
|
|
|
@ -4458,3 +4458,18 @@ Rom 3 May 2006
|
|||
|
||||
clientgui/
|
||||
wizardex.cpp
|
||||
|
||||
David 3 May 2006
|
||||
- user web: add "previous 20" link to result list page
|
||||
(from Rytis Slatkevicius)
|
||||
- code formatting, comments
|
||||
|
||||
api/
|
||||
x_opengl.C
|
||||
html/
|
||||
user/
|
||||
results.php
|
||||
inc/
|
||||
result.inc
|
||||
sched/
|
||||
feeder.C
|
||||
|
|
|
@ -47,6 +47,36 @@ to copy this workunit as needed to maintain a given supply of work.
|
|||
This program is supplied by BOINC and is application independent.
|
||||
It creates a shared-memory segment used to pass database records
|
||||
to CGI scheduler processes.
|
||||
It has the following command-line options:
|
||||
";
|
||||
list_start();
|
||||
list_item("-random_order",
|
||||
"Enumerate in order of increasing result.random"
|
||||
);
|
||||
list_item("-priority_order",
|
||||
"Enumerate in order of decreasing result.priority"
|
||||
);
|
||||
list_item("-priority_order_create_time",
|
||||
"Enumerate in order of decreasing result.priority,
|
||||
then increasing workunit.create_time"
|
||||
);
|
||||
list_item("-sleep_interval N",
|
||||
"Sleep N seconds if nothing to do"
|
||||
);
|
||||
list_item("-allapps",
|
||||
"Interleave results from all applications uniformly"
|
||||
);
|
||||
list_item("-purge_stale X",
|
||||
" remove work items from the shared memory segment
|
||||
that have been there for longer then x minutes
|
||||
but haven't been assigned"
|
||||
);
|
||||
list_end();
|
||||
echo "
|
||||
<p>
|
||||
If a user's project preferences include elements of the form
|
||||
<app_id>N</app_id>
|
||||
then the scheduler will send the user work only from those applications.
|
||||
|
||||
<h3>Transitioner</h3>
|
||||
<p>
|
||||
|
|
|
@ -29,7 +29,7 @@ a:active {
|
|||
}
|
||||
|
||||
a:hover {
|
||||
color: rgb(80,180,255);
|
||||
color: rgb(200,80,80);
|
||||
#text-decoration: underline;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
@ -287,4 +287,22 @@ function show_result($result) {
|
|||
end_table();
|
||||
}
|
||||
|
||||
function show_result_navigation(
|
||||
$clause, $number_of_results, $offset, $results_per_page
|
||||
) {
|
||||
echo "<br><center>";
|
||||
if ($offset >= $results_per_page) {
|
||||
$offset_p = $offset-$results_per_page;
|
||||
echo "<a href=results.php?$clause&offset=$offset_p>Previous $results_per_page</a>";
|
||||
}
|
||||
if (($offset >= $results_per_page) && ($number_of_results > $results_per_page)) {
|
||||
echo " | ";
|
||||
}
|
||||
if ($number_of_results > $results_per_page) {
|
||||
$offset_n = $offset+$results_per_page;
|
||||
echo "<a href=results.php?$clause&offset=$offset_n>Next $results_per_page</a></center><br>";
|
||||
} else {
|
||||
echo "</center><br><br>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -38,6 +38,9 @@ $i = 0;
|
|||
$query = "select * from result where $clause order by id desc limit $offset,".($results_per_page+1);
|
||||
$result = mysql_query($query);
|
||||
$number_of_results = mysql_affected_rows();
|
||||
echo show_result_navigation(
|
||||
$clause, $number_of_results, $offset, $results_per_page
|
||||
);
|
||||
while ($res = mysql_fetch_object($result) and $i<$results_per_page) {
|
||||
show_result_row($res, true, false, true);
|
||||
$i++;
|
||||
|
@ -45,12 +48,9 @@ while ($res = mysql_fetch_object($result) and $i<$results_per_page) {
|
|||
mysql_free_result($result);
|
||||
echo "</table>\n";
|
||||
|
||||
if ($number_of_results > $results_per_page) {
|
||||
$offset = $offset+$results_per_page;
|
||||
echo "
|
||||
<br><center><a href=\"results.php?$clause&offset=$offset\">Next $results_per_page results</a></center>
|
||||
";
|
||||
}
|
||||
echo show_result_navigation(
|
||||
$clause, $number_of_results, $offset, $results_per_page
|
||||
);
|
||||
|
||||
page_tail();
|
||||
?>
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
// [ -asynch ] fork and run in a separate process
|
||||
// [ -d x ] debug level x
|
||||
// [ -random_order ] order by "random" field of result
|
||||
// [ -priority_order ] order by "priority" field of result
|
||||
// [ -priority_order ] order by decreasing "priority" field of result
|
||||
// [ -priority_order_create_time ]
|
||||
// order by priority, then by increasing WU create time
|
||||
// [ -mod n i ] handle only results with (id mod n) == i
|
||||
// [ -sleep_interval x ] sleep x seconds if nothing to do
|
||||
// [ -allapps ] interleave results from all applications uniformly
|
||||
|
|
Loading…
Reference in New Issue