1
1

Fixup tests for recent api changes

cleanup a ton of warnings, include proper files

fix orte_ring, it had a deadlock in it...

fix the abort test so it can be used with less than 4 processes

This commit was SVN r14787.
Этот коммит содержится в:
Tim Prins 2007-05-29 16:22:50 +00:00
родитель dd8bea2ea2
Коммит b4e3ad8da0
10 изменённых файлов: 33 добавлений и 18 удалений

Просмотреть файл

@ -4,25 +4,24 @@
#include <unistd.h>
#include <errno.h>
#include <sys/resource.h>
#include <string.h>
int main(int argc, char* argv[])
{
int i = 0;
pid_t pid;
struct rlimit rlim;
if (getrlimit (RLIMIT_NOFILE, &rlim) < 0)
fprintf (stderr, "getrlimit (RLIMIT_NOFILE): %s\n", strerror (errno));
else {
printf("softlimit on num_files: %d\thardlimit on num_files: %d\n", rlim.rlim_cur, rlim.rlim_max);
printf("softlimit on num_files: %d\thardlimit on num_files: %d\n", (int)rlim.rlim_cur, (int)rlim.rlim_max);
}
if (getrlimit (RLIMIT_NPROC, &rlim) < 0)
fprintf (stderr, "getrlimit (RLIMIT_NPROC): %s\n", strerror (errno));
else {
printf("softlimit on num_child: %d\thardlimit on num_child: %d\n", rlim.rlim_cur, rlim.rlim_max);
printf("softlimit on num_child: %d\thardlimit on num_child: %d\n", (int)rlim.rlim_cur, (int)rlim.rlim_max);
}
printf("RLIM_INFINITY: %d\n", RLIM_INFINITY);
printf("RLIM_INFINITY: %d\n", (int)RLIM_INFINITY);
return 0;
}

Просмотреть файл

@ -9,6 +9,7 @@
#include <stdio.h>
#include <unistd.h>
#include "orte/runtime/runtime.h"
#include "orte/util/proc_info.h"
int main(int argc, char* argv[])
@ -19,7 +20,7 @@ int main(int argc, char* argv[])
pid_t pid;
char hostname[500];
if (0 > (rc = orte_init())) {
if (0 > (rc = orte_init(ORTE_NON_INFRASTRUCTURE, ORTE_USE_BARRIER))) {
fprintf(stderr, "orte_abort: couldn't init orte - error code %d\n", rc);
return rc;
}
@ -34,7 +35,9 @@ int main(int argc, char* argv[])
i++;
pi = i / 3.14159256;
if (i > 10000) i = 0;
if (orte_process_info.my_name->vpid == 3 && i == 9995) {
if ((orte_process_info.my_name->vpid == 3 ||
(orte_process_info.num_procs <= 3 && orte_process_info.my_name->vpid == 0))
&& i == 9995) {
orte_abort(1, true);
}
}

Просмотреть файл

@ -1,5 +1,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "orte/runtime/runtime.h"

Просмотреть файл

@ -1,7 +1,9 @@
/*file .c : spawned the file Exe*/
#include <stdio.h>
#include <unistd.h>
#include "opal/threads/condition.h"
#include "opal/util/argv.h"
#include "orte/util/proc_info.h"
#include "orte/mca/rmgr/rmgr.h"

Просмотреть файл

@ -6,6 +6,7 @@
*/
#include <stdio.h>
#include <unistd.h>
#include "orte/util/proc_info.h"
#include "orte/runtime/runtime.h"

Просмотреть файл

@ -8,7 +8,9 @@
#include <stdio.h>
#include "opal/threads/condition.h"
#include "opal/util/argv.h"
#include "orte/runtime/runtime.h"
#include "orte/util/proc_info.h"
#include "orte/dss/dss.h"
#include "orte/mca/gpr/gpr.h"
@ -37,7 +39,7 @@ int main(int argc, char* argv[])
OBJ_CONSTRUCT(&cond, opal_condition_t);
waitexit = false;
if (0 > (rc = orte_init())) {
if (0 > (rc = orte_init(ORTE_NON_INFRASTRUCTURE, ORTE_USE_BARRIER))) {
fprintf(stderr, "couldn't init orte - error code %d\n", rc);
return rc;
}
@ -106,6 +108,7 @@ static void job_state_callback(orte_jobid_t jobid, orte_proc_state_t state)
static void eclipse_launch_cb(orte_gpr_notify_data_t *notify_data, void *user_tag)
{
#if 0
int len;
orte_std_cntr_t i;
orte_std_cntr_t j;
@ -118,6 +121,7 @@ static void eclipse_launch_cb(orte_gpr_notify_data_t *notify_data, void *user_ta
char * res;
char * kv = NULL;
char * vpid = NULL;
#endif
fprintf(stderr, "launch cb entered\n");
orte_dss.dump(0, notify_data, ORTE_GPR_NOTIFY_DATA);

Просмотреть файл

@ -10,7 +10,7 @@
#include "orte/runtime/runtime.h"
#define MY_TAG 12345
#define MAX_COUNT 20
#define MAX_COUNT 3
# define false 0
# define true 1
@ -25,7 +25,6 @@ main(int argc, char *argv[]){
orte_process_name_t left_peer_orte_name;
int num_peers = 0;
struct iovec msg;
int ret;
/*
* Init
@ -81,6 +80,7 @@ main(int argc, char *argv[]){
}
}
while (counter <= MAX_COUNT ) {
int *cnt;
@ -100,15 +100,18 @@ main(int argc, char *argv[]){
cnt = (int *) msg.iov_base;
counter = *cnt;
if(counter > MAX_COUNT)
break;
/* Update */
printf("%s) Recv %d ... Send %d\n", my_name, counter, counter + 1);
if( orte_process_info.my_name->vpid == 0 ) {
sleep(2);
}
if(orte_process_info.my_name->vpid == 0) {
counter++;
}
if(counter > MAX_COUNT && right_peer_orte_name.vpid == 0) {
break;
}
/* Send to right */
msg.iov_base = (void *) &counter;
@ -124,8 +127,6 @@ main(int argc, char *argv[]){
}
}
cleanup:
orte_finalize();
return 0;

Просмотреть файл

@ -8,6 +8,7 @@
#include <stdio.h>
#include "opal/threads/condition.h"
#include "opal/util/argv.h"
#include "orte/util/proc_info.h"
#include "orte/mca/rmgr/rmgr.h"

Просмотреть файл

@ -6,12 +6,13 @@
*/
#include <stdio.h>
#include "orte_config.h"
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#include "opal/runtime/opal.h"
#include "opal/util/output.h"
#include "orte/util/proc_info.h"
#include "orte/runtime/runtime.h"

Просмотреть файл

@ -7,8 +7,10 @@
*/
#include <stdio.h>
#include <unistd.h>
#include "orte/util/proc_info.h"
#include "orte/runtime/runtime.h"
int main(int argc, char* argv[])
{
@ -17,7 +19,7 @@ int main(int argc, char* argv[])
double pi;
pid_t pid;
if (0 > (rc = orte_init())) {
if (0 > (rc = orte_init(ORTE_NON_INFRASTRUCTURE, ORTE_NON_BARRIER))) {
fprintf(stderr, "spin: couldn't init orte - error code %d\n", rc);
return rc;
}