avoid sprintf
This commit is contained in:
@ -1598,14 +1598,9 @@ void MinHFTN::open_hftn_print_file_()
|
|||||||
int nMyRank;
|
int nMyRank;
|
||||||
MPI_Comm_rank (world, &nMyRank);
|
MPI_Comm_rank (world, &nMyRank);
|
||||||
|
|
||||||
char szTmp[50];
|
auto szTmp = fmt::format("progress_MinHFTN_{}.txt", nMyRank);
|
||||||
sprintf (szTmp, "progress_MinHFTN_%d.txt", nMyRank);
|
_fpPrint = fopen (szTmp.c_str(), "w");
|
||||||
_fpPrint = fopen (szTmp, "w");
|
if (_fpPrint == nullptr) return;
|
||||||
if (_fpPrint == nullptr) {
|
|
||||||
printf ("*** MinHFTN cannot open file '%s'\n", szTmp);
|
|
||||||
printf ("*** continuing...\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf (_fpPrint, " Iter Evals Energy |F|_2"
|
fprintf (_fpPrint, " Iter Evals Energy |F|_2"
|
||||||
" Step TR used |step|_2 ared pred\n");
|
" Step TR used |step|_2 ared pred\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user