mirror of https://github.com/BOINC/boinc.git
- Fix bugs in Rappture wrapper
- Add README file and templates for Rappture wrapper - create_work: create defaults for --wu_name, --wu_template, --result_template - user web: fix typo on workunit.php svn path=/trunk/boinc/; revision=22826
This commit is contained in:
parent
56eb3cdf7f
commit
7baddb24e3
|
@ -8638,3 +8638,20 @@ Bernd 7 Dec 2010
|
|||
|
||||
api/
|
||||
boinc_api.cpp
|
||||
|
||||
David 7 Dec 2010
|
||||
- Fix bugs in Rappture wrapper
|
||||
- Add README file and templates for Rappture wrapper
|
||||
- create_work: create defaults for --wu_name, --wu_template, --result_template
|
||||
- user web: fix typo on workunit.php
|
||||
|
||||
tools/
|
||||
create_work.cpp
|
||||
html/user/
|
||||
workunit.php
|
||||
style2.css
|
||||
samples/wrappture/
|
||||
fermi_in (new)
|
||||
fermi_out (new)
|
||||
wrappture.cpp
|
||||
README (new)
|
||||
|
|
|
@ -106,8 +106,8 @@ $biomed = array(
|
|||
),
|
||||
array(
|
||||
"SIMAP",
|
||||
"http://boinc.bio.wzw.tum.de/boincsimap/",
|
||||
"Technical University of Munich",
|
||||
"http://www.boincsimap.org/boincsimap/",
|
||||
"University of Vienna",
|
||||
"Biology",
|
||||
"Calculate similarities between proteins. SIMAP provides a public database of the resulting data, which plays a key role in many bioinformatics research projects.",
|
||||
"simaplogo.jpg"
|
||||
|
|
|
@ -144,12 +144,10 @@ a.navbar:hover {
|
|||
}
|
||||
|
||||
tr.row1 {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
tr.row0 td {
|
||||
background-color: #eeeeee;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
tr.row0 td.postheader {
|
||||
|
|
|
@ -48,7 +48,7 @@ if ($wu->canonical_resultid) {
|
|||
// don't show anything more
|
||||
// (so that bad guys can't tell if they have an unreplicated job)
|
||||
|
||||
if ($app->target_nresults>0 && !$wu->canonical_resultid && !wu->error_mask) {
|
||||
if ($app->target_nresults>0 && !$wu->canonical_resultid && !$wu->error_mask) {
|
||||
row2(tra("Tasks in progress"), tra("suppressed pending completion"));
|
||||
end_table();
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
Example of running a Rappture app under BOINC
|
||||
|
||||
--------------------------
|
||||
Creating app versions
|
||||
|
||||
A Rappture app version has at minimum two files:
|
||||
|
||||
- The core application
|
||||
- A wrapper that parses the XML parameter file,
|
||||
runs the core application with appropriate cmdline,
|
||||
parses its stdout for progress messages,
|
||||
and interfaces with the BOINC client.
|
||||
|
||||
In this directory, fermi.cpp is the core app.
|
||||
The wrapper consists of two files:
|
||||
- wrappture_example.cpp (app-specific)
|
||||
- wrappture.cpp (app-independent)
|
||||
|
||||
Suppose you want to deploy this app for 64-bit Linux.
|
||||
Suppose the app name is "fermi".
|
||||
|
||||
- compile the programs on a 64-bit Linux machine.
|
||||
producing executables "fermi" and "wrappture_example"
|
||||
- in your project's apps/fermi directory, create a directory
|
||||
fermi_1.0_x86_64-pc-linux-gnu
|
||||
(the "1.0" is a version number)
|
||||
- Into this directory, copy
|
||||
wrappture_example as fermi_1.0_x86_64-pc-linux-gnu
|
||||
fermi as fermi=fermi-core_1.0_x86_64-pc-linux-gnu
|
||||
- run update_versions.
|
||||
|
||||
--------------------------
|
||||
Submitting jobs
|
||||
|
||||
- create input and output templates in your project/templates
|
||||
fermi_in: 1 file, logical name "driver.xml"
|
||||
fermi_out: 1 file, logical name "fermi_out.dat"
|
||||
(you can copy the ones here)
|
||||
- copy driver.xml to project/driver_1.xml
|
||||
(the "1" is a version number)
|
||||
- copy cw_fermi to project/
|
||||
(this is a job-submission script)
|
||||
- in project/, run cw_fermi
|
||||
|
||||
--------------------------
|
||||
Notes
|
||||
|
||||
- wrappture_example links libexpat and libz (among others) dynamically,
|
||||
so it won't run on systems that don't have them.
|
||||
It would be better to link everything statically,
|
||||
i.e. linking libexpat.a rather libexpat.so.
|
||||
You may need to download or build the .a versions.
|
|
@ -0,0 +1,13 @@
|
|||
<file_info>
|
||||
<number>0</number>
|
||||
</file_info>
|
||||
<workunit>
|
||||
<file_ref>
|
||||
<file_number>0</file_number>
|
||||
<open_name>driver.xml</open_name>
|
||||
</file_ref>
|
||||
<target_nresults>1</target_nresults>
|
||||
<min_quorum>1</min_quorum>
|
||||
<rsc_fpops_bound>446797000000000</rsc_fpops_bound>
|
||||
<rsc_fpops_est>279248000000000</rsc_fpops_est>
|
||||
</workunit>
|
|
@ -0,0 +1,14 @@
|
|||
<file_info>
|
||||
<name><OUTFILE_0/></name>
|
||||
<generated_locally/>
|
||||
<upload_when_present/>
|
||||
<max_nbytes>5000000</max_nbytes>
|
||||
<url><UPLOAD_URL/></url>
|
||||
</file_info>
|
||||
<result>
|
||||
<file_ref>
|
||||
<file_name><OUTFILE_0/></file_name>
|
||||
<open_name>fermi_out.dat</open_name>
|
||||
<copy_file/>
|
||||
</file_ref>
|
||||
</result>
|
|
@ -413,11 +413,18 @@ static void block_sigalrm() {
|
|||
pthread_sigmask(SIG_BLOCK, &mask, NULL);
|
||||
}
|
||||
|
||||
// we create a thread to parse the stdout from the worker app
|
||||
//
|
||||
static void* parse_app_stdout(void*) {
|
||||
block_sigalrm();
|
||||
#endif
|
||||
char buf[1024];
|
||||
FILE* f = boinc_fopen("rappture_stdout.txt", "r");
|
||||
FILE* f;
|
||||
while (1) {
|
||||
f = boinc_fopen("rappture_stdout.txt", "r");
|
||||
if (f) break;
|
||||
boinc_sleep(1.);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
if (fgets(buf, sizeof(buf), f)) {
|
||||
|
|
|
@ -23,9 +23,14 @@
|
|||
//
|
||||
// create_work
|
||||
// --appname name
|
||||
// --wu_name name
|
||||
// --wu_template filename relative to project root; usually in templates/
|
||||
// --result_template filename relative to project root; usually in templates/
|
||||
// [ --wu_name name ]
|
||||
// // default: generate a name based on app name
|
||||
// [ --wu_template filename ]
|
||||
// relative to project root; usually in templates/
|
||||
// default: appname_in
|
||||
// [ --result_template filename ]
|
||||
// relative to project root; usually in templates/
|
||||
// default: appname_out
|
||||
// [ --config_dir path ]
|
||||
// [ --batch n ]
|
||||
// the following can be supplied in WU template; see defaults below
|
||||
|
@ -57,11 +62,12 @@
|
|||
#include <ctime>
|
||||
#include <string>
|
||||
|
||||
#include "boinc_db.h"
|
||||
#include "crypt.h"
|
||||
#include "backend_lib.h"
|
||||
#include "boinc_db.h"
|
||||
#include "common_defs.h"
|
||||
#include "crypt.h"
|
||||
#include "sched_config.h"
|
||||
#include "util.h"
|
||||
|
||||
bool arg(const char** argv, int i, const char* name) {
|
||||
char buf[256];
|
||||
|
@ -90,6 +96,7 @@ int main(int argc, const char** argv) {
|
|||
int assign_id = 0;
|
||||
int assign_type = ASSIGN_NONE;
|
||||
|
||||
strcpy(wu_template_file, "");
|
||||
strcpy(result_template_file, "");
|
||||
strcpy(app.name, "");
|
||||
strcpy(db_passwd, "");
|
||||
|
@ -202,16 +209,14 @@ int main(int argc, const char** argv) {
|
|||
exit(1);
|
||||
}
|
||||
if (!strlen(wu.name)) {
|
||||
fprintf(stderr, "create_work: missing --wu_name\n");
|
||||
exit(1);
|
||||
sprintf(wu.name, "%s_%d_%f", app.name, getpid(), dtime());
|
||||
printf("workunit name: %s\n", wu.name);
|
||||
}
|
||||
if (!strlen(wu_template_file)) {
|
||||
fprintf(stderr, "create_work: missing --wu_template\n");
|
||||
exit(1);
|
||||
sprintf(wu_template_file, "templates/%s_in", app.name);
|
||||
}
|
||||
if (!strlen(result_template_file)) {
|
||||
fprintf(stderr, "create_work: missing --result_template\n");
|
||||
exit(1);
|
||||
sprintf(result_template_file, "templates/%s_out", app.name);
|
||||
}
|
||||
|
||||
if (assign_flag) {
|
||||
|
@ -248,7 +253,9 @@ int main(int argc, const char** argv) {
|
|||
|
||||
retval = read_filename(wu_template_file, wu_template, sizeof(wu_template));
|
||||
if (retval) {
|
||||
fprintf(stderr, "create_work: can't open WU template: %d\n", retval);
|
||||
fprintf(stderr,
|
||||
"create_work: can't open input template %s\n", wu_template_file
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue