aboutsummaryrefslogtreecommitdiff
path: root/mpiosh/callback.c
diff options
context:
space:
mode:
authorgermeier <germeier>2002-09-18 22:18:29 +0000
committergermeier <germeier>2002-09-18 22:18:29 +0000
commit71ab9acfd97cf1f71c1f66f5e1a8b879c0960e40 (patch)
treeffeaaddfa7cfd37d66d790427b6ecd10baa51664 /mpiosh/callback.c
parent4a49120603daab9f9ad280f0ef44e36b0218a302 (diff)
downloadmpiosh-71ab9acfd97cf1f71c1f66f5e1a8b879c0960e40.tar.gz
mpiosh-71ab9acfd97cf1f71c1f66f5e1a8b879c0960e40.tar.bz2
mpiosh-71ab9acfd97cf1f71c1f66f5e1a8b879c0960e40.zip
removed wrong block mapping
added progress_callback for mpio_init mpiosh: external memory is only selectable if it is available
Diffstat (limited to 'mpiosh/callback.c')
-rw-r--r--mpiosh/callback.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/mpiosh/callback.c b/mpiosh/callback.c
index df4a3ab..bdcb345 100644
--- a/mpiosh/callback.c
+++ b/mpiosh/callback.c
@@ -2,7 +2,7 @@
*
* Author: Andreas Büsching <crunchy@tzi.de>
*
- * $Id: callback.c,v 1.9 2002/09/18 20:32:22 crunchy Exp $
+ * $Id: callback.c,v 1.10 2002/09/18 22:18:29 germeier Exp $
*
* Copyright (C) 2001 Andreas Büsching <crunchy@tzi.de>
*
@@ -160,13 +160,20 @@ mpiosh_cmd_info(char *args[])
void
mpiosh_cmd_mem(char *args[])
{
+ int free;
+
MPIOSH_CHECK_CONNECTION_CLOSED;
MPIOSH_CHECK_ARG;
if (!strcmp(args[0], "e")) {
- mpiosh.card = MPIO_EXTERNAL_MEM;
- mpiosh.prompt = PROMPT_EXT;
- printf("external memory card is selected\n");
+ if (mpio_memory_free(mpiosh.dev, mpiosh.card, &free)) {
+ mpiosh.card = MPIO_EXTERNAL_MEM;
+ mpiosh.prompt = PROMPT_EXT;
+ printf("external memory card is selected\n");
+ } else {
+ printf("no external memory card is available\n");
+ }
+
} else if (!strcmp(args[0], "i")) {
mpiosh.card = MPIO_INTERNAL_MEM;
mpiosh.prompt = PROMPT_INT;
@@ -183,7 +190,8 @@ mpiosh_cmd_open(char *args[])
UNUSED(args);
- mpiosh.dev = mpio_init();
+ mpiosh.dev = mpio_init(mpiosh_callback_init);
+ printf("\n");
if (mpiosh.dev == NULL)
printf("error: could not open connection MPIO player\n");
@@ -218,6 +226,15 @@ mpiosh_cmd_quit(char *args[])
}
BYTE
+mpiosh_callback_init(int read, int total)
+{
+ printf("\rinitialized %.2f %%", ((double) read / total) * 100.0 );
+ fflush(stdout);
+
+ return mpiosh_cancel; // continue
+}
+
+BYTE
mpiosh_callback_get(int read, int total)
{
printf("\rretrieved %.2f %%", ((double) read / total) * 100.0 );