char *biosal_command_get_output_directory(int argc, char **argv) { char *directory_name; char *value; directory_name = BIOSAL_DEFAULT_OUTPUT; value = core_command_get_argument_value(argc, argv, "-o"); if (value != NULL) { directory_name = value; } return directory_name; }
void thorium_transport_select_implementation(struct thorium_transport *self, int argc, char ** argv) { char *requested_implementation_name; struct core_vector implementations; int i; int size; struct thorium_transport_interface *component; char *available_name; /* * Prepare a list of potential transport implementations to * use. */ core_vector_init(&implementations, sizeof(struct thorium_transport_interface *)); /* MPI non-blocking, this is the default. */ component = &thorium_mpi1_pt2pt_nonblocking_transport_implementation; core_vector_push_back(&implementations, &component); component = &thorium_mpi1_pt2pt_transport_implementation; core_vector_push_back(&implementations, &component); /* * Only enable the pami thing on Blue Gene/Q. */ #ifdef CONFIG_PAMI #if defined(__bgq__) component = &thorium_pami_transport_implementation; core_vector_push_back(&implementations, &component); #endif #endif #if defined(_CRAYC) && 0 component = &thorium_gni_transport_implementation; core_vector_push_back(&implementations, &component); #endif requested_implementation_name = core_command_get_argument_value(argc, argv, "-transport"); /* * The default is the first one in the list. */ self->transport_interface = *(struct thorium_transport_interface **)core_vector_at(&implementations, 0); /* * The option -transport was provided. * * Possible values are: * * -transport mpi1_pt2pt_nonblocking_transport * -transport mpi1_pt2pt_transport * -transport thorium_pami_transport_implementation */ if (requested_implementation_name != NULL) { size = core_vector_size(&implementations); for (i = 0; i < size; ++i) { component = *(struct thorium_transport_interface **)core_vector_at(&implementations, i); available_name = component->name; if (strcmp(available_name, requested_implementation_name) == 0) { self->transport_interface = component; break; } } } core_vector_destroy(&implementations); CORE_DEBUGGER_ASSERT(self->transport_interface != NULL); }