Newsgroups: comp.parallel.pvm
From: johan@PROBLEM_WITH_INEWS_GATEWAY_FILE (Johan Meijdam)
Subject: fscanf() problem
Organization: Delft University of Technology
Date: Mon, 14 Nov 1994 12:29:27 GMT
Message-ID: <Cz9C15.F0s@dutiws.twi.tudelft.nl>
 
My pvm 3.3.4 daemon doesn't read any files using the fscanf() function.
As far as I know, it ought to do that. In encountered that problem
when I was writing a parent program that should read a text file 
containing floating point numbers, and then send the contents of that
file to its children. I work with a HPPA architecture.

I made a sample program, and the output shows where it stopped functioning:
during the first fscanf() call it encountered. I wonder, is this a bug or
is it something else?


Yours,
	Johan Meijdam
	johan@pa.twi.tudelft.nl


The output was:

pvm> spawn -> pvmfileio
[3]
1 successful
t40004
pvm> 
[3:t40004] Three
[3:t40004] Four
[3:t40004] Five
[3:t40004] EOF
[3] finished
 
The program is:

/* pvmfileio.c */
 
/* To be run using the pvm3.3.4 console */
/* The large version of this program reads the contents of a text file */
/* filled with floating point numbers */
/* and sends it to its children; this version displays it on screen */
/* The printf() statements are put to the right to improve reading the code */
 
#include <stdio.h>
#include "pvm3.h"
 
main()
{       FILE *invoer;
        float getal;
        int  t;
 
                                printf("One\n");
        t = pvm_mytid();
                                printf("Two\n");
        setbuf(stdout, NULL);
                                printf("Three\n");
        invoer = fopen("v", "r");
                                printf("Four\n");
        while (!feof(invoer)) {
                                printf("Five\n");
                t = fscanf(invoer, "%f", &getal);
                if (t != EOF) {
                        printf("Number: %f\n", getal);
                }
        }
                                printf("Six\n");
        fclose(invoer);
                                printf("Seven\n");
        t = pvm_exit();
                                printf("Eight\n");
}
 

Newsgroups: comp.parallel.pvm
Summary: 
Keywords: 



