void CondorFileTable::checkpoint()
{
	int temp;

	dprintf(D_ALWAYS,"CondorFileTable::checkpoint\n");

	dump();

	if( MyImage.GetMode() != STANDALONE ) {
		REMOTE_CONDOR_get_buffer_info( &buffer_size, &buffer_block_size, 
			&temp );
	}
	dprintf(D_ALWAYS,"working dir = %s\n",working_dir);

	for( int i=0; i<length; i++ ) {
		if( pointers[i] ) {
			if( pointers[i]->file ) {
				if( count_file_uses(pointers[i]->file)==1 ) {
					temp = pointers[i]->file->close();
					if( temp==-1 ) {
						_condor_error_retry("Unable to commit data to file %s!\n",pointers[i]->file->get_url());
					}
					delete pointers[i]->file;
				}
				pointers[i]->file=0;						
			}
		}
	}

	report_all();
}
int main(int argc, char *argv[]) {
	int my_rank;
	double mpi_start_time, mpi_end_time;
	deme *subpop = (deme*) malloc(sizeof(deme));

	MPI_Init(&argc, &argv);
	MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
	init_population(subpop, argc, argv);
	mpi_start_time = MPI_Wtime();

	while (!subpop->complete) {
		migration(subpop);
		reproduction(subpop);
		crossover(subpop);
		mutation(subpop);
		fitness(subpop);
		subpop->old_pop = subpop->new_pop;
		subpop->cur_gen++;
		check_complete(subpop);
		sync_complete(subpop);
		report_all(subpop);
	}
	
	mpi_end_time = MPI_Wtime();
	report_fittest(subpop);
	MPI_Finalize();
	printf("[%i] Elapsed time: %f\n", my_rank, mpi_end_time - mpi_start_time);
	return 1;
}