Ejemplo n.º 1
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<argc; i++) {
        if (!strcmp(argv[i], "--cpu_time")) {
            cpu_time = atof(argv[++i]);
        } else {
            retval = convert_file(argv[i], argv[i+1]);
            if (retval) exit(-1);
            i++;
        }
    }

    // burn up some CPU time if needed
    //
    if (cpu_time) {
        double start = dtime();
        for (int i=0; ; i++) {
            double e = dtime()-start;
            if (e > cpu_time) break;
            comp_result = do_some_computing(i);
        }
    }
    boinc_finish(0);
}
Ejemplo n.º 2
0
void DC_finishClient(int exitcode)
{
	char path[PATH_MAX];
	int ret;

	/* Rename/copy the checkpoint file to the label CKPT_LABEL_OUT
	 * so it will be uploaded together with the result(s) */
	if (last_complete_ckpt &&
		!boinc_resolve_filename(CKPT_LABEL_OUT, path, sizeof(path)))
	{
#ifndef _WIN32
		ret = link(last_complete_ckpt, path);
		if (ret)
#endif
		ret = _DC_copyFile(last_complete_ckpt, path);

		DC_log(LOG_DEBUG, "Uploading last complete checkpoint %s",
			last_complete_ckpt);
	}

	/* Delete files that we have created */
	if (last_complete_ckpt)
		unlink(last_complete_ckpt);
	if (strlen(active_ckpt))
		unlink(active_ckpt);
	unlink(LAST_CKPT_FILE);

	/* Make sure the output is on disk */
	DC_log(LOG_DEBUG, "Flushing stdout/stderr");
	fflush(stdout);
	fflush(stderr);

	if (!boinc_resolve_filename(DC_LABEL_STDOUT, path, sizeof(path)))
	{
		DC_log(LOG_DEBUG, "Uploading stdout.txt");
		_DC_copyFile("stdout.txt", path);
	}

	if (!boinc_resolve_filename(DC_LABEL_STDERR, path, sizeof(path)))
	{
		DC_log(LOG_DEBUG, "Uploading stderr.txt");
		_DC_copyFile("stderr.txt", path);
	}

	DC_log(LOG_INFO, "DC-API: Application finished with exit code %d",
		exitcode);
	boinc_finish(exitcode);
	/* We should never get here, but boinc_finish() is not marked
	 * with "noreturn" so this avoids a GCC warning */
	exit(exitcode);
}
Ejemplo n.º 3
0
static PyObject *boinc_boinc_finish(PyObject *self, PyObject *args)
{

	int retval;
	int exitVal = 0;

	if (!PyArg_ParseTuple(args, "|i", &exitVal))
		return NULL;

	retval = boinc_finish(exitVal);

	if(retval)
	{
		PyErr_SetString(BoincError, "call to boinc_finish() failed");
		return NULL;
	}

	Py_INCREF(Py_None);
	return Py_None;
}
Ejemplo n.º 4
0
int main(int argc, char **argv) {    
    int retval;
    double fd;
    char output_path[512]; //, chkpt_path[512];
    //FILE* state;	
    retval = boinc_init();
    if (retval) {
        fprintf(stderr, "boinc_init returned %d\n", retval);
        exit(retval);
    }

	// extract a --device option
	std::vector<char*> argVec;
	int cudaDevice = -1;
	for(int ii = 0; ii < argc; ii++) {
		if(cudaDevice < 0 && strcmp(argv[ii], "--device") == 0 && ii + 1 < argc)
			cudaDevice = atoi(argv[++ii]);
		else
			argVec.push_back(argv[ii]);
	}
	argc = (int)argVec.size();
	argv = &argVec[0];
	if(cudaDevice < 0)
		cudaDevice = 0;

	boinc_begin_critical_section();

	// set the cuda device
	if ( rcuda::SetCudaDevice(cudaDevice) != 0 ) {
		fprintf(stderr, "Error setting device %u. Temporary exiting for 60 secs\n", cudaDevice);
		boinc_temporary_exitHack();
	}
	cudaDeviceProp deviceProp;
	if(cudaGetDeviceProperties(&deviceProp, cudaDevice) == cudaErrorInvalidDevice) {
		fprintf(stderr, "Error querying device %u. Temporary exiting for 60 secs\n", cudaDevice);
		boinc_temporary_exitHack();
	}
#ifdef WIN32
	SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
#endif
	int buffCount = 0x2000;
	int chainSize = 100;
	if(deviceProp.major == 1) {	
/*		
		buffCount = deviceProp.multiProcessorCount * 8;// 8 blocks per multiprocessor
		buffCount *= deviceProp.maxThreadsPerBlock / 64; // (BLOCK_X_SIZE)
//		buffCount *= 24;
		if(deviceProp.minor <= 1) buffCount *= 24; // 24 warps per multiprocessor for compute 1.0 and 1.1
		else buffCount *= 32; // 32 warps per multiprocessor for compute 1.2 and 1.3		
		*/
		buffCount = 0x2000;
	}
	else if(deviceProp.major == 2) {		
		chainSize = 200;
/*		buffCount = deviceProp.multiProcessorCount * 8;// 8 blocks per multiprocessor
		buffCount *= deviceProp.maxThreadsPerBlock / 64; //(BLOCK_X_SIZE)		
		buffCount *= 32; // 48 warps per multiprocessor for compute 2.x
/*		if(deviceProp.minor == 1) {
			buffCount *= 2;
		}
*/		
		buffCount = 0x4000;
	}
	if(cudaDevice > 0) {
		chainSize = 1000;
	}
	if(argc < 10)
	{
		fprintf(stderr, "Not enough parameters");
		return -1;
	}
	std::string sHashRoutineName, sCharsetName, sSalt, sCheckPoints;
	uint32 nRainbowChainCount, nPlainLenMin, nPlainLenMax, nRainbowTableIndex, nRainbowChainLen;
	uint64 nChainStart;
	sHashRoutineName = argv[1];
	sCharsetName = argv[2];
	nPlainLenMin = atoi(argv[3]);
	nPlainLenMax = atoi(argv[4]);
	nRainbowTableIndex = atoi(argv[5]);
	nRainbowChainLen = atoi(argv[6]);
	nRainbowChainCount = atoi(argv[7]);
#ifdef _WIN32
	nChainStart = _atoi64(argv[8]);
#else
	nChainStart = atoll(argv[8]);
#endif
	sCheckPoints = argv[9];
	std::vector<int> vCPPositions;
	char *cp = strtok((char *)sCheckPoints.c_str(), ",");
	while(cp != NULL)
	{
		vCPPositions.push_back(atoi(cp));
		cp = strtok(NULL, ",");
	}
	if(argc == 11)
	{
		sSalt = argv[10];
	}
	//std::cout << "Starting ChainGenerator" << std::endl;
	// Setup CChainWalkContext
	//std::cout << "ChainGenerator started." << std::endl;

	if (!CChainWalkContext::SetHashRoutine(sHashRoutineName))
	{
		fprintf(stderr, "hash routine %s not supported\n", sHashRoutineName.c_str());
		return 1;
	}
	//std::cout << "Hash routine validated" << std::endl;

	if (!CChainWalkContext::SetPlainCharset(sCharsetName, nPlainLenMin, nPlainLenMax))
	{	
		std::cerr << "charset " << sCharsetName << " not supported" << std::endl;
		return 2;
	}
	//std::cout << "Plain charset validated" << std::endl;

	if (!CChainWalkContext::SetRainbowTableIndex(nRainbowTableIndex))
	{
		std::cerr << "invalid rainbow table index " << nRainbowTableIndex << std::endl;
		return 3;
	}
	//std::cout << "Rainbowtable index validated" << std::endl;

	if(sHashRoutineName == "mscache")// || sHashRoutineName == "lmchall" || sHashRoutineName == "halflmchall")
	{
		// Convert username to unicode
		const char *szSalt = sSalt.c_str();
		int salt_length = strlen(szSalt);
		unsigned char cur_salt[256];
		for (int i=0; i<salt_length; i++)
		{
			cur_salt[i*2] = szSalt[i];
			cur_salt[i*2+1] = 0x00;
		}
		CChainWalkContext::SetSalt(cur_salt, salt_length*2);
	}
	else if(sHashRoutineName == "halflmchall")
	{ // The salt is hardcoded into the hash routine
	//	CChainWalkContext::SetSalt((unsigned char*)&salt, 8);
	}
	else if(sHashRoutineName == "oracle")
	{
		CChainWalkContext::SetSalt((unsigned char *)sSalt.c_str(), sSalt.length());
	}
	//std::cout << "Opening chain file" << std::endl;
	
	// Open file
	boinc_resolve_filename("result", output_path, sizeof(output_path));
	fclose(boinc_fopen(output_path, "a"));
	FILE *outfile = boinc_fopen(output_path, "r+b");
	
	if (outfile == NULL)
	{
		std::cerr << "failed to create " << output_path << std::endl;
		return 4;
	}
	
	// Check existing chains
	unsigned int nDataLen = (unsigned int)GetFileLen(outfile);
	
	// Round to boundary
	nDataLen = nDataLen / 10 * 10;
	if (nDataLen == nRainbowChainCount * 10)
	{		
		std::cerr << "precomputation of this rainbow table already finished" << std::endl;
		fclose(outfile);
		return 0;
	}

	fseek(outfile, nDataLen, SEEK_SET);
	//XXX size_t isn't 32/64 clean
	size_t nReturn;
	CChainWalkContext cwc;
	uint64 nIndex[2];
	//time_t tStart = time(NULL);

//	std::cout << "Starting to generate chains" << std::endl;
	int maxCalcBuffSize = rcuda::GetChainsBufferSize( buffCount );
	std::cerr << "maxCalcBuffSize - estimated: " << buffCount << ". Chosen: " << maxCalcBuffSize << std::endl;
	uint64 *calcBuff = new uint64[2*maxCalcBuffSize];
	int ii;

	CudaCWCExtender ex(&cwc);
	rcuda::RCudaTask cuTask;
	ex.Init();

	for(int nCurrentCalculatedChains = nDataLen / 10, calcSize; nCurrentCalculatedChains < nRainbowChainCount; )
	{		
		fd = (double)nCurrentCalculatedChains / (double)nRainbowChainCount;
		boinc_fraction_done(fd);
		
		cuTask.hash = ex.GetHash();
		cuTask.startIdx = nChainStart + nCurrentCalculatedChains;
		cuTask.idxCount = std::min<int>(nRainbowChainCount - nCurrentCalculatedChains, maxCalcBuffSize);
		cuTask.dimVec = ex.GetPlainDimVec();
		cuTask.dimVecSize = ex.GetPlainDimVecSize()/2;
		cuTask.charSet = ex.GetCharSet();
		cuTask.charSetSize = ex.GetCharSetSize();
		cuTask.cpPositions = &vCPPositions[0];
		cuTask.cpPosSize = vCPPositions.size();
		cuTask.reduceOffset = ex.GetReduceOffset();
		cuTask.plainSpaceTotal = ex.GetPlainSpaceTotal();
		cuTask.rainbowChainLen = nRainbowChainLen;
		cuTask.kernChainSize = chainSize;
		for(ii = 0; ii < cuTask.idxCount; ii++) {
			calcBuff[2*ii] = cuTask.startIdx + ii;
			calcBuff[2*ii+1] = 0;
		}
		calcSize = rcuda::CalcChainsOnCUDA(&cuTask, calcBuff);

		BOINC_STATUS boinc_status;
		boinc_get_status(&boinc_status);

		if (boinc_status.quit_request || boinc_status.abort_request)
		{
			boinc_end_critical_section();
			while (1) boinc_sleep(1);
		}

		if(calcSize > 0) {
			nCurrentCalculatedChains += calcSize;
			for(ii = 0; ii < cuTask.idxCount; ii++) {
				nIndex[0] = cuTask.startIdx + ii;
//				nReturn = fwrite(nIndex, 1, 8, outfile);
				nReturn = fwrite(calcBuff+(2*ii), 1, 8, outfile);
				nReturn += fwrite(calcBuff+(2*ii+1), 1, 2, outfile);
				if(nReturn != 10) {
					std::cerr << "disk write fail" << std::endl;
					fclose(outfile);
					return 9;
				}
			}
		} else {
			std::cerr << "Calculations on CUDA failed!" << std::endl;
			fclose(outfile);
			return -1;	
		}
	}
	delete [] calcBuff;
#ifdef _DEBUG
	std::cout << "Generation completed" << std::endl;
#endif
	fclose(outfile);
    
	boinc_fraction_done(1);
	boinc_finish(0);
}
Ejemplo n.º 5
0
int main(int argc, char** argv) {
    BOINC_OPTIONS boinc_options;
    BOINC_STATUS boinc_status;
    char buf[256];
    int retval;

    memset(&boinc_options, 0, sizeof(boinc_options));
    boinc_options.main_program = true;
    boinc_options.check_heartbeat = true;
    boinc_options.handle_process_control = true;
    boinc_init_options(&boinc_options);

    fprintf(
        stderr,
        "%s vboxwrapper: starting\n",
        boinc_msg_prefix(buf, sizeof(buf))
    );

    retval = parse_job_file();
    if (retval) {
        fprintf(
            stderr,
            "%s can't parse job file: %d\n",
            boinc_msg_prefix(buf, sizeof(buf)),
            retval
        );
        boinc_finish(retval);
    }

    retval = vm.run();
    if (retval) {
        boinc_finish(retval);
    }

    while (1) {
        vm.poll();
        boinc_get_status(&boinc_status);
        if (boinc_status.no_heartbeat || boinc_status.quit_request) {
            vm.stop();
            boinc_temporary_exit(0);
        }
        if (boinc_status.abort_request) {
            vm.cleanup();
            boinc_finish(EXIT_ABORTED_BY_CLIENT);
        }
        if (!vm.is_running()) {
            vm.cleanup();
            boinc_finish(0);
        }
        if (boinc_status.suspended) {
            if (!vm.suspended) {
                vm.pause();
            }
        } else {
            if (vm.suspended) {
                vm.resume();
            }
        }
        boinc_sleep(POLL_PERIOD);
    }
    
    return 0;
}
Ejemplo n.º 6
0
int main(int argc, char **argv) {    
    int retval;
    double fd;
    char output_path[512]; //, chkpt_path[512];
    //FILE* state;	
    retval = boinc_init();
    if (retval) {
        fprintf(stderr, "boinc_init returned %d\n", retval);
        exit(retval);
    }
	

    // get size of input file (used to compute fraction done)
    //
    //file_size(input_path, fsize);

    // See if there's a valid checkpoint file.
    // If so seek input file and truncate output file
    //


	if(argc < 10)
	{
		fprintf(stderr, "Not enough parameters");
		return -1;
	}
	std::string sHashRoutineName, sCharsetName, sSalt, sCheckPoints;
	uint32 nRainbowChainCount, nPlainLenMin, nPlainLenMax, nRainbowTableIndex, nRainbowChainLen;
	uint64 nChainStart;
	sHashRoutineName = argv[1];
	sCharsetName = argv[2];
	nPlainLenMin = atoi(argv[3]);
	nPlainLenMax = atoi(argv[4]);
	nRainbowTableIndex = atoi(argv[5]);
	nRainbowChainLen = atoi(argv[6]);
	nRainbowChainCount = atoi(argv[7]);
#ifdef _WIN32

	nChainStart = _atoi64(argv[8]);

#else
	nChainStart = atoll(argv[8]);
#endif
	sCheckPoints = argv[9];
	std::vector<uint32> vCPPositions;
	char *cp = strtok((char *)sCheckPoints.c_str(), ",");
	while(cp != NULL)
	{
		vCPPositions.push_back(atoi(cp));
		cp = strtok(NULL, ",");
	}
	if(argc == 11)
	{
		sSalt = argv[10];
	}
	//std::cout << "Starting ChainGenerator" << std::endl;
	// Setup CChainWalkContext
	//std::cout << "ChainGenerator started." << std::endl;

	if (!CChainWalkContext::SetHashRoutine(sHashRoutineName))
	{
		fprintf(stderr, "hash routine %s not supported\n", sHashRoutineName.c_str());
		return 1;
	}
	//std::cout << "Hash routine validated" << std::endl;

	if (!CChainWalkContext::SetPlainCharset(sCharsetName, nPlainLenMin, nPlainLenMax))
	{	
		std::cerr << "charset " << sCharsetName << " not supported" << std::endl;
		return 2;
	}
	//std::cout << "Plain charset validated" << std::endl;

	if (!CChainWalkContext::SetRainbowTableIndex(nRainbowTableIndex))
	{
		std::cerr << "invalid rainbow table index " << nRainbowTableIndex << std::endl;
		return 3;
	}
	//std::cout << "Rainbowtable index validated" << std::endl;

	if(sHashRoutineName == "mscache")// || sHashRoutineName == "lmchall" || sHashRoutineName == "halflmchall")
	{
		// Convert username to unicode
		const char *szSalt = sSalt.c_str();
		int salt_length = strlen(szSalt);
		unsigned char cur_salt[256];
		for (int i=0; i<salt_length; i++)
		{
			cur_salt[i*2] = szSalt[i];
			cur_salt[i*2+1] = 0x00;
		}
		CChainWalkContext::SetSalt(cur_salt, salt_length*2);
	}
	else if(sHashRoutineName == "halflmchall")
	{ // The salt is hardcoded into the hash routine
	//	CChainWalkContext::SetSalt((unsigned char*)&salt, 8);
	}
	else if(sHashRoutineName == "oracle")
	{
		CChainWalkContext::SetSalt((unsigned char *)sSalt.c_str(), sSalt.length());
	}
	//std::cout << "Opening chain file" << std::endl;

	
	// Open file
    boinc_resolve_filename("result", output_path, sizeof(output_path));
	fclose(boinc_fopen(output_path, "a"));
	FILE *outfile = boinc_fopen(output_path, "r+b");
	
	if (outfile == NULL)
	{
		std::cerr << "failed to create " << output_path << std::endl;
		return 4;
	}
	
	// Check existing chains
	unsigned int nDataLen = (unsigned int)GetFileLen(outfile);
	
	// Round to boundary
	nDataLen = nDataLen / 10 * 10;
	if (nDataLen == nRainbowChainCount * 10)
	{		
		std::cerr << "precomputation of this rainbow table already finished" << std::endl;
		fclose(outfile);
		return 0;
	}
	nChainStart += (nDataLen / 10);
	fseek(outfile, nDataLen, SEEK_SET);
	//XXX size_t isn't 32/64 clean
	size_t nReturn;
	CChainWalkContext cwc;
	uint64 nIndex[2];
	//time_t tStart = time(NULL);

//	std::cout << "Starting to generate chains" << std::endl;
	for(uint32 nCurrentCalculatedChains = nDataLen / 10; nCurrentCalculatedChains < nRainbowChainCount; nCurrentCalculatedChains++)
	{		
		uint32 cpcheck = 0;
		unsigned short checkpoint = 0;
		fd = (double)nCurrentCalculatedChains / (double)nRainbowChainCount;
		boinc_fraction_done(fd);
		cwc.SetIndex(nChainStart++); // use a given index now!
		nIndex[0] = cwc.GetIndex();
		
		for (uint32 nPos = 0; nPos < nRainbowChainLen - 1; nPos++)
		{
		//	std::cout << "IndexToPlain()" << std::endl;
			cwc.IndexToPlain();
		//	std::cout << "PlainToHash()" << std::endl;
			cwc.PlainToHash();
		//	std::cout << "HashToIndex()" << std::endl;
			cwc.HashToIndex(nPos);
			if(cpcheck < vCPPositions.size() && nPos == vCPPositions[cpcheck])
			{
				
				checkpoint |= (1 << cpcheck) & (unsigned short)cwc.GetIndex() << cpcheck;
				cpcheck++;
			}
		}
		//std::cout << "GetIndex()" << std::endl;

		nIndex[1] = cwc.GetIndex();
		// Write chain to disk
		if ((nReturn = fwrite(&nIndex[1], 1, 8, outfile)) != 8)
		{
			std::cerr << "disk write fail" << std::endl;
			fclose(outfile);
			return 9;
		}
		if((nReturn = fwrite(&checkpoint, 1, 2, outfile)) != 2)
		{
			std::cerr << "disk write fail" << std::endl;
			fclose(outfile);
			return 9;
		}
	}
	//std::cout << "Generation completed" << std::endl;
	fclose(outfile);
    
	boinc_fraction_done(1);
	boinc_finish(0);
}
Ejemplo n.º 7
0
void worker() {
	int nchars = 0;
	int retval;
    char input_path[512];
	char output_path[512];
	FILE* outfile;
	FILE *infile;

    boinc_resolve_filename(INPUT_FILE, input_path, sizeof(input_path));
#ifdef _WIN32
    infile = boinc_fopen(input_path, "rb");
#else
    infile = boinc_fopen(input_path, "r");
#endif
    if (!infile) {
        fprintf(stderr,
            "Couldn't find input file, resolved name %s.\n", input_path
        );
        exit(-1);
    }

	// Dance Dance Revolution
	dfio_load_file(infile);
	SBMatrix* matrix = new SBMatrix();
	retval = dfio_read_matrix(matrix);
	if (retval) {
        fprintf(stderr, "APP: bdance parse input file failed:\n");
        fprintf(stderr, "error code %d\n", retval);
		dfio_cleanup();
        exit(1);
    }
	dfio_cleanup();
	fclose(infile);


	// Solve
	dlx_solve(matrix);
	uxlong solutions = dlx_count_solutions();
	delete matrix;


	// Write results.
    boinc_resolve_filename(OUTPUT_FILE, output_path, sizeof(output_path));
	outfile = boinc_fopen(output_path, "w");
    if (!outfile) {
        fprintf(stderr,
            "Couldn't find output file, resolved name %s.\n", output_path
        );
        exit(-1);
    }

	dfio_new_file(outfile, DFIO_TYPE_RESULT);
//	if (dfio_get_prop(DFIO_PROP_NO_SOLUTION_DATA)) {
		dfio_set_prop(DFIO_PROP_RESULTS_NUM, solutions);
		dfio_write_headers();
//	}

	dfio_cleanup();
	fclose(outfile);
    boinc_finish(0);
}
Ejemplo n.º 8
0
void boinc_finish_(int* status) {
    boinc_finish(*status);
}
Ejemplo n.º 9
0
int main()
{

    int rc = boinc_init();
    if (rc)
    {
        fprintf(stderr, "APP: boinc_init() failed. rc=%d\n", rc);
        exit(rc);
    }


    srand(time(NULL));

    FILE *file_progress;

    unsigned long long int actual_iteration;
    int sleep_time;

    int read_checkpoint;

    read_checkpoint = checkpoint(&actual_iteration, 0); // Read checkpoint


    if(read_checkpoint == 1)
    {
        actual_iteration = 0;
    }


    for(actual_iteration; actual_iteration < ITERATIONS; actual_iteration++)
    {

        if (!(file_progress = fopen("progress", "wt")))
        {
            fprintf(stderr,"ERROR: CANNOT OPEN FILE PROGRESS\n");
        }
        else
        {
            if(actual_iteration == 0)
            {
                fprintf(file_progress, "0");
            }
            else
            {
                fprintf(file_progress, "%lf", ((double) actual_iteration / (double) ITERATIONS ) );
            }

            fclose(file_progress);

        }

        #if defined(_WIN32) || defined(_WIN64)

            sleep_time = (rand() % 7) + 1;
            sleep_time *= 1000;

            printf("ALX sleep...\n");
            Sleep(sleep_time);
            printf("ALX woke up...\n");

        #endif


        # ifdef __linux__

            sleep_time = (rand() % 7) + 1;

            printf("ALX sleep...\n");
            sleep(sleep_time);
            printf("ALX woke up...\n");

        # else

            sleep_time = (rand() % 7) + 1;

            printf("ALX sleep...\n");
            sleep(sleep_time);
            printf("ALX woke up...\n");

        # endif



        # ifdef BOINC_VERSION

            if( boinc_time_to_checkpoint() )
            {
                checkpoint(&actual_iteration, 1); // Save checkpoint
                boinc_checkpoint_completed();
            }

        # else

            checkpoint(&actual_iteration, 1); // Save checkpoint

        # endif


        boinc_fraction_done( ((double) actual_iteration) / ((double) ITERATIONS) );

    }



    // RESULTS FILE ---------------------------------------

    FILE *fp;

    if ((fp=fopen("result", "wt"))==NULL)
    {
        printf ("Error: No save result to the file!");
        return 1;
    }

    fprintf(fp, "1");

    fclose (fp);

    // RESULTS FILE ---------------------------------------



    boinc_fraction_done(1.0);
    boinc_finish(0);


    return 0;
}