소스 검색

- fix examples with respect to the way to request the default sched_ctx policy

Olivier Aumage 9 년 전
부모
커밋
1782331645
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 3
      examples/native_fortran/nf_sched_ctx.f90
  2. 3 1
      examples/sched_ctx/two_cpu_contexts.c

+ 3 - 3
examples/native_fortran/nf_sched_ctx.f90

@@ -97,13 +97,13 @@ program nf_sched_ctx
                 write(*,*) i, procs2(i)
         end do
 
-        ! create sched context 1 with default policy
+        ! create sched context 1 with default policy, by giving a NULL policy name
         ctx1 = fstarpu_sched_ctx_create(procs1, nprocs1,  &
             C_CHAR_"ctx1"//C_NULL_CHAR, &
-            (/ FSTARPU_SCHED_CTX_POLICY_STRUCT, c_null_ptr, c_null_ptr /) &
+            (/ FSTARPU_SCHED_CTX_POLICY_NAME, c_null_ptr, c_null_ptr /) &
             )
 
-        ! create sched context 2 with policy name
+        ! create sched context 2 with a user selected policy name
         ctx2 = fstarpu_sched_ctx_create(procs2, nprocs2,  &
             C_CHAR_"ctx2"//C_NULL_CHAR, &
             (/ FSTARPU_SCHED_CTX_POLICY_NAME, c_loc(ctx2_policy), c_null_ptr /))

+ 3 - 1
examples/sched_ctx/two_cpu_contexts.c

@@ -72,7 +72,9 @@ int main(int argc, char **argv)
 		procs2[i] = procs[i+nprocs1];
 	}
 
-	unsigned sched_ctx1 = starpu_sched_ctx_create(procs1, nprocs1, "ctx1", STARPU_SCHED_CTX_POLICY_STRUCT, NULL, 0);
+        /* create sched context 1 with default policy, by giving a NULL policy name */
+	unsigned sched_ctx1 = starpu_sched_ctx_create(procs1, nprocs1, "ctx1", STARPU_SCHED_CTX_POLICY_NAME, NULL, 0);
+        /* create sched context 2 with a user selected policy name */
 	unsigned sched_ctx2 = starpu_sched_ctx_create(procs2, nprocs2, "ctx2", STARPU_SCHED_CTX_POLICY_NAME, "eager", 0);
 
 	starpu_sched_ctx_set_inheritor(sched_ctx2, sched_ctx1);