Message boards : Server programs : How to automatically create jobs with multiple input files
Message board moderation
Author | Message |
---|---|
Send message Joined: 18 Aug 08 Posts: 5 |
Hi I have an application which receives two images and outputs one image. When I try running my project with the sample_work_generator deamon (which I have modified) The the deamon generates two work unit folders in my project dowmload folder, each one of these folders holds only one of the two images I need to send to the app. Also in the sample_work_generator log file I get this error: Too few input files given; need at least 2 Here is the function I use in sample_work_generator: int make_job() { DB_WORKUNIT wu; char name[256], path[256]; const char* infiles[2]; const char* commandLineArgs[2]; int retval; // make a unique name (for the job and its input file) // sprintf(name, "uc_%d_%d", start_time, seqno++); retval = config.download_path("im1.jpg", path); copyImageFile("../image_buffer/im1.jpg",myPath1); retval = config.download_path("im2.jpg", path); copyImageFile("../image_buffer/im2.jpg",myPath2); if (retval) return retval; // Fill in the job parameters // wu.clear(); wu.appid = app.id; strcpy(wu.name, name); wu.rsc_fpops_est = 1e12; wu.rsc_fpops_bound = 1e14; wu.rsc_memory_bound = 1e8; wu.rsc_disk_bound = 1e8; wu.delay_bound = 86400; wu.min_quorum = REPLICATION_FACTOR; wu.target_nresults = REPLICATION_FACTOR; wu.max_error_results = REPLICATION_FACTOR*4; wu.max_total_results = REPLICATION_FACTOR*8; wu.max_success_results = REPLICATION_FACTOR*4; infiles[0] = "im1.jpg"; infiles[1] = "im2.jpg"; //commandLineArgs[0] = im1; //commandLineArgs[1]; // Register the job with BOINC // return create_work( wu, wu_template, "templates/worker_result", "../templates/worker_result", infiles, 1, config ); } could somebody please help me with this, I've racking my brains for hours! thanks Aharon |
Send message Joined: 18 Aug 08 Posts: 5 |
Ok ,problem solved, I just had to set ninfiles to 2 instead of 1, in return create_work( wu, wu_template, "templates/worker_result", "../templates/worker_result", infiles, 1, config ); |
Send message Joined: 12 Feb 06 Posts: 232 |
I think you need to change myPath1 and myPath2 to 'path'. The files you put out to be downloaded are put in a hierarchy of subdirectories to spread them out, because Unix filesystem performance has problems if you put too many files in one directory. The call to config.download_path() determines where the file is expected to be placed, and then you need to copy it to that place. The WU will then try to get it from that place. (The subdirectory names are based just on (an md5 hash of) the name of the file and the number of levels of hierarchy, which is set in config.xml.) -- Eric Myers "Education is not the filling of a pail, but the lighting of a fire." -- William Butler Yeats |
Send message Joined: 2 Nov 09 Posts: 1 |
hi, I need some help I have an application which receives two images and output result.txt When I try running my project with the sample_work_generator deamon (which I have modified) i found this error in the log file "Can't find app" when i try to execute bin/sample_work_generator i found "can't read config file" could some body help me and give me some instructions how can i execute this script under boinc regards zied |
Send message Joined: 12 Feb 06 Posts: 232 |
Try running it from the project/bin directory. Many of the BOINC utilities are configured to be run only from that directory. -- Eric Myers "Education is not the filling of a pail, but the lighting of a fire." -- William Butler Yeats |
Copyright © 2025 University of California.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software Foundation.