Commit 9eae25d0 authored by Matthias Schroeder's avatar Matthias Schroeder

minor changes and flush after each progress line

parent e051e1eb
......@@ -64,7 +64,7 @@ Count counts[] = {
{ "O" ,0, 91 },
{ "N" ,0, 51 },
{ "S" ,0, 31 },
{ "P" ,0, 0 },
{ "P" ,0, 0 }, // 0..20
{ "Cl" ,0, 2 },
};
int nbr_counts= sizeof(counts)/sizeof(Count);
......@@ -72,6 +72,7 @@ int argP=0;
int64_t lines_written = 0;
double flush_mass(int midx) {
char filename[256];
FILE *fp;
......@@ -136,7 +137,7 @@ Mol* check_and_store_mol() {
Mol* mol;
for (int i = 0; i < nbr_counts; ++i) {
if (0 == strcmp(counts[i].e.formel, "C")) cC= counts[i].cur;
if (0 == strcmp(counts[i].e.formel, "C")) cC= (double)counts[i].cur;
else if (0 == strcmp(counts[i].e.formel, "H")) cH= (double)counts[i].cur;
else if (0 == strcmp(counts[i].e.formel, "O")) cO= (double)counts[i].cur;
else if (0 == strcmp(counts[i].e.formel, "N")) cN= (double)counts[i].cur;
......@@ -188,7 +189,6 @@ int next_mol() {
}
void main(int argc, char* *argv) {
int64_t cnt_mol=0;
Mol* mol;
......@@ -200,7 +200,7 @@ void main(int argc, char* *argv) {
argP= 0;
}
printf("%dCreate with p=%d\n", argc, argP);
printf("Create Mols with P_%d\n", argP);
char dirname[32];
struct stat sb;
......@@ -229,10 +229,11 @@ void main(int argc, char* *argv) {
while (1) {
if (mol = check_and_store_mol()) {
cnt_mol += 1;
if (cnt_mol % 1000000 == 0) {
if (cnt_mol % 100000 == 0) {
printf(". ");
if (cnt_mol % 50000000 == 0) {
printf("%ld %s %ld\n", cnt_mol, mol->formel, mol->mass);
if (cnt_mol % 5000000 == 0) {
printf("%ld %s\n", cnt_mol, mol->formel);
fflush(stdout);
}
}
// printf("%f %s\n", mass_mol(), format_mol());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment