diff --git a/client/whetstone.h b/client/whetstone.h deleted file mode 100644 index 1970f28963..0000000000 --- a/client/whetstone.h +++ /dev/null @@ -1,20 +0,0 @@ - -// CMC here -// separate different compilations of whetstone.cpp which will utilize -// various ARM fp features ie neon, vfp, or "normal" -#ifdef ANDROID -#ifdef ANDROID_NEON - // add CXXFLAGS/CFLAGS for gcc: -DANDROID_NEON -mfloat-abi=softfp -mfpu=neon - #include -#endif // ANDROID_NEON - -namespace android_neon { - int whetstone(double& flops, double& cpu_time, double min_cpu_time); -} - -namespace android_vfp { - int whetstone(double& flops, double& cpu_time, double min_cpu_time); -} - -#endif // ANDROID - diff --git a/samples/condor/request_gen b/samples/condor/request_gen index b20efce334..bfb19ebd06 100755 --- a/samples/condor/request_gen +++ b/samples/condor/request_gen @@ -15,7 +15,7 @@ $batch_name = "batch_$t"; $job_name_1 = "job1_$t"; $job_name_2 = "job2_$t"; echo " -BOINC_SUBMIT 1 $batch_name uppercase 2 $job_name_1 0 1 /mydisks/b/users/boincadm/a/in in $job_name_2 0 1 /mydisks/b/users/boincadm/b/in in 1 +BOINC_SUBMIT 1 $batch_name uppercase 2 $job_name_1 0 1 in1 in $job_name_2 0 1 in2 in 1 BOINC_QUERY_BATCHES 2 1 $batch_name BOINC_ABORT_JOBS 6 $job_name_1 $job_name_2 BOINC_FETCH_OUTPUT 3 $job_name_1 . stderr_out1 ALL 1 out out1 diff --git a/samples/condor/request_gen2 b/samples/condor/request_gen2 new file mode 100755 index 0000000000..e7e9bd382a --- /dev/null +++ b/samples/condor/request_gen2 @@ -0,0 +1,25 @@ +#! /usr/bin/env php + diff --git a/samples/example_app/Makefile b/samples/example_app/Makefile index 482d8c46e9..8163dabbf6 100644 --- a/samples/example_app/Makefile +++ b/samples/example_app/Makefile @@ -38,7 +38,7 @@ else LIBJPEG = -ljpeg endif -PROGS = uc2 \ +PROGS = uc2 ucn \ # uc2_graphics # make this optional so compile doesn't break on systems without OpenGL @@ -65,6 +65,11 @@ uc2: uc2.o libstdc++.a $(BOINC_API_DIR)/libboinc_api.a $(BOINC_LIB_DIR)/libboinc $(BOINC_API_DIR)/libboinc_api.a \ $(BOINC_LIB_DIR)/libboinc.a +ucn: ucn.o libstdc++.a $(BOINC_API_DIR)/libboinc_api.a $(BOINC_LIB_DIR)/libboinc.a + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o ucn ucn.o libstdc++.a -pthread \ + $(BOINC_API_DIR)/libboinc_api.a \ + $(BOINC_LIB_DIR)/libboinc.a + uc2_graphics: uc2_graphics.o ttfont.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_graphics2.a $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o uc2_graphics uc2_graphics.o ttfont.o libstdc++.a -pthread \ $(BOINC_API_DIR)/libboinc_graphics2.a \ diff --git a/samples/example_app/ucn.cpp b/samples/example_app/ucn.cpp new file mode 100644 index 0000000000..8316eb849c --- /dev/null +++ b/samples/example_app/ucn.cpp @@ -0,0 +1,129 @@ +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2013 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with BOINC. If not, see . + +// another BOINC test application; +// converts one or more files to uppercase, +// then uses some CPU time +// +// cmdline: in1 out1 ... inn outn +// + +#include + +#include "boinc_api.h" +#include "filesys.h" +#include "util.h" + +double cpu_time = 20, comp_result; + +// do about .5 seconds of computing +// (note: I needed to add an arg to this; +// otherwise the MS C++ compiler optimizes away +// all but the first call to it!) +// +static double do_some_computing(int foo) { + double x = 3.14159*foo; + int i; + for (i=0; i<50000000; i++) { + x += 5.12313123; + x *= 0.5398394834; + } + return x; +} + +int convert_file(char* in, char* out) { + char input_path[1024], output_path[1024]; + char buf[256]; + + boinc_resolve_filename(in, input_path, sizeof(input_path)); + FILE* infile = boinc_fopen(input_path, "r"); + if (!infile) { + fprintf(stderr, + "%s Couldn't find input file, resolved name %s.\n", + boinc_msg_prefix(buf, sizeof(buf)), input_path + ); + return -1; + } + + boinc_resolve_filename(out, output_path, sizeof(output_path)); + FILE* outfile = boinc_fopen(output_path, "w"); + if (!outfile) { + fprintf(stderr, + "%s Couldn't find output file, resolved name %s.\n", + boinc_msg_prefix(buf, sizeof(buf)), output_path + ); + return -1; + } + + while (1) { + char c = fgetc(infile); + if (c == EOF) break; + c = toupper(c); + fputc(c, outfile); + } + + fclose(infile); + fclose(outfile); + return 0; +} + +int main(int argc, char **argv) { + char buf[256]; + int retval = boinc_init(); + if (retval) { + fprintf(stderr, "%s boinc_init returned %d\n", + boinc_msg_prefix(buf, sizeof(buf)), retval + ); + exit(retval); + } + + for (int i=1; i cpu_time) break; + comp_result = do_some_computing(i); + } + } + boinc_finish(0); +} + +#ifdef _WIN32 +int WINAPI WinMain( + HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode +) { + LPSTR command_line; + char* argv[100]; + int argc; + + command_line = GetCommandLine(); + argc = parse_command_line(command_line, argv); + return main(argc, argv); +} +#endif