我正在尝试从txt文件读取int并加倍。 当我在控制台中运行该进程时,一切正常,但是当我通过单个进程处理MPI时,会给我一个错误:
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
Widget build(context) {
return ScopedModel(
model: new CounterModel(),
child: Scaffold(
appBar: AppBar(
title: Text('ScopedModel'),
),
body: ScopedModelDescendant<CounterModel>(
builder: (context, child, value) {
return Text("Pressed ${value.counter} times");
},
),
floatingActionButton: Builder(
builder: (context) {
// return buildFab1() if fab one required
return buildFab2(context);
},
),
),
);
}
Widget buildFab1() {
return ScopedModelDescendant<CounterModel>(
builder: (context, child, model) => FloatingActionButton(
child: Icon(Icons.add),
onPressed: model.incrementCounter,
),
);
}
Widget buildFab2(BuildContext context) {
return FloatingActionButton(
child: Icon(Icons.add),
onPressed: ScopedModel.of<CounterModel>(context).incrementCounter,
);
}
}
我只使用了两个命令来读取文件:
$ ./a.out
job aborted:
rank: node: exit code [: error message]
0: DESKTOP-QUJB667: -1073740791: process 0 exited without calling finalize
从文件读取的问题只是我要做的更广泛任务的初始阶段。
FILE * file = fopen ("pixel.txt", "r");
fscanf (file, "% d", & numOfPixelsInFile);