Example #1
0
	ParallelTemperature(const ParametersType& params,
	                    SizeType threads)
	    : params_(params), omegaValue_(params.tt)
	{
		for (SizeType i = 0; i < threads; ++i) {
			PsimagLite::String name = filenameForThread(i);
			unlink(name.c_str());
		}
	}
Example #2
0
	void thread_function_(SizeType threadNum,
	                      SizeType blockSize,
	                      SizeType total,
	                      PsimagLite::Concurrency::MutexType*)
	{
		RealType ts = (params_.te - params_.tb)/params_.tt;

		PsimagLite::String name = filenameForThread(threadNum);
		std::ofstream fout(name.c_str(),std::ios::app);
		for (SizeType p = 0; p < blockSize; p++) {
			SizeType i = threadNum*blockSize + p;
			if (i >= total) break;
			RealType t = params_.tb + i*ts;
			HeisenbergType heisenberg(params_,t,fout);
			omegaValue_[i] = PairRealType(heisenberg.energy(),
			                              heisenberg.sz());
		}

		fout.close();
	}